Tutorial by Examples

To install React Router, just run the npm command npm install --save react-router And you're done. This is literally all you have to do to install react router. Please Note : react-router is dependent on react, So make sure you install react as well. To set up: using an ES6 transpiler, like bab...
Exporting using base R Data can be written to a CSV file using write.csv(): write.csv(mtcars, "mtcars.csv") Commonly-specified parameters include row.names = FALSE and na = "". Exporting using packages readr::write_csv is significantly faster than write.csv and does not ...
context.globalCompositeOperation = "destination-over" "destination-over" compositing places new drawing under existing drawings. context.drawImage(rainy,0,0); context.globalCompositeOperation='destination-over'; // sunny UNDER rainy context.drawImage(sunny,0,0);
context.globalCompositeOperation = "destination-out" "destination-out" compositing uses new shapes to erase existing drawings. The new shape is not actually drawn -- it is just used as a "cookie-cutter" to erase existing pixels. context.drawImage(apple,0,0); conte...
context.globalCompositeOperation = "source-over" "source-over" compositing [default], places all new drawings over any existing drawings. context.globalCompositeOperation='source-over'; // the default context.drawImage(background,0,0); context.drawImage(parachuter,0,0); ...
context.globalCompositeOperation = "destination-in" "destination-in" compositing clips existing drawings inside a new shape. Note: Any part of the existing drawing that falls outside the new drawing is erased. context.drawImage(picture,0,0); context.globalCompositeOperation...
context.globalCompositeOperation = "source-in"; source-in compositing clips new drawings inside an existing shape. Note: Any part of the new drawing that falls outside the existing drawing is erased. context.drawImage(oval,0,0); context.globalCompositeOperation='source-in'; // pictu...
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 logcat output....
Generate code Alt+Insert Add comment lines Ctrl+Shift+C Remove comment lines Ctrl+/ Format selection Alt+Shift+F Fix all class imports Ctrl-Shift-I Fix selected class's import Alt+Shift+I Shift lines left Alt+Shift+← Shift lines right Alt+Shift+→ Shift lines up Alt+Shift+↑ Shift li...
task A << { println 'Hello from A' } task B << { println 'Hello from B' } B.mustRunAfter A The B.mustRunAfter A line tells Gradle to run task after task specified as an argument. And the output is: > gradle -q B A Hello from A Hello from B The ordering rule d...
Make sure the following dependency is added to your app's build.gradle file under dependencies: compile 'com.android.support:support-core-ui:25.3.0' Then add the ViewPager to your activity layout: <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layo...
Custom sounds may be provided for notifications generated by your app. When the system displays an alert for a local notification or badges an app icon, it plays this sound (so long as the user has not disabled notification sounds). The default value is nil which means no sound is played for your n...
We're using a toplevel guard in our route config to catch the current user on first page load, and a resolver to store the value of the currentUser, which is our authenticated user from the backend. A simplified version of our implementation looks as follows: Here is our top level route: export c...
To use any Bluetooth functionality on a Universal Windows Platform app, you must check the Bluetooth capability in the Package.appxmanifest. Open Package.appxmanifest Go to the Capabilities tab Find Bluetooth on the left and check the box next to it
This example shows how to advertise a custom payload from a Windows 10 device in the foreground. The payload uses a made up company (identified as 0xFFFE) and advertises the string Hello World in the advertisement. BluetoothLEAdvertisementPublisher publisher = new BluetoothLEAdvertisementPublisher(...
General Listening This example shows how to listen for a specific advertisement. BluetoothLEAdvertisementWatcher watcher = new BluetoothLEAdvertisementWatcher(); // Use active listening if you want to receive Scan Response packets as well // this will have a greater power cost. watcher.Scanni...
CardView provides a default elevation and corner radius so that cards have a consistent appearance across the platforms. You can customize these default values using these attributes in the xml file: card_view:cardElevation attribute add elevation in CardView. card_view:cardBackgroundColor attr...
Considering that most debuggers are not aware of #define macros, but can check enum constants, it may be desirable to do something like this: #if __STDC_VERSION__ < 199900L typedef enum { false, true } bool; /* Modern C code might expect these to be macros. */ # ifndef bool # define bool bo...
class Category(models.Model): name = models.CharField(max_length=20) class Product(models.Model): name = models.CharField(max_length=64) category = models.ForeignKey(Category, on_delete=models.PROTECT) To get the number products for each category: >>> categories = Ca...
Problem By default, Django immediately commits changes to the database. When exceptions occur during a series of commits, this can leave your database in an unwanted state: def create_category(name, products): category = Category.objects.create(name=name) product_api.add_products_to_cate...

Page 775 of 1336