Tutorial by Examples: e

Coroutines can yield inside themselves, and wait for other coroutines. So, you can chain sequences - "one after the other". This is very easy, and is a basic, core, technique in Unity. It's absolutely natural in games that certain things have to happen "in order". Almost every...
On of the overloads of the Select extension methods also passes the index of the current item in the collection being selected. These are a few uses of it. Get the "row number" of the items var rowNumbers = collection.OrderBy(item => item.Property1) .ThenBy...
TakeWhile returns elements from a sequence as long as the condition is true int[] list = { 1, 10, 40, 50, 44, 70, 4 }; var result = list.TakeWhile(item => item < 50).ToList(); // result = { 1, 10, 40 }
DataTables has the capability to enable or disable a number of its features, such as paging or searching. To choose these options, simply select them in your initialization: $(document).ready(function() { $('#tableid').DataTable( { "paging": false, //Turn off paging, all r...
DataTables comes with an extensive API which is used to manipulate or obtain information about the DataTables on a page. The API can be accessed in 3 ways: var table = $('#tableid').DataTable(); //DataTable() returns an API instance immediately var table = $('#tableid').dataTable().api(); //dataT...
Swing supports quite a few native L&Fs. You can always easily install one without calling for a specific L&F class: public class SystemLookAndFeel { public static void main ( final String[] args ) { // L&F installation should be performed within EDT (Event Dispatch ...
Arithmetic computation can be also done without involving any other programs like this: Multiplication: echo $((5 * 2)) 10 Division: echo $((5 / 2)) 2 Modulo: echo $((5 % 2)) 1 Exponentiation: echo $((5 ** 2)) 25
Lambdas are meant to provide inline implementation code for single method interfaces and the ability to pass them around as we have been doing with normal variables. We call them Functional Interface. For example, writing a Runnable in anonymous class and starting a Thread looks like: //Old way n...
Random UUID Swift func randomUUID() -> NSString{ return NSUUID.UUID().UUIDString() } Objective-C + (NSString *)randomUUID { if(NSClassFromString(@"NSUUID")) { // only available in iOS >= 6.0 return [[NSUUID UUID] UUIDString]; } CFUUIDRef uuidRef = ...
server { listen 80 default_server; listen [::]:80 default_server; server_name example.com www.example.com; return 307 https://$host$request_uri; } A 301 redirect is also an alternative but if a POST is made to a 301, then many clients will resubmit the request as a GET - whic...
server { server_name example.com; return 301 $scheme://example.net$request_uri; }
1.8 Run: $ git mv old/path/to/module new/path/to/module 1.8 Edit .gitmodules and change the path of the submodule appropriately, and put it in the index with git add .gitmodules. If needed, create the parent directory of the new location of the submodule (mkdir -p new/path/to). M...
Since Ionic 2 is getting better and better every day, please always check the official documentation to keep track of the latest changes and improvements. Prerequisites: You will need NodeJS in order to build Ionic 2 projects. You can download and install node here and learn more about npm and the...
One way to calculate the Big-O value of a procedure you've written is to determine which line of code runs the most times in your function, given your input size n. Once you have that number, take out all but the fastest-growing terms and get rid of the coefficents - that is the Big-O notation of yo...
Categories provide the ability to add some extra functionality to an object without subclassing or changing the actual object. For example we want to set some custom fonts. Lets create a category that add functionality to UIFont class. Open your Xcode project, click on File -> New -> File an...
You can quickly switch to the previous branch using git checkout -
DockPanel aligns the control according to the dock property, in the order it's placed in the control. NOTE: DockPanel is part of the WPF framework, but does not come with Silverlight/WinRT/UWP. Open-source implementations are easy to find though. <DockPanel LastChildFill="False"> ...
StackPanel places its controls one after another. It acts like a dock panel with all of its control's docks set to the same value. <!-- The default StackPanel is oriented vertically, so the controls will be presented in order from top to bottom --> <StackPanel> <Button Content=&q...
Locally created images can be pushed to Docker Hub or any other docker repo host, known as a registry. Use docker login to sign in to an existing docker hub account. docker login Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https...
Run the install on a single run command to merge the update and install. If you add more packages later, this will run the update again and install all the packages needed. If the update is run separately, it will be cached and package installs may fail. Setting the frontend to noninteractive and pa...

Page 426 of 1191