Tutorial by Examples: c

In this example, we will try to find JavaScript data which containing backgroundColor:'#FFF'. Then, we will change value of backgroundColor '#FFF' ⇨ '#ddd'. This code uses getWholeData() and setWholeData() methods to manipulate JavaScript data. Alternatively, html() method can be used to get data of...
Mutable global items (called static mut, highlighting the inherent contradiction involved in their use) are unsafe because it is difficult for the compiler to ensure they are used appropriately. However, the introduction of mutually exclusive locks around data allows memory-safe mutable globals. Th...
Start with a properly configured gradle project. In your project-local (not top-level) build.gradle append extensions plugin declaration below your Kotlin plugin, on top-level indentation level. buildscript { ... } apply plugin: "com.android.application" ... apply plugin: &quo...
Android extensions also work with multiple Android Product Flavors. For example if we have flavors in build.gradle like so: android { productFlavors { paid { ... } free { ... } } } And for example, only the free flavor has ...
a simple yet very useful command: :g/ending/m$ moves lines containing ending to the end of the buffer. m means move $ means end of buffer, while 0 means beginning of buffer.
There's two ways to create a ByteBuffer, where one can be subdivided again. If you have an already existing byte[], you can "wrap" it into a ByteBuffer to simplify processing: byte[] reqBuffer = new byte[BUFFER_SIZE]; int readBytes = socketInputStream.read(reqBuffer); final ByteBuffer ...
Given a ByteBuffer instance one can write primitive-type data to it using relative and absolute put. The striking difference is that putting data using the relative method keeps track of the index the data is inserted at for you, while the absolute method always requires giving an index to put the d...
Below is an Employer entity class which is mapped to the table employer. As you can see I used fetch = FetchType.LAZY instead of fetch = FetchType.EAGER. The reason I am using LAZY is because Employer may have a lot of properties later on and every time I may not need to know all the fields of an Em...
The interactive mode The most basic way to use R is the interactive mode. You type commands and immediately get the result from R. Using R as a calculator Start R by typing R at the command prompt of your operating system or by executing RGui on Windows. Below you can see a screenshot of an inter...
Each standard Oracle error is associated with an error number. Its important to anticipate what could go wrong in your code. Here for a connection to another database it can be: -28000 account is locked -28001 password expired -28002 grace period -1017 wrong user / password Here is a way to...
To illustrate this, here is a function that has 3 different "wrong" behaviors parameter is completely stupid: we use a user-defined expression parameter has a typo: we use Oracle standard NO_DATA_FOUND error another, but not handled case Feel free to adapt it to your standards: DE...
You can use the ng generate or ng g command to generate Angular building blocks (components, services, pipes, etc.). You can find all possible blueprints in the table below: ScaffoldUsageShortenedComponentng generate component component-nameng g c component-nameDirectiveng generate directive direc...
class MyToolbarControl { public: MyToolbarControl(HWND hWndToolbar, HWND hWndNotifyParent = nullptr) : _Handle(hWndToolbar) { if (hWndNotifyParent == nullptr) { hWndNotifyParent = GetAncestor(hWndToolbar, GA_ROOTOWNER); } SetWindowSubclass( ...
Native string functions are mapped to single byte functions, they do not work well with Unicode. The extentions iconv and mbstring offer some support for Unicode, while the Intl-extention offers full support. Intl is a wrapper for the facto de standard ICU library, see http://site.icu-project.org fo...
Asks the delegate to open a resource specified by a URL, and provides a dictionary of launch options. Example of usage: func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { return SomeManager.shared.handle( ...
Example of usage: /* Instance of your custom APNs/local notification manager */ private var pushManager: AppleNotificationManager! Registration: func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) { // Called...
In modern Objective C syntax you can get values from NSArray and NSDictionary containers using container subscripting. Old way: NSObject *object1 = [array objectAtIndex:1]; NSObject *object2 = [dictionary objectForKey:@"Value"]; Modern way: NSObject *object1 = array[1]; NSObject *o...
To enable Pull to Refresh in a ListView in Xamarin, you first need to specify that it is PullToRefresh enabled and then specify the name of the command you want to invoke upon the ListView being pulled: <ListView x:Name="itemListView" IsPullToRefreshEnabled="True" RefreshComm...
I'm in a controlled room with a single minew beacon that use IBEACON protocol. BLEController needs to extend CBPeripheralDelegate I'll use the first BLE to connect after the search has stop. Modify the method StopSearchBLE() class BLEController: CBCentralManagerDelegate, CBPeripheralDelegate...
To Get context: NSManagedObjectContext *context = ((AppDelegate*)[[UIApplication sharedApplication] delegate]).persistentContainer.viewContext; To fetch data: NSFetchRequest<EntityName *> *fetchRequest = [EntityName fetchRequest]; NSError *error ; NSArray *resultArray= [context executeF...

Page 739 of 826