Tutorial by Examples: ast

In ui-router a state can hold multiple views, each with his own controller and a template .state('dashboard', { name: 'dashboard', url: '/dashboard', views: { "view1": { templateUrl: "path/to/view1.html", controller: "...
You can resolve data into your state when you transition into it, usually it's useful when the state needs to use that data, or to resolve into a state when some provided input needs to be authenticated. When you define your states, you will need to provide a map of values to be resolved into the ....
Avoid unnecessary operations and method calls wherever you can, especially in a method which is called many times a second, like Update. Distance/Range Checks Use sqrMagnitude instead of magnitude when comparing distances. This avoids unnecessary sqrt operations. Note that when using sqrMagnitude,...
VBA defines a number of string constants for special characters like: vbCr : Carriage-Return 'Same as "\r" in C style languages. vbLf : Line-Feed 'Same as "\n" in C style languages. vbCrLf : Carriage-Return & Line-Feed (a new-line in Windows) vbTab: Tab Character vbNul...
Const appName As String = "The App For That"
'Declare, dimension and assign a string array with 3 elements Dim departments(2) As String departments(0) = "Engineering" departments(1) = "Finance" departments(2) = "Marketing" 'Declare an undimensioned string array and then dynamically assign with 'the results...
VBA offers a Mid function for returning substrings within a string, but it also offers the Mid Statement which can be used to assign substrings or individual characters withing a string. The Mid function will typically appear on the right-hand-side of an assignment statement or in a condition, but ...
Const zipCode As Long = 10012 Dim zipCodeText As String 'Convert the zipCode number to a string of digit characters zipCodeText = CStr(zipCode) 'zipCodeText = "10012"
Const zipCode As long = 10012 Dim zeroPaddedNumber As String zeroPaddedZipCode = Format(zipCode, "00000000") 'zeroPaddedNumber = "00010012"
'Declare an array of bytes, assign single-byte character codes, and convert to a string Dim singleByteChars(4) As Byte singleByteChars(0) = 72 singleByteChars(1) = 101 singleByteChars(2) = 108 singleByteChars(3) = 108 singleByteChars(4) = 111 Dim stringFromSingleByteChars As String stringFro...
'Declare an array of bytes, assign multi-byte character codes, and convert to a string Dim multiByteChars(9) As Byte multiByteChars(0) = 87 multiByteChars(1) = 0 multiByteChars(2) = 111 multiByteChars(3) = 0 multiByteChars(4) = 114 multiByteChars(5) = 0 multiByteChars(6) = 108 multiByteChar...
LocalBroadcastManager is used to send Broadcast Intents within an application, without exposing them to unwanted listeners. Using LocalBroadcastManager is more efficient and safer than using context.sendBroadcast() directly, because you don't need to worry about any broadcasts faked by other Applic...
Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Check if baseString contains "bar" (case insensitive) containsBar = InStr(1, baseString, "bar", vbTextCompare) > 0 'containsBar = True 'Check if baseString contains bar (case insensitive) co...
Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Find the position of the last "B" Dim posX As Long 'Note the different number and order of the paramters for InStrRev posX = InStrRev(baseString, "X", -1, vbBinaryCompare) 'posX = 0
Const baseString As String = "Foo Bar" Dim leftText As String leftText = Left$(baseString, 3) 'leftText = "Foo"
Const baseString As String = "Foo Bar" Dim rightText As String rightText = Right$(baseString, 3) 'rightText = "Bar"
Const baseString As String = "Foo Bar" 'Get the string starting at character 2 and ending at character 6 Dim midText As String midText = Mid$(baseString, 2, 5) 'midText = "oo Ba"
public class App : Application { internal static NavigationPage NavPage; public App () { // The root page of your application MainPage = new RootPage(); } } public class RootPage : MasterDetailPage { public RootPage() { var menuPage = ne...
Premise The most confusing thing surrounding pointer syntax in C and C++ is that there are actually two different meanings that apply when the pointer symbol, the asterisk (*), is used with a variable. Example Firstly, you use * to declare a pointer variable. int i = 5; /* 'p' is a pointer to a...
Simple case without duplicate keys Stream<String> characters = Stream.of("A", "B", "C"); Map<Integer, String> map = characters .collect(Collectors.toMap(element -> element.hashCode(), element -> element)); // map = {65=A, 66=B, 67=C} ...

Page 11 of 26