Tutorial by Examples: c

let bodies = (contact.bodyA.categoryBitMask <= contact.bodyB.categoryBitMask) ? (A:contact.bodyA,B:contact.bodyB) : (A:contact.bodyB,B:contact.bodyA) switch (bodies.A.categoryBitMask,bodies.B.categoryBitMask) { case let (a, _) where (a && superPower): //All we care about is i...
Linear search is a simple algorithm. It loops through items until the query has been found, which makes it a linear algorithm - the complexity is O(n), where n is the number of items to go through. Why O(n)? In worst-case scenario, you have to go through all of the n items. It can be compared to l...
View : <form id="form"> <label>First Name: <input data-bind="value: firstName" /></label> <label>Last Name: <input data-bind="value: lastName" /></label> <label>Gender: <select data-bind="s...
Objective-C First add the Social Framework to the XCode project. Import the #import "Social/Social.h" class to the required ViewController Twitter with text, image and link //- - To Share text on twitter - - if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) ...
// myString is "hi" NSMutableString *reversedString = [NSMutableString string]; NSInteger charIndex = [myString length]; while (charIndex > 0) { charIndex--; NSRange subStrRange = NSMakeRange(charIndex, 1); [reversedString appendString:[myString substringWithRange:subS...
Given a money system, is it possible to give an amount of coins and how to find a minimal set of coins corresponding to this amount. Canonical money systems. For some money system, like the ones we use in the real life, the "intuitive" solution works perfectly. For example, if the diffe...
The module keyword can be used to begin a module, which allows code to be organized and namespaced. Modules can define an external interface, typically consisting of exported symbols. To support this external interface, modules can have unexported internal functions and types not intended for public...
Typically, packages consist of one or more modules. As packages grow, it may be useful to organize the main module of the package into smaller modules. A common idiom is to define those modules as submodules of the main module: module RootModule module SubModule1 ... end module SubModul...
Quite often within mobile applications, there will be a reason to deal with dates. When working with dates, you will probably need some sort of user input to select a date. This could occur when working with a scheduling or calendar app. In this case, it is best to provide users with a specialized c...
An EntryCell is a Cell that combines the capabilities of a Label and an Entry. The EntryCell can be useful in scenarios when building some functionality within your application to gather data from the user. They can easily be placed into a TableView and be treated as a simple form. XAML <Ent...
A SwitchCell is a Cell that combines the capabilities of a Label and an on-off switch. A SwitchCell can be useful for turning on and off functionality, or even user preferences or configuration options. XAML <SwitchCell Text="Switch It Up!" /> Code var switchCell = new Switch...
A TextCell is a Cell that has two separate text areas for displaying data. A TextCell is typically used for information purposes in both TableView and ListView controls. The two text areas are aligned vertically to maximize the space within the Cell. This type of Cell is also commonly used to dis...
An ImageCell is exactly what it sounds like. It is a simple Cell that contains only an Image. This control functions very similarly to a normal Image control, but with far fewer bells and whistles. XAML <ImageCell ImageSource="http://d2g29cya9iq7ip.cloudfront.net/content/imag es/company...
You can consider a ViewCell a blank slate. It is your personal canvas to create a Cell that looks exactly the way you want it. You can even compose it of instances of multiple other View objects put together with Layout controls. You are only limited by your imagination. And maybe screen size. X...
Getting a table with vertical headers. Twitter bootstrap now support vertical header on a well formatted normal table. To achieve this just use .table-reflow class Use twitter bootstrap .table-reflow class on a well formed table to achieve a table with vertical headers. Additionally you can combin...
Easly access geolocation across Xamarin.iOS, Xamarin.Android and Windows. Available Nuget: [https://www.nuget.org/packages/Xam.Plugin.Geolocator/][1] XAML <StackLayout Spacing="10" Padding="10"> <Button x:Name="buttonGetGPS" Text="Get GPS"/...
Installation via NodeJS is the recommended method. It is preferred because you can use it to build the files selecting just the components you want. Step 1: Install Node (Link) Step 2: Install Gulp globally ( -g ) on your computer npm install -g gulp Semantic UI uses Gulp to provide command ...
There are many reasons a write operation may fail. A frequent one is because your security rules reject the operation, for example because you're not authenticated (by default a database can only be accessed by an authenticated user). You can see these security rule violations in the console output...
This document details the steps to obtain the facebook access tokens and the using the tokens to fetch FB feeds. Example: A live example is available in https://newtonjoshua.com Introduction to Graph API: The Graph API is the primary way to get data in and out of Facebook's platform. It's a...
ContentPage: Displays a single View. XAML <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XamlBasics.SampleXaml"> &lt...

Page 610 of 826