Tutorial by Examples: ball

In themes.xml: <style name="AppTheme" parent="Theme.AppCompat"> <!-- Theme attributes here --> </style> In AndroidManifest.xml: <application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" andr...
To make a custom pipe available application wide, During application bootstrap, extending PLATFORM_PIPES. import { bootstrap } from '@angular/platform-browser-dynamic'; import { provide, PLATFORM_PIPES } from '@angular/core'; import { AppComponent } from './app.component'; import { MyPipe }...
Say you have implemented some logic to detect attempts to modify an object in the database while the client that submitted changes didn't have the latest modifications. If such case happens, you raise a custom exception ConfictError(detailed_message). Now you want to return an HTTP 409 (Confict) st...
XML <College> <FootBall> <Members>20</Members> <Coach>Archie Theron</Coach> <Name>Wild cats</Name> <StarPlayer>David Perry</StarPlayer> </FootBall> <VolleyBall> <Me...
public static void Register(HttpConfiguration config) { var corsAttr = new EnableCorsAttribute("http://example.com", "*", "*"); config.EnableCors(corsAttr); }
You can use npm install -g to install a package "globally." This is typically done to install an executable that you can add to your path to run. For example: npm install -g gulp-cli If you update your path, you can call gulp directly. On many OSes, npm install -g will attempt to writ...
// Store a reference to the native method let open = XMLHttpRequest.prototype.open; // Overwrite the native method XMLHttpRequest.prototype.open = function() { // Assign an event listener this.addEventListener("load", event => console.log(XHR), false); // Call the s...
Authentication in Django REST Framework can be configured globally as a subkey of the REST_FRAMEWORK variable in settings.py, just like the rest of the default framework configurations. REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.BasicAuthen...
file_untar = 'filename.tar.gz' untar = tarfile.TarFile(file_untar) untar.extractall() untar.close()
In order to set the pagination style for the entire project, you need to set the DEFAULT_PAGINATION_CLASS and PAGE_SIZE on the project settings. To do so, go to settings.py and on the REST_FRAMEWORK variable, add the following: REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_fr...

Page 1 of 1