9

While you can do the transition in RGB space (using component-wise linear interpolation), this might cause unnaturally-looking transitions; most noticably, the brightness and saturation may bump between control points. If it this is acceptable, just do it this way. Mapping the values through some sort of gamma function before interpolating and then reverting ...


8

Don't replace, add. When you achieve feature parity, stop making updates to the SOAP API and declare it deprecated.


7

State machines don't have exceptions, though they may have transitions to an error state. There's no “one size fits all” answer for how you should handle errors. This depends a lot on the problem domain. Possibilities I consider useful: If an exception occurs, this is interpreted as a transition to an error state. This error state may be terminal, i.e. ...


4

You can't really do it smoothly using the RGB color space, but it's easier when done with HSV. See HSL and HSV Using HSV space you can transition from Green to Yellow to Red along a single float value for Hue while keeping the saturation/value constant.


3

I am afraid that's not possible. This is how transparency is calculated when two objects overlay: http://en.wikipedia.org/wiki/Alpha_compositing One of the objects must have an opacity of 1 if you don't want the overlay area to be seen through.


3

I don't know what the name might be in the realm of video editing, but I'd call the curve an S-curve or sigmoid curve. It should be very simple to produce the cross-fade you're looking for in iOS using Core Animation's kCAMediaTimingFunctionEaseInEaseOut timing function. Just animate the alpha property of two views in opposite directions (one 0->1, one 1->0) ...


3

So state machines have to handle them somehow. No they don't. How an exception should be handled is outside of what state machines model. You've stripped all meaning away and left us with a pattern. You can't ignore context. Wether an exception should even be recovered from is not something a state diagram tells you. There are many other considerations....


2

To answer this question, we have to recognize that exceptions, themselves, are something akin to a state transition. They take you to a state which is defined by unwinding the stack. In practice, that's all they are. They're a very non-local goto. So when it comes to exceptions there's always two ways to handle them. One is to treat them as fatal. In ...


1

It's going to depend on your implementation of the state machine, the language and the type of exception. I added the diagram to your question for an example: If it were Java, and action() had a try for a checked exception, you could possibly handle things well knowing that the current state was s1 and you were in transitionName (to s2). Access to all these ...


1

I'd go one of two ways depending on the exact implementation details. (Apologies, I'm not familiar with Django, so my answer speaks generically about the architecture and doesn't have specific suggestions for the language you're using) 1. JSON fields for data using Single Table Inheritance As you suggested, I'd put the data in JSON(B) fields in Postgres. ...


1

In computer graphics, this kind of function is called smoothstep. When used to crossfade, it determines the global alpha value for the composition. If the input images have an alpha channel, you should first make sure that the alpha is premultiplied. Then, you can do the crossfade composition straightforwardly, using the smoothstep alpha on each channel [...


1

Not sure if you intentionally used the term state chart. State diagrams are more known ( see discussion for comparison ) In the comparison there also is a nice overview of different ways of modelling parallel states in a state chart. I don't know of a real notation of asynchronous state transitions in a state chart but when you model the events and possible ...


1

As far as my knowledge goes for (UML) State diagrams it can't happen. If the state change isn't instantly there is obvious a in between state. In your example a state where your waiting for the IO to complete.


Only top voted, non community-wiki answers of a minimum length are eligible