Twitter: @aigalou
Facebook: https://www.facebook.com/aigalou
Twitter: @aigalou
Facebook: https://www.facebook.com/aigalou
public HandRank GetHandRank() => | |
IsRoyalFlush() ? HandRank.RoyalFlush : | |
IsStraightFlush() ? HandRank.StraightFlush : | |
IsFourOfAKind() ? HandRank.FourOfAKind : | |
IsFullHouse() ? HandRank.FullHouse : | |
IsFlush() ? HandRank.Flush : | |
IsStraight() ? HandRank.Straight : | |
IsThreeOfAKind() ? HandRank.ThreeOfAKind : | |
IsTwoPair() ? HandRank.TwoPair : | |
IsPair() ? HandRank.Pair : |
// In the form you can multiple of these: | |
<MTextField Text=@Text | |
IsAutofocus=@IsAutofocus | |
IsMultiline=@IsMultiline | |
Lines=@Lines | |
Value=@Value | |
Placeholder=@Placeholder | |
Suffix=@Suffix | |
OnChange=@OnChange | |
InputType=@InputType |
/@\s*?media\s*?\(\s*?(min|max)-(width|height)\s*?:\s*?(\d+)(px|em)\s*?\)\s*?{(.*)}/gms | |
/** | |
* Only basically tested. | |
* Should match min-max-width-height number px|em and following rules. | |
* Provides capturing groups to determinate condition alongside with css. | |
* | |
* Created with help of regex101 | |
* https://regex101.com/r/zA6fX2/1 |
Or in other words, why you should hard-code sequence numbers, and not generate them programmatically.
Unlike .jsx
files, .razor
/.cshtml
files are always compiled. This is potentially a great advantage for .razor
, because we can use the compile step to inject information that makes things better or faster at runtime.
A key example of this are sequence numbers. These indicate to the runtime which outputs came from which distinct and ordered lines of code. The runtime uses this information to generate efficient tree diffs in linear time, which is far faster than is normally possible for a general tree diff algorithm.
Recommendations of unit types per media type:
Media | Recommended | Occasional use | Infrequent use | Not recommended |
---|---|---|---|---|
Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |