Tutorial by Examples: bac

public enum DayOfWeek { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } // Enum to string string thursday = DayOfWeek.Thursday.ToString(); // "Thursday" string seventhDay = Enum.GetName(typeof(DayOfWeek), 6); // "Satur...
The background property can be used to set one or more background related properties: ValueDescriptionCSS Ver.background-imageBackground image to use1+background-colorBackground color to apply1+background-positionBackground image's position1+background-sizeBackground image's size3+background-repeat...
The background-position property is used to specify the starting position for a background image or gradient .myClass { background-image: url('path/to/image.jpg'); background-position: 50% 50%; } The position is set using an X and Y co-ordinate and be set using any of the units used withi...
Macros return code. Since code in Lisp consists of lists, one can use the regular list manipulation functions to generate it. ;; A pointless macro (defmacro echo (form) (list 'progn (list 'format t "Form: ~a~%" (list 'quote form)) form)) This is often very hard to...
Django's default authentication works on username and password fields. Email authentication backend will authenticate users based on email and password. from django.contrib.auth import get_user_model class EmailBackend(object): """ Custom Email Backend to perform authent...
Background threads cannot modify the UI; almost all UIKit methods must be called on the main thread. From a subclass of NSObject (including any UIViewController or UIView): InvokeOnMainThread(() => { // Call UI methods here }); From a standard C# class: UIApplication.SharedApplicat...
The background-attachment property sets whether a background image is fixed or scrolls with the rest of the page. body { background-image: url('img.jpg'); background-attachment: fixed; } ValueDescriptionscrollThe background scrolls along with the element. This is default.fixedThe backgro...
The background-repeat property sets if/how a background image will be repeated. By default, a background-image is repeated both vertically and horizontally. div { background-image: url("img.jpg"); background-repeat: repeat-y; } Here's how a background-repeat: repeat-y looks lik...
Once the instance of the BackgroundWorker has been declared, it must be given properties and event handlers for the tasks it performs. /* This is the backgroundworker's "DoWork" event handler. This method is what will contain all the work you wish to have your progra...
This allows the BackgroundWorker to be cancelled in between tasks bgWorker.WorkerSupportsCancellation = true; This allows the worker to report progress between completion of tasks... bgWorker.WorkerReportsProgress = true; //this must also be used in conjunction with the ProgressChanged event...
A BackgroundWorker is commonly used to perform tasks, sometimes time consuming, without blocking the UI thread. // BackgroundWorker is part of the ComponentModel namespace. using System.ComponentModel; namespace BGWorkerExample { public partial class ExampleForm : Form { ...
The following example demonstrates the use of a BackgroundWorker to update a WinForms ProgressBar. The backgroundWorker will update the value of the progress bar without blocking the UI thread, thus showing a reactive UI while work is done in the background. namespace BgWorkerExample { public...
Create Subtree Add a new remote called plugin pointing to the plugin's repository: git remote add plugin https://path.to/remotes/plugin.git Then Create a subtree specifying the new folder prefix plugins/demo. plugin is the remote name, and master refers to the master branch on the subtree's rep...
First of all, we need to add our first Fragment at the beginning, we should do it in the onCreate() method of our Activity: if (null == savedInstanceState) { getSupportFragmentManager().beginTransaction() .addToBackStack("fragmentA") .replace(R.id.container, FragmentA.n...
Let there be Activity B that can be opened, and can further start more Activities. But, user should not encounter it when navigating back in task activities. The simplest solution is to set the attribute noHistory to true for that <activity> tag in AndroidManifest.xml: <activity a...
The following example listens to window.onerror event and uses an image beacon technique to send the information through the GET parameters of an URL. var hasLoggedOnce = false; // Some browsers (at least Firefox) don't report line and column numbers // when event is handled through window.addE...
A callback is a method that gets called at specific moments of an object's lifecycle (right before or after creation, deletion, update, validation, saving or loading from the database). For instance, say you have a listing that expires within 30 days of creation. One way to do that is like this: ...
If you set opacity on an element it will affect all its child elements. To set an opacity just on the background of an element you will have to use RGBA colors. Following example will have a black background with 0.6 opacity. /* Fallback for web browsers that don't support RGBa */ background-color...
Objective-C mySwitch.backgroundColor = [UIColor yellowColor]; [mySwitch setBackgroundColor: [UIColor yellowColor]]; mySwitch.backgroundColor =[UIColor colorWithRed:255/255.0 green:0/255.0 blue:0/255.0 alpha:1.0]; mySwitch.backgroundColor= [UIColor colorWithWhite: 0.5 alpha: 1.0]; mySwitch.backg...
So you've uploaded your files to a folder say /backend/web/uploads/ and you want these uploads to be visible on the frontend too. The easiest option is to create a symlink in the frontend that links to the backend: ln -s /path/to/backend/web/uploads/ /path/to/frontend/web/uploads In your views y...

Page 2 of 12