Player 1-3-2-6 Class¶
This section will describe a player who has a complex internal state. We will also digress on the way the states can be modeled using a group of polymorphic classes.
We’ll start by examining the essential 1-3-2-6 betting strategy in Player 1-3-2-6 Analysis.
This will lead us to considering stateful design and how to properly handle polymorphism. This is the subject of On Polymorphism.
We’ll address some additional design topics in Player 1-3-2-6 Questions and Answers.
The design is spread across several sections:
Once we’ve defined the various states, the overall player can be covered in Player1326 Design.
We’ll enumerate the deliverables in Player 1-3-2-6 Deliverables.
There are some more advanced topics here. First, we’ll look at alternative designs in Advanced Exercise – Refactoring. Then, we’ll look at ways to reuse state objects in Advanced Exercise – Less Object Creation. Finally, we’ll examine the Factory design pattern in Player1326 State Factory Design.
Player 1-3-2-6 Analysis¶
On the Internet, we found descriptions of a betting system called the “1-3-2-6” system. This system looks to recoup losses by waiting for four wins in a row. The sequence of numbers (1, 3, 2 and 6) are the multipliers to use when placing bets after winning.
The base bet, is the table minimum. At each loss, the sequence resets to the multiplier of 1. The bet is .
At each win, the multiplier is advanced. It works like this:
After one win, the multiplier advances to 3×, the bet is . This is done by leaving the winnings in place, and adding to them.
After a second win, the bet is reduced to 2×, and the winnings of 4× are taken off the table.
In the event of a third win, the bet is advanced to 6× by putting the 4× back into play.
Should there be a fourth win, the sequence resets to 1×. The winnings from the final 6× bet are the hoped-for profit.
This betting system makes our player more stateful than in previous
betting systems. When designing the SevenReds
class, we noted that
this player was stateful; that case, the state was a simple count.
In this case, the description of the betting system seems to identify four states: no wins, one win, two wins, and three wins. In each of these states, we have specific bets to place, and state transition rules that tell us what to do next. The following table summarizes the states, the bets and the transition rules.
Current State |
Bet Amount |
On loss, change to: |
On win, change to: |
|---|---|---|---|
No Wins |
1 |
One Win |
No Wins |
One Win |
3 |
Two Wins |
No Wins |
Two Wins |
2 |
Three Wins |
No Wins |
Three Wins |
6 |
No Wins |
No Wins |
When we are in a given state, the table gives us the amount to bet in the Bet column. If this bet wins, we transition to the state named in the On Win column, otherwise, we transition to the state named in the On Loss column. We always start in the No Wins state.
Design Pattern. We can exploit the State design pattern to implement this more sophisticated player. The design pattern suggests that we create a hierarchy of classes to represent these four states. Each state will have a slightly different bet amount, and different state transition rules. Each individual state class will be relatively simple, but we will have isolated the processing unique to each state into separate classes.
One of the consequences of the State design pattern is that
it obligates us to define the interface between the Player
class
and the object that holds the Player
object’s current state.
It seems best to have the state object follow the table shown above and provide three methods:
currentBet()
, nextWon()
, and nextLost()
.
The Player
can use these methods of the state object to
place bets and pick a new state.
A state’s
currentBet()
method will construct aBet
object from anOutcome
instance that thePlayer
object keeps, and the multiplier that is unique to the state. As the state changes, the multiplier moves between 1, 3, 2 and 6.A state’s
nextWon()
method constructs a new state object based on the state transition table when the last bet was a winner.A state’s
nextLost()
method constructs a new state based on the state transition table when the last bet was a loser. In this case, all of the various states create a new instance of theNoWins
object, resetting the multiplier to 1 and starting the sequence over again.
On Polymorphism¶
One very important note is that we never have to check the class of any object. This is so important, we will repeat it here.
Important
We don’t use isinstance()
.
We use polymorphism and design all subclasses to have the same interface.
Python relies on duck typing:
“if it walks like a duck and quacks like a duck, it is a duck”
This means we will define class membership using a very simple rule. If an object has the requested method, then it’s a member of the class.
This is unlike languages where class membership is defined by the hierarchy of class definitions. Python defines membership only by the presence of attributes and methods.
Additionally, Python relies on the principle that it’s better to seek forgiveness than ask permission.
This translates to an approach where an object’s methods are simply invoked. If the object implements the methods, then it walked like a duck and – for all practical purposes – actually was a duck. If the method is not implemented, the application has a serious design problem and needs to crash.
We find the isinstance()
function is sometimes used by
beginning programmers who have failed to properly delegate
processing to the subclass.
Often, when a responsibility has been left out of the class hierarchy, it is allocated to the client object. The typical Pretty-Poor Polymorphism looks like the following:
Pretty Poor Polymorphism
class SomeClient:
def someMethod(self, x):
if isinstance(x, AClass):
Special Case that should have been part of AClass
In all cases, uses of isinstance()
function must be examined
critically.
Generally, we can avoid isinstance()
tests by refactoring the special
case out of the collaborating class. There will be three changes as part of the refactoring.
We will move the special-case the functionality into the class being referenced by the
isinstance()
function. In the above example, the special case is moved to theAClass
class.We will usually have to add default processing to the superclass of
AClass
so that all other sibling classes of theAClass
class will have an implementation of the special-case feature.We simply call the refactored method from the client class.
This refactoring leads to a class hierarchy that has the property of being polymorphic: all of the subclasses have the same interface: all objects of any class in the hierarchy are interchangeable. Each object is, therefore, responsible for correct behavior. More important, a client object does not need to know which subclass the object is a member of: it simply invokes methods which are defined with a uniform interface across all subclasses.
Player 1-3-2-6 Questions and Answers¶
Why code the state as objects?
The reason for encoding a states as an object is to encapsulate the information and the behavior associated with that state. In this case, we have both the bet amount and the rules for transition to next state. While simple, these are still unique to each state.
Since this is a book on design, we feel compelled to present the best design. In games like blackjack, the player’s state may have much more complex information and behavior. In those games, this design pattern will be very helpful. In this one case only, the design pattern appears to be over-engineered.
We will use this same design pattern to model the state changes in the Craps game itself. In the case of the Craps game, there is additional information as well as behavior changes. When the state changes, bets are won or lost, bets are working or not, and outcomes are allowed or prohibited.
Isn’t it simpler to code the state as a number? We can just increment when we win, and reset to zero when we lose.
The answer to all “isn’t it simpler” questions is “yes, but…” In this case, the full answer is “Yes, but what happens when you add a state or the states become more complex?”
This question arises frequently in OO programming. Variations on this question include “Why is this an entire object?” and “Isn’t an object over-engineering this primitive type?” See Design Decision – Object Identity FAQ entry on the
Outcome
class for additional background on object identity.Our goal in OO design is to isolate responsibility. First, and most important, we can unambiguously isolate the responsibilities for each individual state. Second, we find that it is very common that only one state changes, or new states get added. Given these two conditions, the best object model is separate state objects.
Doesn’t this create a vast number of state objects at run time?
Yes.
There are two usual follow-up questions: “Aren’t all those objects a lot of memory overhead?” or “…a lot of processing overhead?”
Since Python removes unused objects, each old state object are removed when no longer required.
Object creation is an overhead that we can control. One common approach is to use the Singleton design pattern to have only one instance of each class.
If performance becomes a problem, the rework can be helpful. Until performance is clearly a problem, there’s not benefit to the premature optimization of a non-problem.
Is Polymorphism necessary?
In some design patterns, like State and Command, it is essential that all subclasses have the same interface and be uniform, indistinguishable, almost anonymous instances. Because of this polymorphic property, the objects can be invoked in a completely uniform way.
In our exercise, we will design a number of different states for the player. Each state has the same interface. The actual values for the instance variables and the actual operation implemented by a subclass method will be unique. Since the interfaces are uniform, however, we can trust all state objects to behave properly.
There are numerous designs where polymorphism doesn’t matter at all. In many cases, the anonymous uniformity of subclasses isn’t relevant. When we look at the other casino games, we will see many examples of non-polymorphic class hierarchies. This will be due to the profound differences between the various games and their level of interaction with the players.
Player1326 State Design¶
-
class
Player1326State
¶ Player1326State
is the superclass for all of the states in the 1-3-2-6 betting system.
Fields¶
-
Player1326State.
player
¶ The
Player1326
player currently in this state. This player object will be used to provide theOutcome
object that will be used to create theBet
instance.
Constructors¶
-
Player1326State.
__init__
(self, player: Player) → None The constructor for this class saves the
Player1326
instance.
Methods¶
-
Player1326State.
currentBet
(self) → Bet¶ Constructs a new
Bet
object from the player’s preferredOutcome
instance. Each subclass provides a different multiplier used when creating thisBet
object.In Python, the superclass method should return
NotImplemented
. This is a big debugging aid, it helps us locate subclasses which did not provide a method body.
-
Player1326State.
nextWon
(self) → "Player1326State"¶ Constructs the new
Player1326State
instance to be used when the bet was a winner.In Python, this method should return
NotImplemented
. This is a big debugging aid, it helps us locate subclasses which did not provide a method body.Note the type hint for this method is provided as a string. We can’t reference the
Player1326State
type within the body of the class definition. Instead of naming the type directly, we use a string.def nextWon(self) -> "Player1326State": ...
-
Player1326State.
nextLost
(self) → "Player1326State" Constructs the new
Player1326State
instance to be used when the bet was a loser. This method is the same for each subclass: it creates a new instance ofPlayer1326NoWins
.This defined in the superclass to assure that it is available for each subclass.
Player1326 No Wins Design¶
-
class
Player1326NoWins
¶ Player1326NoWins
defines the bet and state transition rules in the 1-3-2-6 betting system. When there are no wins, the base bet value of 1 is used.
Methods¶
-
Player1326NoWins.
currentBet
(self) → Bet¶ Constructs a new
Bet
from the player’soutcome
information. The bet multiplier is 1.
-
Player1326NoWins.
nextWon
(self) → Player1326State¶ Constructs the new
Player1326OneWin
instance to be used when the bet was a winner.
Player1326 One Win Design¶
-
class
Player1326OneWin
¶ Player1326OneWin
defines the bet and state transition rules in the 1-3-2-6 betting system. When there is one wins, the base bet value of 3 is used.
Methods¶
-
Player1326OneWin.
currentBet
(self) → Bet¶ Constructs a new
Bet
from the player’soutcome
information. The bet multiplier is 3.
-
Player1326OneWin.
nextWon
(self) → Player1326State¶ Constructs the new
Player1326TwoWins
instance to be used when the bet was a winner.
Player1326 Two Wins Design¶
-
class
Player1326TwoWins
¶ Player1326TwoWins
defines the bet and state transition rules in the 1-3-2-6 betting system. When there are two wins, the base bet value of 2 is used.
Methods¶
-
Player1326TwoWins.
currentBet
(self) → Bet¶ Constructs a new
Bet
from the player’soutcome
information. The bet multiplier is 2.
-
Player1326TwoWins.
nextWon
(self) → Player1326State¶ Constructs the new
Player1326ThreeWins
instance to be used when the bet was a winner.
Player1326 Three Wins¶
-
class
Player1326ThreeWins
¶ Player1326ThreeWins
defines the bet and state transition rules in the 1-3-2-6 betting system. When there are three wins, the base bet value of 6 is used.
Methods¶
-
Player1326ThreeWins.
currentBet
(self) → Bet¶ Constructs a new
Bet
from the player’soutcome
information. The bet multiplier is 6.
-
Player1326ThreeWins.
nextWon
(self) → Player1326State¶ Constructs the new
Player1326NoWins
instance to be used when the bet was a winner.An alternative is to update the player to indicate that the player is finished playing.
Player1326 Design¶
-
class
Player1326
¶ Player1326
follows the 1-3-2-6 betting system. The player has a preferredOutcome
instance. This should be an even money bet like red, black, even, odd, high or low. The player also has a current betting state that determines the current bet to place, and what next state applies when the bet has won or lost.
Fields¶
-
Player1326.
outcome
¶ This is the player’s preferred
Outcome
instance. During construction, the Player must fetch this from theWheel
object.
-
Player1326.
state
¶ This is the current state of the 1-3-2-6 betting system. It will be an instance of a subclass of
Player1326State
class. This will be one of the four states: No Wins, One Win, Two Wins or Three Wins.
Constructors¶
-
Player1326.
__init__
(self, table: Table) → None Initializes the state and the outcome. The
state
is set to the initial state of an instance ofPlayer1326NoWins
class.The
outcome
is set to some even money proposition, for example"Black"
. The code should be something liketable.wheel.getOutcome("Black")
.
Methods¶
-
Player1326.
placeBets
(self) Updates the
Table
with a bet created by the current state. This method delegates the bet creation tostate
object’scurrentBet()
method.
Player 1-3-2-6 Deliverables¶
There are eight deliverables for this exercise. Additionally, there is an optional, more advanced design exercise in a separate section.
The five classes that make up the
Player1326State
class hierarchy.The
Player1326
class.A Unit test for the entire
Player1326State
class hierarchy. It’s possible to unit test each state class, but they’re so simple that it’s often easier to simply test the entire hierarchy.A unit test of the
Player1326
class. This test should synthesize a fixed list ofOutcome
instances,Bin
instances, and calls aPlayer1326
instance with various sequences of reds and blacks. There are 16 different sequences of four winning and losing bets. These range from four losses in a row to four wins in a row.An update to the overall
Simulator
that uses thePlayer1326
.
Advanced Exercise – Refactoring¶
Initially, each subclass of Player1326State
has a unique currentBet()
method.
This class can be simplified slightly to have the bet multiplier
coded as an instance variable, betAmount
.
The currentBet()
method can be refactored into the superclass to use
the betAmount
value.
This would
simplify each subclass to be only a constructor that sets the betAmount
multiplier to a value of 1, 3, 2 or 6.
Similarly, we could have the next state after winning defined as
an instance variable, nextStateWin
. We can
initialized this during construction. Then the nextWon()
method could also be refactored into the superclass, and would
return the value of the nextStateWin
instance variable.
The deliverable for this exercise is an alternative
Player1326State
class using just one class and distinct
constructors that create each state object with an appropriate
bet multiplier and and next state win value.
Advanced Exercise – Less Object Creation¶
The object creation for each state change can make this player rather slow.
There are a few design pattens that can reduce the number of objects that need to be created.
Global objects for the distinct state objects.
While truly global objects are usually a mistake, we can justify this by claiming that we’re only creating objects that are shared among a few objects.
The objects aren’t global variables: they’re global constants. There’s no state change, so they aren’t going to be shared improperly.
The Singleton design pattern.
With some cleverness, this can be made transparent in Python. However, it’s easiest to make this explicit, by defining a formal
instance()
method that fetches (or creates) the one-and-only instance of the class.A Factory object that produces state objects. This Factory can retain a small pool of object instances, eliminating needless object construction.
The deliverables for this exercise are revisions to the Player1326State
class hierarchy to implement the Factory design pattern.
This will not change any of the existing unit tests, demonstrations or
application programs.
Player1326 State Factory Design¶
-
Player1326StateFactory.
values
¶ This is a map from a class name to an object instance.
-
Player1326StateFactory.
__init__
(self) → None¶ Create a new mapping from the class name to object instance. There are only four objects, so this is relatively simple.
-
Player1326StateFactory.
get
(self, name: str) → Player1326State¶ - Parameters
name (String) – name of one of the subclasses of
Player1326State
.- Returns
a fresh new instance of the desired state
- Return type
Looking Forward¶
There are other stateful betting strategies. In the next chapter we’ll use built-in classes to maintain the state for the Cancellation betting strategy.


This is my first webpage, but this isn't me, it's Nick Pettit, a Treehouse instructor.
I will come back and make changes to this page after I get the Code Louisville prerequisites done and submitted. For purposes of this training, I am including a link to my Facebook page.


👋 Hey, {{{{raw}}}}{{var:username}}{{{{/raw}}}}
Here’s some activities you could miss on Santiment.
Comments |
|
{{comment.username}} {% if comment.reply_to_text %}replied{% else %}commented{% endif %} on your "{{comment.title}}"
{{comment.comment_text}} Reply |
Likes |
|
{{like.usernames}} {% if like.rest %} and {{like.rest}} others {% endif %} like your {{like.entity}} "{{like.title}}"
|


Work Day Scheduler
A simple calendar application for scheduling your work day
8:00am
9:00am
10:00am
11:00am
12:00pm
1:00pm
2:00pm
3:00pm
4:00pm


--- layout: page title: "Using Asian Characters in a Visual FoxPro Application" author: "Margaret Duddy" permalink: /intlasia/ pygments: true ---
Multi-international applications are becoming a much more common requirement as businesses extend into the "world economy". Application developers find themselves faced with supporting a variety of languages for a single application, sometimes using a diverse collection of character sets. How to best implement an app for an "offshore" locale is greatly influenced by Localization issues, but integral to the entire process is the ability to display the correct language in whatever interface or reporting system is finally achieved. Asian character sets present unique requirements in this effort, and attempts to use them can sometimes cause unexpected results in Visual Foxpro.
Consider the following scenario:
A Visual Foxpro Developer works for a company that is expanding into an Asian market. The Developer (well to support that expansion effort. Joes research reveals extensive documentation about Localization issues and multi-lingual applications and how to configure Windows XP to make Japanese characters available. MSDN and the Help files in Visual Foxpro discuss the features of double-byte characters and code page requirements in some detail.
Great news Joe is off and running. He reads through the documentation and literature and follows each instruction. He ensures that Japanese is installed in Windows XP and that the "locale" in Windows is set as required. Testing in Word shows that the Japanese characters are indeed available and render correctly. So far, so good.
Joe then creates VFP tables with the correct code page and font so that they are fully compatible with character set and tries to enter Japanese characters. But something seems to be wrong. He cannot get the Japanese characters to store correctly in the VFP tables or display forms and reports. All attempts to enter, insert or import them into the table simply stores "???" instead of the desired Kanji characters.
So what could be wrong? Windows says that the required language is installed. The Windows tools for inserting the Japanese characters are in place and working, and the characters render perfectly in Word and Outlook. The code page and font settings for the tables are correct. Is there magic switch in VFP that needs to be turned on to make all of this work?
Re-reading the literature does not seem to help, and no amount of digging back through MSDN or the VFP help files seems to shed any light on the problem. There is no mention of what to do if the "???" problem is encountered. Joe queries the development community, but the response he receives simply says that he must set the "locale" in Windows to Japanese. But he believes he has already done this, and it doesnt seem to make a difference.
Joe is stumped and, sadly, eventually abandons the use of VFP for the Japanese version of the application.
This is not, unfortunately, an unusual scenario. Many development efforts to use VFP for Asian languages have been aborted because of this specific problem. Since the solution is actually quite simple it is astounding that the details are not made clear in either the documentation freely offered by Microsoft or other authors.
The problem is the result of confusing terminology in Windows XP in the Control Panel/Regional Options, where separate settings have very similar names. While most of the documentation about these settings does correctly describe how to set them, it often fails to clarify that there are several settings of similar name or describe the differences between them in a cohesive manner. The main emphasis is placed on setting the "System Locale" to the Asian language of choice to enable VFP to utilize the characters. But in Windows XP there are at least three separate references to a "locale" in the Regional Options.
Two of these settings are both accessed from the General tab and reference a "locale". The setting for "Your locale (location)", at the top of the "General" tab, and the "System Locale" screen, accessed from the "Set Default" button on the General tab, are easily confused with each other. The problem further compounded by the title of the "Input Locales" tab, also found in Regional Settings. Are you lost yet? No wonder poor Joe got left in the dark.
Once they are set correctly, VFP does a great job of storing and displaying Asian characters. The following is a basic outline of the Windows requirements for Windows XP. In these examples the Japanese language is specified, but the same process applies to other Asian languages, such as Chinese, Vietnamese and Korean.
A system restart may be required before the newly installed language is available. If not, click "Apply" then "Ok" to close the "Text Services and Input Languages" window and return to the main window under the "Languages" tab.
If a system restart is required, return to Control Panel / Regional and Language Options after logging back into Windows. Be sure to login as an Administrator.
The Advanced tab will display a section at the top called "Language for Non-Unicode Programs". Select the desired Asian language from the drop-down in this section. There should not be any changes required in the Code Page Conversion" section. This is the setting that is required to be able to utilize an Asian character set in VFP.
When these changes have been correctly applied, the Asian language should be available in Windows for all login types. Windows itself and Windows applications will still display in English but the option to embed Asian characters will be available to Word, Outlook, etc. and (magically) Visual Foxpro. A new icon will appear in the System Taskbar that allows users to switch between the installed languages (see the "EN" in the graphic below).
The examples shown here are from Windows XP, but are very similar in Windows Vista and Windows 7.
To change to another language, click on the "EN" (which stands for English) and select the Asian language from the list (here Japanese).
Once the Asian language is selected, a toolbar will appear that provides various tools that can be used for selecting character sets and entering data in various Windows applications (including VFP). This toolbar provides access to Microsofts IME translator and a variety of other features to help support use of the Asian characters. There is ample documentation available from Microsoft about the Language Bar so it will not be discussed in detail here. Note: Windows XP includes an additional option in the selection list above that allows the language toolbar to be turned on or off.
An example of one of these tools is a virtual keyboard where the character set can be selected from the first drop down, and the font from the second drop down. These types of tools can be very handy.
After these settings in Windows are completed be aware that Asian characters may appear in a variety of unexpected locations even when English is set as the current "locale" language. For example, on a system where Japanese is installed and set as the language for non-unicode applications, Windows Explorer may show a Japanese character instead of a "\" in path strings even though the overall language in Windows Explorer (for menus, etc.) displays in English. This character usually seems to be interpreted correctly, but can be disconcerting.
Also, please note that the language icon and the toolbar that accompanies it will be available even if the Windows "locale" settings are not sufficiently completed to use Asian characters in Visual Foxpro. Do not rely on the appearance of this icon as an indicator that the settings are correct.
After the Windows settings are complete, Visual Foxpro will have the ability to correctly store and display Asian characters (in a table, on forms or reports, etc.). Below is a sample of a prototype screen that utilizes Steven Blacks INTL Toolkit to change languages on the fly. In this prototype, some objects were set to switch languages, while others were not.
Here is the screen in English:
And here is the screen in Japanese:
Switching to a different language is triggered by pressing the appropriate language button on the bottom of the screen. Note that the headings on the grid can be changed on the fly as well.
In VFP, there are a few basic requirements that need attention in order to get the characters rendering correctly, and some things to watch out for as well.
VFP tables that double-byte characters are to be stored in must have a code page setting that will support the desired character set. The default for VFP is no code page (code page = 0). For Japanese, the code page 1252 has been found to work well and also fully supports English and other "Western" languages.
Any VFP table that will store Asian characters must have a font setting that is capable of correctly displaying the character set. In addition, any fields on forms or reports that will be displaying Asian characters must also be set to a compatible font. A couple of currently available fonts that seems to work well are "Tahoma" or "MS UI Gothic" - they correctly display both Asian and English characters without problem and are either native to Windows or installed when the Asian language is added. In the past the font "Arial Unicode" has also been used with success, but this font may not be available. There are most probably a wide variety of other fonts that will also work for this purpose.
It should not be necessary to use any special field type in a VFP table that stores Asian characters. Standard character and memo fields easily support the double-byte characters. The main limitation is that double-byte characters use twice as much space as ASCII characters, so the number of characters that can be stored in a single character field is reduced from 255 to 174.
When the language setting under "Language for Non-Unicode Programs" in Windows is changed, some VFP options (under "Tools") may be changed as well. For example, if the Windows setting is Japanese, the setting for the "collating sequence" in VFP will most likely be automatically changed to Japanese as well. If data stored in the VFP table is all in an Asian language this may not be a problem, but it can be a significant issue if data is also stored in English (or another language).
This would not seem to be a problem because the Options settings (under "Tools") in VFP can always be adjusted, right? Wrong. There is a bug in VFP when running on Windows XP or Windows 2K that affects the VFP Options settings when the Windows language setting is changed. In VFP the Options screen is still available and options can be modified as usual. The problem is that the buttons for saving changes are not visible so changes cannot be saved or retained as default settings (!!). This behavior has been observed in multiple versions of VFP (6, 7 and 8) and has been reported to Microsoft. If or when Microsoft will actually address the problem is anyones guess.
As a result, environment settings may need to be managed programmatically in the application. The "collating sequence" setting in the example above is probably best managed in this fashion anyway since the data being stored has the biggest impact on the setting requirements and the setting may need to change regularly.
There may well be other Option settings that are affected after changing the language, so it is wise to be prepared to manage them programmatically wherever possible .
It is important to be careful about the use of string functions when working with different character sets. Not all characters are interpreted in the same way when represented in different languages, so the best practice is to use string functions that support the double-byte character sets. In some cases these functions are interchangeable with the standard string functions, such as AT_C() instead of AT() or SubstrC() instead of Substr(), and some provide additional functionality that can be important. The function IsLeadByte(), for example, can be used to determine whether a string is double-byte or single-byte.
Avoid including dates or currencies as strings in code as well. Date and currency formats may need to be adjusted based on the current language setting in the application. A better practice is to retrieve strings from tables or define them as constants so that output can be programmatically created. This will help ease the maintenance burden for multi-language apps as well.
While the author has not experimented with using multiple Asian languages on a single system, it has been reported that Foxpro will not support more than one at any given time. Given the way VFP relies on the Windows settings, it would not be surprising if this were true. If multiple Asian languages are required, and they must run simultaneously on the same system, then VFP may not be the platform to use for the application. Reportedly Access can support this requirement, using SQL Server for data.
Keeping the code page and font requirements in mind, Steven Blacks INTL Toolkit may be used to enable the "swapping" of character strings and various message boxes from one language to the other so that parts of a single application can support multiple languages (as shown in the samples above). The basic mechanism for changing the language text presented is handled very well by the INTL toolkit.
Of course, after the Windows and basic VFP issues have been considered and addressed there is the overall matter of localizing the application to meet the needs of the culture it will be presented to. This is the most important task for a successful implementation and usually by far the most time consuming for any project.
Obviously, localization is a task more easily faced once the foundation level requirement of being able to display the characters for the required language has been accomplished. With a little perseverance in configuring Windows, VFP can certainly be used as the platform to build that application.


Felix Wilson
<EMAIL_ADDRESS>Baseball
Cricket
Football
Hockey
Tennis
Manage Registered Events
Update Profile
Logout


{% extends "layout.html" %} {% block styles %} {% endblock %} {% block content %}
To clip this extract to the {{wof_name}} boundary, use this outline:
If you're unsure of which file to pick, check out our format guide.


We found the following highlighted talks that may be of interest to you. You can also browse talks in the same session by moving your mouse around the interactive display. After you've reviewed the suggestions, we'd love to hear about your experience.


VIRUS A film review by Matt Williams
RATING: 1/2 out of * * * *
You always have to be careful with the initial releases of any calendar year. January is a traditional dumping ground in which the studios release films that they don't believe are good enough to even merit a shot at getting awards, nor entertaining enough to benefit from the high-traffic holiday box office. Such a film this year is Virus, a high tech zombie movie that resembles, in more ways than one, last year's January-release: Deep Rising. Both are sci-fi thrillers set aboard a boat. And both deserve to be sunk as quickly as possible.
In Virus, Jamie Lee Curtis stars as Kelly Foster, the navigator of the Sea Star, a tugboat under the command of Captain Everton (Donald Sutherland), who (at some point before the movie starts) has gone completely mad. It's up to Foster and the ship's engineer Steve Baker (William Baldwin) to keep the tug in one piece. Everton has led the ship into the middle of a typhoon, where they encounter something mysterious: an abandoned Russian scientific vessel.
Upon exploring the derelict ship, the crew of the Sea Star discover plenty of unusual phenomena. The entire Russian crew is missing (except for plenty of bloodstains here and there), there is evidence of gunfire throughout the ship, and many systems have been smashed or otherwise destroyed.
But that is only the beginning, as the crew of the Sea Star are about to find out. An energy-based life form from outer space has inhabited the ship's computers. It controls all the ship's systems, and is building cyborg robots to further its control. The alien considers human life to be a noxious virus that must be eliminated (though in a way that will provide plenty of spare parts for the next cyborg...).
It is in this way that, you can be certain, everyone who dies will be back as a bad guy later in the film. The film never explains why the alien life form even bothers creating these cyborgs. It is not as if they are more powerful than the purely robotic creations. Nor do they seem more efficient or more intelligent. Perhaps they were created out of boredom (there's certainly enough of that in this movie).
Virus falls into the same trap as many sci-fi horror films.  (Hmmm... an abandoned ship in the middle of a typhoon, filled with blood and signs of violence? Let's split up and wander aimlessly through the dark corridors...)
The actors in Virus aren't given much to work with, and they don't give a lot in return. Donald Sutherland's campy performance (with a mumble-mouthed on-again, off-again accent) may qualify as the worst in the film...but at least he was trying something different. Jamie Lee Curtis and William Baldwin simply stroll through the film with nary an ounce of effort.
The robot designs in Virus are halfway interesting, and the high point of the film. But, they're hardly worth wading through the rest of the film just to see. Very few things would be...
Copyright 1999 Matt Williams
- Matt Williams<EMAIL_ADDRESS>Reviewer for Cinematter: http://www.cinematter.com Home of nearly 700 reviews, and information on over 750 upcoming releases
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


UKCloud Knowledge Centre
Welcome to the UKCloud Knowledge Centre where you can find articles to help you understand and work with our platform
VMware
OpenStack
Azure
Oracle
OpenShift
Cloud Storage
Cloud GPU
High Performance Compute
Cross Domain Security Zone
Secure Remote Access
Email and Collaboration
Disaster Recovery as a Service
Migration to the Cloud
Private Cloud for Compute
Private Cloud for Storage
Connectivity
Cloud Enablement
UKCloud Portal
Other
UKCloud


Many people forswear buying knitwear as their go-to footwear option, but that doesn't mean that it can't be a stylish and comfy choice. [G|D]
Whether you choose to keep it casual with neckwear, cozy up in some nightwear, or opt for the chic outerwear alternative, there is always a perfect wardrobe piece for every occasion. [G|D]
Although some might swear by outwear and sportswear for their daily wear, a carefully crafted combination of these clothing items can immediately up your style game. [G|D]
From underwear to wear for the office, to swimwear for the beach, there's something for everyone when it comes to choosing the perfect items for your wardrobe. [G|D]


Scopas is an average farm boy who in his free time practices the Floyera, and has become the best Floyera player in the land. The Floyera is a flute-like instrument, and Scopas believes he is even better than Apollo, the god of music himself! Scopas loves his Floyera and always wants to brag and challenge Apollo, the god of music and the Sun. Apollo has mastery over the Floyera, just as Scopas thinks he does. Scopas is dangerously prideful of his skill with the Floyera. Afterwords, Scopas was incredibly tired with his work, so he made his way back to his home on the countryside. When he got to his home, he went to sleep, and didn’t wake at all through the night.


Uber Rating System
Redesign
Interaction Design, Sept 2015
(2 weeks)
How we did it ?
As a part of our research, we interviewed two drivers and two riders and asked them about their experiences with the rating system. More specifically, we picked their brains with the questions we came up with earlier. This, in turn, generated some great follow up questions. We then went through Uber driver’s forum online and read their grievances regarding the rating sytem. We also looked into the rating system of different e-commerce websites such as Amazon and eBay to see how they handle ratings.
What we found ?
Drivers are fired when ratings fall below a certain threshold
If a driver’s rating falls below 4.6, he/she loses his/her access to the platform and is deactivated.
Different riders rate the same ride experience differently
The current rating system is highly subjective.Some riders give a 4 star rating by default for a flawless ride experience assuming that its a good rating. But a 4 star rating brings a driver's aggregate lower and closer to 4.6. Riders are not educated as to what the raing system means and how they should be applying it
Drivers have no idea where they are going wrong
Even as their ratings are falling, drivers have no clue as to where they are going wrong and no assurances of what they were doing right. Hence they don’t get a realistic chance of improving their performance before getting fired.
So for our solution, we focused on:
Providing specific & accurate feedback to the drivers while keeping user interaction to a minimum. .
Given the insights we got from our research, we all agreed on creating a system that:
So we went back to the drawing board and brainstormed as to what constitutes a ride experience. We combined the result of that brainstorming session with the top 5 complaints riders have had in the past with Uber rides. We then arrived at the top 6 aspects of Uber's (and by extension the driver's) service a passenger is more likley to rate his/her ride on. They are:
We then decided to allow the user to rate his/her ride experience on these six aspects. After coming up with a dozen concepts and completing two rounds of usability testing, we refined our final design.
Screen 1
Screen 2
REPORT DRIVER
We introduced the ‘Report the Driver‘ button for more severe problems that a rider may encounter during his/her ride. If the rider faced any of the problems not mentioned in that list, he/she will be motivated to take that extra step to report the problem. The problems mentioned in the listed is taken from Uber’s data that highlights the most probable reasons drivers get a 1 star rating.
Report
Report
Report
We went with this design because we wanted the riders to let Uber and, more importantly, their drivers know whatever he/she were doing right as well as where they were going wrong. This specific feedback will help the drivers identify their short-comings and at the same time provide reassurance for the things they were doing right.
We preselected all the [positive] options beforehand and asked the users to tap on things they didn’t like about the ride because users are generally more motivated to provide negative
feedback (owing to frustrations that the experience caused them) rather than a positive one. For example, even though the driver is driving nicely and the car is clean and odor free, the riders will seldom notice it because they might be busy using their phones, checking emails, texting etc and hence are not likely to provide any feedback regarding that. But if the driver is driving rashly or if the car is dirty and smelly, riders are more likely to notice that because it is something that is causing them discomfort. This motivates them to rate that aspect of their experience.


"SUPERNOVA"
PG-13, 100 m., 2000 Star rating: * * 1/2 (out of * * * *) Film Criticism By Zachary McGhee
I wish I was around when kids spent their weekends at the movies watching serials with each other, playfully shouting at the screen, just there to be entertained. I imagine an adult version of such fare would be "Supernova", a new sci-fi thriller in which the plot progresses at a playful tempo and the characters and the somewhat inane plot actually seem to be more important than the surrounding awe, unlike a certain big space blockbuster released two years back.
In future times (a specific date is never given), small crews are apparently sent into deep space for assorted missions, the subject of which here is the Nightingale, a rescue vessel touring the universe just in case there's a distress call from other space missions. The crew consists of six, Benjamin (Wilson Cruz), Danika Lund (Robin Tunney), Yerzy Penalosa (Lou Diamond Phillips), lead doctor Kaela Evers (Angela Bassett), newcomer, a former military pilot, Nick Vanzant (James Spader), and their captain (A.J. Marley). Quick into the film, they receive a distress call from another dimension and are forced to "jump" into it. The captain is killed in the jump and Spader's character takes over as captain.
So, in the middle of all this madness, who sent the distress call? Apparently a name that Kaela recognizes, Carl Larson, "your worst nightmare". Or is he? He says he's Troy (Peter Facinelli), Carl's son, who has just discovered an amazing secret of life, an odd enigma of an object which makes you grow stronger physically, but, as suggested by the holes in the film's plot, not mentally, and may be doing more harm than good. What follows is a series of quick paced, occasionally quick witted, events.
Indeed, Thomas Lee's (a pseudonym for director Walter Hill) "Supernova" definitely has its flaws to go right along with its, as they say, moments. Let's start with the obvious. This is one hades of a spaceship. It's huge, and that's not hyperbole. It could match those space stations in "2001". And while that's fun to look at sometimes, and may be impressive, what's it doing here? They're just a rescue crew made up of roughly seven individuals who tour the galaxy waiting around for distress signals. Why all that hardware for so few people with even littler opportunity to use it? And they aren't even particularly good effects, even if they are big.
Then there's those off-the-shelf, standardized subplots. Namely, romantic encounters between Bassett and Spader, and Phillips and Tunney. Since when did the government start providing a big old spaceship (lest we return to that subject) so that groups of people could have private orgies in deep space? From the futuristic setting, I thought Clinton was long out of office in this movie.
But, what I liked about the movie is that occasionally the characters shone through those effects as well. I'm not rushing to give credit to screenwriters, though. The dialogue isn't bright, but the more talented of the ensemble make it sound interesting. James Spader seems to be the most effective at this, though Angela Bassett comes close too. They made a movie that could have been a tepid, uninvolving replay of other equally pathetic films into something mildly entertaining, even passable.
And then there's the little things, like the ship's original captain earning his PhD from watching old episodes of "Tom and Jerry", or Bassett routinely shouting "STAT!" in her medical dialogues, apparently inferring that she got her degree from watching reruns of "ER". Or the fact that there must be a little interference from Troy in the relationship between two of our protagonists, simply so their can be a conflict between the two men.
There are some interesting ideas established throughout "Supernova", but the problem is that they are ignored in favor of a depressing, fight-it-out, man to man climax, and so I cannot recommend it. I am reminded that roughly one-half of the way into "Supernova", when asked about the aforementioned odd, life renewing object by her crew mate, Bassett remarks that it must have been made by someone "Smart as God and a lot less nice." And? Who are they? Gee, I dunno. The studio that turned down this script before it went to MGM?
[To receive a free weekly newsletter of reviews from Zachary McGhee e-mail<EMAIL_ADDRESS>Zachary McGhee is a high school student in the eastern U.S. He formerly was the webmaster, founder and editor of ReelGuide.com and The DVD Factor, and now writes film reviews on a regular basis for the amusement of those who care to read them, and his high school newspaper.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


| One | Two | Three | Four |
|---|---|---|---|
| 0/3 | 1/3 | 2/3 | 3/3 |
| One | 0/3 |
|---|---|
| Two | 1/3 |
| Three | 2/3 |
| Four | 3/3 |
An example of how to use this css widget by itself outside of a table.
Add the "txtIcon" class to allow the tGraph to flow with text.
Lorem ipsum dolor sit amet, 0/3 lorem ipsum dolore one third lorem ipsum dolore two thirds lorem ipsum dolore three thirds lorem ipsum dolore , sunt in culpa qui officia deserunt mollit anim id est laborum.


import {TabViewModule} from 'primeng/primeng';
Tabview element consists of one or more p-tabPanel elements. Header of the tab is defined using header attribute.

Content 1

Content 2

Content 3

First tab is selected by default, to customize this enable selected property on another panel.

Content 1

Content 2

Content 3

When closable attribute is enabled, an icon is displayed to close the tab. onClose event is fired when a tab is closed.

Content 1

If you'd like to control whether a tab can be closed, enable controlClose property which gives you the control to decide at onClose event. In this case, the event gets a 3rd parameter called close callback and invoking this function actually closes the tab.

Content 1

handleClose(e) {
if(condition)
e.close();
}
A tab can be disabled to prevent the content to be displayed by setting the disabled property on a panel.

Content 1

Icons can be placed at left and right of a header using leftIcon and rightIcon properties of tabPanel.

;
Content

TabView has four different orientations; "top", "bottom", "left" and "right". Top is the default one and this can be changed using orientation attribute.

Tabs can be controlled programmatically using activeIndex property that defines the index of the active tab.
<button type="button" pButton icon="fa fa-chevron-up" (click)="openPrev()"></button>
<button type="button" pButton icon="fa fa-chevron-down" (click)="openNext()"></button>

Content 1

Content 2

Content 3

export class TabViewDemo {
index: number = 0;
openNext() {
this.index = (this.index === 2) ? 0 : this.index + 1;
}
openPrev() {
this.index = (this.index === 0) ? 2 : this.index - 1;
}
}
| Name | Type | Default | Description |
|---|---|---|---|
| orientation | string | top | Orientation of tab headers. |
| activeIndex | number | null | Index of the active tab to change selected tab programmatically. |
| style | string | null | Inline style of the component. |
| styleClass | string | null | Style class of the component. |
| Name | Type | Default | Description |
|---|---|---|---|
| header | string | null | Orientation of tab headers. |
| selected | boolean | false | Defines if tab is active. |
| disabled | boolean | false | When true, tab cannot be activated. |
| closable | boolean | false | Defines if tab can be removed. |
| headerStyle | string | null | Inline style of the tab header. |
| headerStyleClass | string | null | Style class of the tab header. |
| controlClose | boolean | false | Whether tab close is controlled at onClose event or not. |
| lazy | boolean | false | Defines whether the elements of an inactive panel are created on load or on demand when the panel gets selected. |
| Name | Parameters | Description |
|---|---|---|
| onChange |
event.originalEvent: Click event event.index: Index of the selected tab |
Callback to invoke on tab change. |
| onClose |
event.originalEvent: Click event event.index: Index of the closed tab event.close: Callback to actually close the tab, only available if controlClose is enabled. |
Callback to invoke on tab close. |

handleChange(e) {
var index = e.index;
}
Following is the list of structural style classes, for theming classes visit theming page.
| Name | Element |
|---|---|
| ui-tabview | Container element |
| ui-tabview-nav | Container of headers. |
| ui-tabview-selected | Selected tab header. |
| ui-tabview-panels | Container panels. |
| ui-tabview-panel | Content of a tab. |
None.

Default

The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war, but does not intend to become part of his father's business. T hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.

Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy, killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows.

After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family. Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate.

Closable

The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war, but does not intend to become part of his father's business. T hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.

Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy, killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows.

After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family. Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate.

Event

The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war, but does not intend to become part of his father's business. T hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.

Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy, killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows.

After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family. Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate.

After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family. Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate.

Orientation

The story begins as Don Vito Corleone, the head of a New York Mafia family, overseeshis daughter's wedding. His beloved son ichael has just come home from the war, but does not intend to become part of his father's business. T hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.

Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream. In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy, killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows.

After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family. Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate.

export class TabViewDemo {
msgs: Message[];
onTabChange(event) {
this.msgs = [];
this.msgs.push({severity:'info', summary:'Tab Expanded', detail: 'Index: ' + event.index});
}
}


I can't stop talking about my cat.
I'm gonna show this to you again, because it'll make you warm inside.
Here's a picture of my cat.
Isn't she cute!


Module mojo.graphics
The graphics module contains various functions that allow you to draw 2D graphics on all supported monkey target platforms. More...Classes
| Image |
Constants
| AdditiveBlend : Int |
| AlphaBlend : Int |
Functions
| Cls : Int ( r:Float=0, g:Float=0, b:Float=0 ) |
| CreateImage : Image ( width:Int, height:Int, flags:Int=image.defaultflags ) |
| DeviceHeight : Int () |
| DeviceWidth : Int () |
| DrawCircle : Int ( x:Float, y:Float, r:Float ) |
| DrawEllipse : Int ( x:Float, y:Float, xr:Float, yr:Float ) |
| DrawImage : Int ( image:Image, x:Float, y:Float, frame:Int=0 ) |
| DrawImage : Int ( image:Image, x:Float, y:Float, rotation:Float, scaleX:Float, scaleY:Float, frame:Int=0 ) |
| DrawImageRect : Int ( image:Image, x:Float, y:Float, srcX:Int, srcY:Int, srcWidth:Int, srcHeight:Int, frame:Int=0 ) |
| DrawImageRect : Int ( image:Image, x:Float, y:Float, srcX:Int, srcY:Int, srcWidth:Int, srcHeight:Int, rotation:Float, scaleX:Float, scaleY:Float, frame:Int=0 ) |
| DrawLine : Int ( x1:Float, y1:Float, x2:Float, y2:Float ) |
| DrawOval : Int ( x:Float, y:Float, w:Float, h:Float ) |
| DrawPoint : Int ( x:Float, y:Float ) |
| DrawPoly : Int ( verts:Float[] ) |
| DrawRect : Int ( x:Float, y:Float, w:Float, h:Float ) |
| DrawText : Int ( text:String, x:Float, y:Float, xalign:Float=0, yalign:Float=0 ) |
| FontHeight : Float () |
| GetAlpha : Float () |
| GetBlend : Int () |
| GetColor : Float[] () |
| GetColor : Int ( color:Float[] ) |
| GetFont : Image () |
| GetMatrix : Float[] () |
| GetMatrix : Int ( matrix:Float[] ) |
| GetScissor : Float[] () |
| GetScissor : Int ( scissor:Float[] ) |
| LoadImage : Image ( path:String, frameCount:Int=1, flags:Int=image.defaultflags ) |
| LoadImage : Image ( path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=image.defaultflags ) |
| PopMatrix : Int () |
| PushMatrix : Int () |
| ReadPixels : Void ( pixels:Int[], x:Int, y:Int, width:Int, height:Int, arrayOffset:Int=0, arrayPitch:Int=0 ) |
| Rotate : Int ( angle:Float ) |
| Scale : Int ( x:Float, y:Float ) |
| SetAlpha : Int ( alpha:Float ) |
| SetBlend : Int ( blend:Int ) |
| SetColor : Int ( r:Float, g:Float, b:Float ) |
| SetFont : Int ( font:Image, firstChar:Int=32 ) |
| SetMatrix : Int ( m:Float[] ) |
| SetMatrix : Int ( ix:Float, iy:Float, jx:Float, jy:Float, tx:Float, ty:Float ) |
| SetScissor : Int ( x:Float, y:Float, width:Float, height:Float ) |
| TextWidth : Float ( text:String ) |
| Transform : Int ( m:Float[] ) |
| Transform : Int ( ix:Float, iy:Float, jx:Float, jy:Float, tx:Float, ty:Float ) |
| Translate : Int ( x:Float, y:Float ) |
Detailed Discussion
The graphics module contains various functions that allow you to draw 2D graphics on all supported monkey target platforms.The module supports rendering of file based images, and a small set of simple primitives.
Transparency effects can be achieved using SetAlpha to set the global alpha level, and fullscreen rotation and scaling effects can be achieved using the various matrix commands such as Translate, Rotate and Scale.
The graphics module is state based, and commands that 'set' various states will remain in effect until a subsequent 'set' modifies the state.
Function Documentation
Function Cls : Int ( r:Float=0, g:Float=0, b:Float=0 )
Clears the graphics device to the specified color.The current color, alpha and blend mode are ignored by Cls. However, the scissor rect is still used so only the area inside the scissor rect is cleared.
Function CreateImage : Image ( width:Int, height:Int, flags:Int=image.defaultflags )
Creates an empty image for use with Image.WritePixels.The contents of the image are initially undefined.
Function DeviceHeight : Int ()
Returns the height of the graphics device, in pixels.Please note that you cannot directly control the size of the graphics device via mojo. This must be done by editing the 'native' project code for the target.
See also DeviceWidth
Function DeviceWidth : Int ()
Returns the width of the graphics device, in pixels.Please note that you cannot directly control the size of the graphics device via mojo. This must be done by editing the 'native' project code for the target.
See also DeviceHeight
Function DrawCircle : Int ( x:Float, y:Float, r:Float )
Draws a circle of the given radius at coordinates x, y.The circle is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
Function DrawEllipse : Int ( x:Float, y:Float, xr:Float, yr:Float )
Draws an ellipse of radii xRadius, yRadius at coordinates x, y.The ellipse is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
See also DrawOval
Function DrawImage : Int ( image:Image, x:Float, y:Float, frame:Int=0 )
Draws an image at coordinates x, y, offset by the image's handle.The image is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
See also LoadImage, DrawImageRect
Function DrawImage : Int ( image:Image, x:Float, y:Float, rotation:Float, scaleX:Float, scaleY:Float, frame:Int=0 )
Draws an image at coordinates x, y, offset by the image's handle.The image is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
The rotation and scaleX, scaleY parameters provide a convenient way for you to 'locally' rotate and scale the image.
See also LoadImage, DrawImageRect
Function DrawImageRect : Int ( image:Image, x:Float, y:Float, srcX:Int, srcY:Int, srcWidth:Int, srcHeight:Int, frame:Int=0 )
Draws a sub-rectangle of an image at coordinates x, y, offset by the image's handle.The image is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
Function DrawImageRect : Int ( image:Image, x:Float, y:Float, srcX:Int, srcY:Int, srcWidth:Int, srcHeight:Int, rotation:Float, scaleX:Float, scaleY:Float, frame:Int=0 )
Draws a sub-rectangle of an image at coordinates x, y, offset by the image's handle.The image is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
The rotation and scaleX, scaleY parameters provide a convenient way for you to 'locally' rotate and scale the image.
Function DrawLine : Int ( x1:Float, y1:Float, x2:Float, y2:Float )
Draws a line from x1, y1 to x2, y2.The line is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
Function DrawOval : Int ( x:Float, y:Float, w:Float, h:Float )
Draws an oval of size width, height at coordinates x, y.The oval is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
See also DrawEllipse
Function DrawPoint : Int ( x:Float, y:Float )
Draws a point at the coordinates x, y.The point is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
Function DrawPoly : Int ( verts:Float[] )
Draw a convex polygon using the provided vertices.The polygon is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
If the polygon described by vertices is not convex, the results are undefined.
The vertices array must contain at least 3 x,y pairs.
Function DrawRect : Int ( x:Float, y:Float, w:Float, h:Float )
Draws a rectangle of size width, height at the coordinates x, y.The rectangle is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
Function DrawText : Int ( text:String, x:Float, y:Float, xalign:Float=0, yalign:Float=0 )
Draws text at coordinates x, y in the current font.The current font may be modified using SetFont. By default, an internal 7 x 13 white-on-black font is used.
xalign and yalign allow you to control the alignment of the text and should be in the range 0 for left/top alignment to 1 for right/bottom alignment. A value of .5 can be used for centering text horizontally or vertically.
The text is drawn using the current color, alpha, blend mode and matrix, and is clipped to the current scissor rectangle.
Note: The font functionality in mojo is very limited and intended mainly for debugging purposes.
Function FontHeight : Float ()
Returns the height of the current font.Function GetAlpha : Float ()
Returns the current alpha level in the range 0 to 1 inclusive.See also SetAlpha
Function GetBlend : Int ()
Returns the current blend mode, one of:
AlphaBlend AdditiveBlend
See also SetBlend
Function GetColor : Float[] ()
Returns the current color as a 3 component float array containg the current color's red, green and blue components respectively.See also SetColor
Function GetColor : Int ( color:Float[] )
Copies the current color to color.The length of color must be at least 3.
See also SetColor
Function GetMatrix : Float[] ()
Returns the current transformation matrix as an array of 6 floats.See also SetMatrix
Function GetMatrix : Int ( matrix:Float[] )
Copies the current transformation matrix to matrix.The length of matrix must be at least 6.
See also SetMatrix
Function GetScissor : Float[] ()
Returns the current scissor rectangle as a 4 component float array containg the scissor rectangle's x,y, width and height coordinates respectively.See also SetScissor
Function GetScissor : Int ( scissor:Float[] )
Copies the current scissor rectangle to scissor.The length of scissor must be at least 4.
See also SetScissor
Function LoadImage : Image ( path:String, frameCount:Int=1, flags:Int=image.defaultflags )
Loads an image from path.The frames of a multi-frame image must be laid out in a single horizontal strip, in which case the width of the image is the width of image file divided by the number of frames, and the height of the image is the height of the image file.
The image must be a PNG or JPEG image format, and must have the three-letter file extension .png or .jpg (not .jpeg). PNGs with alpha transparency channels are supported.
Like all game data, the image file must be saved in your project's .data folder or one of its sub-folders.

See DefaultFlags for a list of valid image flags.
See also Resource paths, File formats, DefaultFlags, GrabImage
Function LoadImage : Image ( path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=image.defaultflags )
Loads an image from path.The frames of a multi-frame image may occupy more than 1 row. In this case, frames should be laid out left-to-right, top-to-bottom.
The image must be a PNG or JPEG image format, and must have the three-letter file extension .png or .jpg (not .jpeg). PNGs with alpha transparency channels are supported.
Like all game data, the image file must be saved in your project's .data folder or one of its sub-folders.

See DefaultFlags for a list of valid image flags.
See also Resource paths, DefaultFlags, GrabImage
Function PopMatrix : Int ()
Pops a matrix from the internal matrix stack and makes it the current matrix.See also PushMatrix
Function PushMatrix : Int ()
Pushes the current matrix onto the internal matrix stack.The matrix can be restored at a later time using PopMatrix.
See also PopMatrix
Function ReadPixels : Void ( pixels:Int[], x:Int, y:Int, width:Int, height:Int, arrayOffset:Int=0, arrayPitch:Int=0 )
Copies a rectangular section of pixels from the current render buffer into an int array.The pixel data is stored in int-per-pixel ARGB format, with the alpha component stored in bits 24-31, the red component in bits 16-23, the green component in bits 8-15 and the blue component in bits 0-7.
The optional arrayOffset parameter allows you to specify an index into the array at which to start writing pixel values.
The optional arrayPitch parameter allows you to specify a 'pitch'. This is the number of array elements between successive rows in the array. If this is 0, then width is used as pitch, meaning pixel data is assumed to be 'tightly packed'.
Function Rotate : Int ( angle:Float )
Multiplies the current matrix by a matrix representing the specified rotation.Function Scale : Int ( x:Float, y:Float )
Multiplies the current matrix by a matrix representing the specified scale.Function SetAlpha : Int ( alpha:Float )
Sets the current global alpha level.Alpha controls the 'mixing' that occurs when rendering. An alpha value of 1 results in completely opaque rendering, while 0 results in completely transparent rendering.
In the case of images which contain alpha, the alpha used for rendering is the product of each image pixel's alpha and the current global alpha.
Global alpha affects all drawing operations except for Cls.
See also GetAlpha
Function SetBlend : Int ( blend:Int )
Sets the current blending mode.The current blending mode affects all drawing commands except for Cls.
The mode parameter can be one of the following:
AlphaBlend AdditiveBlend
See also GetBlend
Function SetColor : Int ( r:Float, g:Float, b:Float )
Sets the current color.The current color is used by all drawing operations except Cls.
Note: Drawing images in any color other than 255,255,255 on the HTML5 target will incur a major runtime overhead. For best results on the HTML5 target, either use colored imaged sparingly, or consider using 'pre-colored' images stored in multiple image files.
See also GetColor
Function SetFont : Int ( font:Image, firstChar:Int=32 )
Sets the font for use with DrawText.The font parameter may be Null, in which case an internal 7x11 white-on-black font is used and the firstChar parameter is ignored.
Note: The font functionality in mojo is very limited and intended mainly for debugging purposes
See also GetFont
Function SetMatrix : Int ( m:Float[] )
Sets the current matrix.See also GetMatrix
Function SetMatrix : Int ( ix:Float, iy:Float, jx:Float, jy:Float, tx:Float, ty:Float )
Sets the current matrix.See also GetMatrix
Function SetScissor : Int ( x:Float, y:Float, width:Float, height:Float )
Sets the current scissor rectangle to the rectangle specified by x, y, width and height.All drawing commands are 'clipped' to the current scissor rectangle. To disable clipping, set the scissor rectangle to 0,0,DeviceWidth,DeviceHeight.
The rectangle coordinates used with SetScissor are device coordinates, and are not affected by the current matrix.
See also GetScissor


Installation process
1 - If you don't already have a RoF2 client copy, you can get one of the server's ready to play Imperium RoF2 EverQuest client here.
2 - If you already have a copy of the RoF2 client, you will need to download the following server files:
(do not forget to backup the original files just in case)
- dbstr_us file (goes into the main installation folder, replace the original)
- spell_us file (goes into the main installation folder, replace the original)
- GlobalLoad file (goes into the resources folder, replace the original)
- Maps Files (drop into the main installation folder, replace everything if asked)
3 - Change your eqhost.txt file with the following:
[LoginServer]
Host=login.eqemulator.net:5999
4 - Creating a shortcut launcher executable; This will bypass the EQLive patcher. First, locate the eqgame.exe file in the main installation folder. Right-click and select "Create Shortcut". You can rename it and drag it anywhere on your desktop.
Now, right-click that shortcut and select "Properties" In the target box, you will see the path to the eqgame.exe file. We need to edit this in order to bypass the patcher.
At the end of the text box (after any parentheses), add "patchme" (no quotes). Your target box should look similar to the image on the right.
5 - Once you've created a shortcut with the instructions above, you will be able to finally connect with your EQemulator account, select the server and play!
Otherwise, if you do not already have an EQemulator account;
- Make a Forum account first.
- Once you've made one, create a Loginserver account, located on the left side bar on the EQemulator homepage when logged in.


@(appUser : models.AppUser, name:String) @if(name == "Dashboard"){ } Toggle navigation Aus @for(country <- models.Country.countryList()){ @country.getName() } HOME HOW IT WORKS BUSINESS FOR SALE COMMERCIAL FOR SALE BUYERS/INVESTORS BROKERS FRANCHISORS BUSINESS SERVICES DISTRESS SALES @if(appUser == null){ / As a Buyer As a Seller As a Broker As a Franchisor As a Business Advisor } Aus @for(country <- models.Country.countryList()){ @country.getName() } @if(appUser != null && name == "Dashboard"){ 4 10 } @if(appUser != null){ @appUser.getName() Profile My Dashboard Logout } @if(name == "Dashboard"){ }
Doesn't have an account, click here to sign up
Already have an account, click here to login
We have sent a confirmation link to example@@example.com.Please check your inbox


US Debt Graph
Current
President
Party
Periods
Breakdown by president
Debt Contributions by president
Note: This is based on president's term, and it a rough number.
All Data is sourced from the US treasury


5 Seconds of Summer is a band that was created in 2011. Since then they have grown in popularity. They have won multiple awards and have gone on 2 of their own world tours.
| Songs | Members |
|---|---|
| She Looks So Perfect | Luke Hemmings |
| Castaway | Michael Clifford |
| Good Girls | Calum Hood |
| Don't Stop | Ashton Irwin |


Traffic AI
Live Feed: I-75 and Alm St, Dallas 75023
Your browser does not support the video tag.
Live Feed: I-34 and K St, Dallas 75024
Your browser does not support the video tag.
Warnings
No warnings
Alert Authorities
No warnings
Alert Authorities


NEWS
MEMBERS
TOURNAMENTS
SQUADS
EVENTS
FORUM
Main Menu
·
Home
·
News
·
Members
·
Ranks
·
Squads
·
Tournaments
·
Medals
·
History
·
Rules
Shoutbox


- My Strengths
Curiosity, passion, empathy, perserverance
- My limitations:
Time management, discipline, focus, getting fixated and frustrated as a result
- I will develop a system of time blocks. Chunking out time to do certain things, such as moving the course along by getting things done, time for exploration around things like HTML, CSS, Javascript, and other knowledge gaps. And finally, time for relaxation. By following these blocks, I will eliminate panic and unnecessary time wasting.
- I will seek help from my facilitators and peers, as I have. I will record my learning and find out how I can improve from day to day.
- I expect the facilitation team to help me with my inquiries and encourage my learning. To be empathetic but also make me accountable.
- Cut out all other commitments beside the essentials to focus on the bootcamp.
- Week days are for learning and completing the course requirements. At least 10 hours will be allocated each day, with 5 minute breaks between every 15 minutes.
- I will do as much of the challenges as I can to consolidate my knowledge.
- I will take as much notes and ask as many questions as it takes to grasp concepts I do not yet understand.


Description: A progress bar is a visual indicator to indicate to the user where they are in the process of completing an action.
508 Guidelines: A progress bar uses a list, which will follow the same guidelines as in the list section.
TIP: To add step numbers to the progress bar, change the content in the css, for example change content: ""; to content: "1";.

 Select an Immunization Type

 Enter Immunization Info You are currently on step 2 of 5

 Step 3

 Step 4

 Step 5

Copy


@* home Template File *@ @(param: Any)
Diligencias
Check out how to find us!
Check out our different menus!
Login so we can monitor you and everything you do


Kanha Shanti Vanam hosts its first bhandara celebrations from 11th February 2016 till 13th February 2016. Please register through the below link at the earlist. Kindly read the Guidelines before registering.
For any further info mail to<EMAIL_ADDRESS>Kanha Shanti Vanam is hoasting a bhandara for the first time so to maximize the utilization of minimal time at our disposal, much man power and many earth moving machines have been deployed and are working continuously making the stay at kanha a little troublesome. Hence the bhandara site will be occupied by them until January. So our volunteer need will begin from January 25th.
As this is the first time for most of you to visit kanha, please note the following contact details of various departments who are available to help you anytime during the bhandara.
Please refer to the tables below to find train and bus timings from various areas to reach kanha.
Basant 2016 Celebrations - Accommodation:
1. Accomodation in tents at the venue
2. Accomodation in sukh nivas at the venue
3. Accomodation in nearby hotels.
Kindly register from the link below to avail sukh nivas facility and refer to the table below for hotel details.
Hotels A list of hotels near kanha is also attached here. Abhyasis are requested to do bookings directly. Click on the link to view the list of Hotels
A limited independent dormitory accommodation is also available near the venue.Registration link Coming Soon


--- Day 3: No Matter How You Slice It ---
(..)
Each Elf has made a claim about which area of fabric would be ideal for Santa's suit.
All claims have an ID and consist of a single rectangle with edges parallel
to the edges of the fabric. Each claim's rectangle is defined as follows: ..


In the Etsy marketplace, you can reach customers all over the world. Grow and manage a creative venture on your terms. We offer you a wide range of tools that help you start, manage, and scale a successful business. Etsy's storefronts offer products ranging from personalized jewelry, bridal gifts, to vintage home decor. We use the power of global business to empower our creative Etsy Sellers and our customers with unique products they love.
Whatever you create, we have a space for you!
Get your storefront up and running today and get your first 30 days free.


The modern web runs on Representational State Transfer, or REST, allowing applications to consume services from a variety of "RESTful" services in order to sustain a distributed architecture. In other words, you don't have to own all the hardware, software, and data simply to build a web application nowadays.
Each REST service is typically served up via a REST endpoint, at a browsable URL. Think of these endpoints as oak trees in a large forest, each producing consistently large amounts of acorns, to the point where they are available on demand. As a web developer, much like a squirrel, with very little effort you are free to browse around and gather acorns from as many trees as you need in order to build up your cache of food for the winter - or the application you hang your hat on.
This web site is not a REST endpoint, but a basic tutorial on how to use them in order to build an application using HTML, CSS, and Javascript. Using spatial services in the flavor of Esri's REST API (NOT the only RESTful service out there - here's an example API from USGS) for demonstration purpose, we'll show you how to browse a REST endpoint, use it to build queries via HTML and Javascript, demonstrate a classic spatial query, and show you how to get GeoJSON for modern web maps.
Along the way, in order to keep the demo code simple, we'll lean on frameworks like JQuery and Leaflet. But, much like how Esri's REST services are not the only such services out there, you are free to discover and use your own Javascript frameworks and mapping libraries out there.
Of course, there are plenty of in-depth tutorials out there on REST. (This blog from Elkstein.org looks really well-done.) So, we'll keep these pages short, sweet, and focused on some common map-making techniques.


--- layout: post title: Diana of London City Glamour Nail Varnish tags: - Diana of London status: publish type: post published: true meta: wp_plus_one_disabled: '1' _edit_last: '2' wp_plus_one_redirect: '' _aioseop_keywords: Diana of London City Glamour Nail Varnish, Diana of London City Glamour Nail Varnish soft brown _aioseop_title: Diana of London City Glamour Nail Varnish _yoast_wpseo_linkdex: '0' _thumbnail_id: '3213' _yoast_wpseo_focuskw: '' _yoast_wpseo_title: '' _yoast_wpseo_metadesc: '' _yoast_wpseo_metakeywords: '' _yoast_wpseo_meta-robots-noindex: '0' _yoast_wpseo_meta-robots-nofollow: '0' _yoast_wpseo_meta-robots-adv: none _yoast_wpseo_sitemap-include: ! '-' _yoast_wpseo_sitemap-prio: ! '-' _yoast_wpseo_canonical: '' _yoast_wpseo_redirect: '' ---
Diana of London grabbed my attention, after I read about them online. This small bottle has a lot to promise, free of harsh chemicals, fast dry, long lasting and enriched with vitamin C and Calcium.
Price: Rs. 210, but you can grab these at major discounts from medplusbeauty.com and stylecraze.com
About City Glamour:
FAST DRYING, HIGH-SHINE WITH UV FILTER. 7 DAY STAY
State-of-the-art nail enamel, High-shine finish with an instant stroke of glamour, irresistible colors go on smoother and faster without chipping and streaking, set in 60 seconds, Toluene,DBP, Camphor & Formaldehyde free
Available in 67 shades, you can check them out here
My Experience: When I first saw the bottle, I found the packaging not quite impressive, but I must admit, I liked the brush. Long bristles give an ease when applying the color on long nails. This particular shade Soft Brown - 02 gives an opaque layer in 2 coats. Definitely fast dry formula free from Toluene,DBP, Camphor & Formaldehyde. The below pictures are taken after 3 days of application and shows minimal chipping.
What I liked:
I would definitely recommend this to all. Grab them at major 32% discount on MedPlusBeauty.
Have you tried the Diana of London products ?
*Product was sent by the company, but that has not affected the review.


Seems your browser doesn't support Javascript! Websocket relies on Javascript being enabled. Please enable Javascript and reload this page!
Toggle navigation
Deck Game
Home
(current)

Loading


IDCIdCloudClient
@interface IDCIdCloudClient : NSObject
A class that creates the request for all of IdCloud client operations.
@since 1.0.0
-
Unavailable
Unavailable. Developer should use
-[IDCIdCloudClient initWithUrl:]
to initialize the object as URL is a mandatory parameter.@since 1.0.0
Declaration
Objective-C
- (nonnull instancetype)init;
-
Returns an IdCloud client object initialized with IdCloud server URL.
@since 1.0.0
Declaration
Objective-C
- (nonnull instancetype)initWithUrl:(nonnull NSString *)url;
Parameters
url
IdCloud server URL. The URL should contain scheme(https://), domain and path.
Return Value
An
IDCIdCloudClient
object initialized withurl
as IdCloud server URL. -
Creates an enrollment request.
The request’s execution is triggered separately through
-[IDCEnrollRequest execute]
.@since 1.0.0
Declaration
Objective-C
- (nonnull IDCEnrollRequest *) createEnrollRequestWithCredential: (nonnull IDCEnrollmentCredential *)enrollmentCredential uiDelegates:(nonnull IDCUiDelegates *)uiDelegates progress: (nonnull void (^)(IDCProgress))progressBlock completion:(nonnull void (^)( IDCEnrollResponse *_Nullable, NSError *_Nullable))completionBlock;
Parameters
enrollmentCredential
contains credentials to initiate enrollment with the IdCloud server.
uiDelegates
group of ui delegates allowing developers to show the UI during PIN or biometric authentication.
progressBlock
The handler to report progress. This handler is executed on the main thread. It takes the following parameter:
- progress - The current progress. See
IDCProgress
for progress types.
completionBlock
The completion handler to call when the execution is complete. This handler is executed on the main thread. It takes the following parameters:
- response - Success when it is not nil.
- error - Error details. See
IDCError
for error types.
Return Value
An
IDCEnrollRequest
instance. - progress - The current progress. See
-
Creates a fetch request.
The request’s execution is triggered separately through
-[IDCFetchRequest execute]
.@since 1.0.0
Declaration
Objective-C
- (nonnull IDCFetchRequest *) createFetchRequestWithUiDelegates:(nonnull IDCUiDelegates *)uiDelegates progress: (nonnull void (^)(IDCProgress))progressBlock completion:(nonnull void (^)( IDCFetchResponse *_Nullable, NSError *_Nullable))completionBlock;
Parameters
uiDelegates
group of ui delegates allowing developers to show the UI during PIN or biometric authentication.
progressBlock
The handler to report progress. This handler is executed on the main thread. It takes the following parameter:
- progress - The current progress. See
IDCProgress
for progress types.
completionBlock
The completion handler to call when the execution is complete. This handler is executed on the main thread. It takes the following parameters:
- response - Success when it is not nil.
- error - Error details. See
IDCError
for error types.
Return Value
An
IDCFetchRequest
instance. - progress - The current progress. See
-
Creates a change PIN request.
The request’s execution is triggered separately through
-[IDCChangePinRequest execute]
.@since 1.1.0
Declaration
Objective-C
- (nonnull IDCChangePinRequest *) createChangePinRequestWithUiDelegate: (nonnull id<IDCSecurePinPadUiDelegate>)pinPadUiDelegate progress: (nonnull void (^)(IDCProgress))progressBlock completion: (nonnull void (^)( IDCChangePinResponse *_Nullable, NSError *_Nullable))completionBlock;
Parameters
pinPadUiDelegate
a UI delegate to handle the display of the secure PIN pad during the change PIN use-case.
progressBlock
The handler to report progress. This handler is executed on the main thread. It takes the following parameter:
- progress - The current progress. See
IDCProgress
for progress types.
completionBlock
The completion handler to call when the execution is complete. This handler is executed on the main thread. It takes the following parameters:
- response - Success when it is not nil.
- error - Error details. See
IDCError
for error types.
Return Value
An
IDCChangePinRequest
instance. - progress - The current progress. See
-
Creates an add authenticator request.
The request’s execution is triggered separately through
-[IDCAddAuthenticatorRequest execute]
.@since 1.1.0
Declaration
Objective-C
- (nonnull IDCAddAuthenticatorRequest *) createAddAuthenticatorRequestWithUiDelegates: (nonnull IDCUiDelegates *)uiDelegates progress:(nonnull void (^)(IDCProgress)) progressBlock completion:(nonnull void (^)( IDCAddAuthenticatorResponse *_Nullable, NSError *_Nullable)) completionBlock;
Parameters
uiDelegates
group of ui delegates allowing developers to show the UI during PIN or biometric authentication.
progressBlock
The handler to report progress. This handler is executed on the main thread. It takes the following parameter:
- progress - The current progress. See
IDCProgress
for progress types.
completionBlock
The completion handler to call when the execution is complete. This handler is executed on the main thread. It takes the following parameters:
- response - Success when it is not nil.
- error - Error details. See
IDCError
for error types.
Return Value
An
IDCAddAuthenticatorRequest
instance. - progress - The current progress. See
-
Creates an unenroll request.
The request’s execution is triggered separately through
-[IDCUnenrollRequest execute]
.@since 1.1.0
Declaration
Objective-C
- (nonnull IDCUnenrollRequest *) createUnenrollRequestWithProgress: (nonnull void (^)(IDCProgress))progressBlock completion:(nonnull void (^)( IDCUnenrollResponse *_Nullable, NSError *_Nullable))completionBlock;
Parameters
progressBlock
The handler to report progress. This handler is executed on the main thread. It takes the following parameter:
- progress - The current progress. See
IDCProgress
for progress types.
completionBlock
The completion handler to call when the execution is complete. This handler is executed on the main thread. It takes the following parameters:
- response - Success when it is not nil.
- error - Error details. See
IDCError
for error types.
Return Value
An
IDCUnenrollRequest
instance. - progress - The current progress. See
-
Fetches the list of activated authenticators for the enrolled credential
@since 2.0.0
Declaration
Objective-C
- (nonnull NSArray<IDCAuthenticator *> *)activatedAuthenticators;
Return Value
An array of
IDCAuthenticator
representing the various activated authenticators. -
Creates a remove authenticator request.
The request’s execution is triggered separately through
-[IDCRemoveAuthenticatorRequest execute]
.@since 2.0.0
Declaration
Objective-C
- (nonnull IDCRemoveAuthenticatorRequest *) createRemoveAuthenticatorRequestWithAuthenticator: (nonnull IDCAuthenticator *)authenticator progress: (nonnull void (^)(IDCProgress)) progressBlock completion: (nonnull void (^)( IDCRemoveAuthenticatorResponse *_Nullable, NSError *_Nullable)) completionBlock;
Parameters
authenticator
The previously retrieved activated authenticator to be removed.
progressBlock
The handler to report progress. This handler is executed on the main thread. It takes the following parameter:
- progress - The current progress. See
IDCProgress
for progress types.
completionBlock
The completion handler to call when the execution is complete. This handler is executed on the main thread. It takes the following parameters:
- response - Success when it is not nil.
- error - Error details. See
IDCError
for error types.
Return Value
An
IDCRemoveAuthenticatorRequest
instance. - progress - The current progress. See
-
Sets the secure logger intended to log necessary retrievable information.
@since 2.0.0
Declaration
Objective-C
+ (id<SecureLog> _Nullable)configureSecureLog: (SecureLogConfig *_Nullable)config;
Parameters
config
A configuration object of secure log.
Return Value
An instance of
SecureLog
ornil
if config set is nil.


Variational Inference¶
Variational inference is a scalable technique for approximate Bayesian inference. In the Stan ecosystem, the terms “VI” and “VB” (“variational Bayes”) are used synonymously.
Stan implements an automatic variational inference algorithm, called Automatic Differentiation Variational Inference (ADVI) which searches over a family of simple densities to find the best approximate posterior density. ADVI produces an estimate of the parameter means together with a sample from the approximate posterior density.
ADVI approximates the variational objective function, the evidence lower bound or ELBO,
using stochastic gradient ascent.
The algorithm ascends these gradients using an adaptive stepsize sequence
that has one parameter eta
which is adjusted during warmup.
The number of draws used to approximate the ELBO is denoted by elbo_samples
.
ADVI heuristically determines a rolling window over which it computes
the average and the median change of the ELBO.
When this change falls below a threshold, denoted by tol_rel_obj
,
the algorithm is considered to have converged.
ADVI configuration¶
algorithm
: Algorithm to use. One of: “meanfield”, “fullrank”.iter
: Maximum number of ADVI iterations.grad_samples
: Number of MC draws for computing the gradient.elbo_samples
: Number of MC draws for estimate of ELBO.eta
: Stepsize scaling parameter.adapt_iter
: Number of iterations for eta adaptation.tol_rel_obj
: Relative tolerance parameter for convergence.eval_elbo
: Number of interactions between ELBO evaluations.output_samples
: Number of approximate posterior output draws to save.
data
: Values for all data variables in the model, specified either as a dictionary with entries matching the data variables, or as the path of a data file in JSON or Rdump format.seed
: The seed for random number generator.inits
: Specifies how the sampler initializes parameter values.output_dir
: Name of the directory to which CmdStan output files are written.save_diagnostics
: Whether or not to the CmdStan auxiliary output file. For thesample
method, the diagnostics file contains sampler information for each draw together with the gradients on the unconstrained scale and log probabilities for all parameters in the model.
All of these arguments are optional; when unspecified, the CmdStan defaults will be used.
Example: variational inference for model bernoulli.stan
¶
In this example we use the CmdStan example model bernoulli.stan and data file bernoulli.data.json.
The CmdStanModel class method variational
returns a CmdStanVB
object which provides properties
to retrieve the estimate of the
approximate posterior mean of all model parameters,
and the returned set of draws from this approximate posterior (if any):
column_names
variational_params_dict
variational_params_np
variational_params_pd
variational_sample
save_csvfiles()
In the following example, we instantiate a model and run variational inference using the default CmdStan settings:
import os
from cmdstanpy.model import CmdStanModel
from cmdstanpy.utils import cmdstan_path
# instantiate, compile bernoulli model
bernoulli_path = os.path.join(cmdstan_path(), 'examples', 'bernoulli', 'bernoulli.stan')
bernoulli_model = CmdStanModel(stan_file=bernoulli_path)
# run CmdStan's variational inference method, returns object `CmdStanVB`
bern_data = os.path.join(cmdstan_path(), 'examples', 'bernoulli', 'bernoulli.data.json')
bern_vb = bernoulli_model.variational(data=bern_data)
print(bern_vb.column_names)
print(bern_vb.variational_params_dict)
bern_vb.variational_sample.shape
These estimates are only valid if the algorithm has converged to a good
approximation. When the algorithm fails to do so, the variational
method will throw a RuntimeError
.
fail_stan = os.path.join(datafiles_path, 'variational', 'eta_should_fail.stan')
fail_model = CmdStanModel(stan_file=fail_stan)
vb = model.variational()
References¶
Paper: [Kucukelbir et al](http://arxiv.org/abs/1506.03431)
Stan manual: https://mc-stan.org/docs/reference-manual/vi-algorithms-chapter.html