Tutorial by Examples: f

If you have a type definition file (d.ts) for the module, you can use an import statement. import _ = require('lodash'); If you don't have a definition file for the module, TypeScript will throw an error on compilation because it cannot find the module you are trying to import. In this case, yo...
By default, Interface Builder doesn't accept the CGColor datatype, so to allow adding a CGColor using user defined attributes in interface builder; one may want to use an extension like this: Swift Extension : extension CALayer { func borderUIColor() -> UIColor? { return borderCol...
IMPORTANT: This delegate method is only called in the foreground. Swift func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) { } Objective-C - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotifi...
Function DisableShift() 'This function disable the shift at startup. This action causes 'the Autoexec macro and Startup properties to always be executed. On Error GoTo errDisableShift Dim db As DAO.Database Dim prop As DAO.Property Const conPropNotFound = 3270 Set db = C...
Function EnableShift() 'This function enables the SHIFT key at startup. This action causes 'the Autoexec macro and the Startup properties to be bypassed 'if the user holds down the SHIFT key when the user opens the database. On Error GoTo errEnableShift Dim db As DAO.Database Dim p...
References behaves similarly, but not entirely like const pointers. A reference is defined by suffixing an ampersand & to a type name. int i = 10; int &refi = i; Here, refi is a reference bound to i. References abstracts the semantics of pointers, acting like an alias to the underlying...
The strchr and strrchr functions find a character in a string, that is in a NUL-terminated character array. strchr return a pointer to the first occurrence and strrchr to the last one. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char toSe...
Filter an enumeration by using a conditional expression Synonyms: Where-Object where ? Example: $names = @( "Aaron", "Albert", "Alphonse","Bernie", "Charlie", "Danny", "Ernie", "Frank") $names | Where-Object {...
raw_data = {'first_name': ['John', 'Jane', 'Jim'], 'last_name': ['Doe', 'Smith', 'Jones'], 'department': ['Accounting', 'Sales', 'Engineering'],} df = pd.DataFrame(raw_data,columns=raw_data.keys()) df.to_csv('data_file.csv')
This is a very common Exception. It causes your application to stop during the start or execution of your app. In the LogCat you see the message: android.content.ActivityNotFoundException : Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml? In ...
The cx and cy values designate the location of the center of the circle. The r attribute specifies the size of the radius of the circle. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle cx="40" cy="40&q...
public class Singleton { private static final Singleton INSTANCE = new Singleton(); private Singleton() {} public static Singleton getInstance() { return INSTANCE; } } It can be argued that this example is effectively lazy initialization. Section 12.4.1 of ...
countMatches method from org.apache.commons.lang3.StringUtils is typically used to count occurences of a substring or character in a String: import org.apache.commons.lang3.StringUtils; String text = "One fish, two fish, red fish, blue fish"; // count occurrences of a substring Str...
Method references allow predefined static or instance methods that adhere to a compatible functional interface to be passed as arguments instead of an anonymous lambda expression. Assume that we have a model: class Person { private final String name; private final String surname; ...
Start with an iterable which needs to be grouped lst = [("a", 5, 6), ("b", 2, 4), ("a", 2, 5), ("c", 2, 6)] Generate the grouped generator, grouping by the second element in each tuple: def testGroupBy(lst): groups = itertools.groupby(lst, key=lambda...
HTML <p>My shadow always follows me.</p> CSS p { -webkit-filter: drop-shadow(10px 10px 1px green); filter: drop-shadow(10px 10px 1px green); } Result
To use multiple filters, separate each value with a space. HTML <img src='donald-duck.png' alt='Donald Duck' title='Donald Duck' /> CSS img { -webkit-filter: brightness(200%) grayscale(100%) sepia(100%) invert(100%); filter: brightness(200%) grayscale(100%) sepia(100%) invert(1...
using System; using Xamarin.Forms; namespace NavigationApp { public class App : Application { public App() { MainPage = new NavigationPage(new FirstPage()); } } public class FirstPage : ContentPage { Label FirstPage...
When referring to a worksheet, a range or individual cells, it is important to fully qualify the reference. For example: ThisWorkbook.Worksheets("Sheet1").Range(Cells(1, 2), Cells(2, 3)).Copy Is not fully qualified: The Cells references do not have a workbook and worksheet associated ...
Turn on: adb shell svc wifi enable Turn off: adb shell svc wifi disable

Page 61 of 457