Tutorial by Examples: c

There are a few changes where instant won't do its trick and a full build and reinstall fo your app will happen just like it used to happen before Instant Run was born. Change the app manifest Change resources referenced by the app manifest Change an Android widget UI element (requires a Clean ...
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...
We have a C library named my_random that produces random numbers from a custom distribution. It provides two functions that we want to use: set_seed(long seed) and rand() (and many more we do not need). In order to use them in Cython we need to define an interface in the .pxd file and call the f...
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...
public class CustomLookAndFeel { public static void main ( final String[] args ) { // L&F installation should be performed within EDT (Event Dispatch Thread) // This is important to avoid any UI issues, exceptions or even deadlocks SwingUtilities.invokeLater...
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...
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; }
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 -
Canvas is the simplest of panels. It places items at the specified Top/Left coordinates. <Canvas> <TextBlock Canvas.Top="50" Canvas.Left="50" Text="This is located at 50, 50"/> <TextBlock Canvas.Top="100" Canv...
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...
Open Repo Create new repo (My advice first add pods on a temporary repo before adding to your original project) Fill Repository name with your repo name. I'll use "myrepo" for this tutorial and will use "<" and ">" symbols for the parts you should change to yo...
To get the IP address of a docker machine, you can do that with this command : docker-machine ip machine-name
Lists can populated with any data type as necessary, with the format Dim aList as New List(Of Type) For example: Create a new, empty list of Strings Dim aList As New List(Of String) Create a new list of strings, and populate with some data VB.NET 2005/2008: Dim aList as New List(Of String...

Page 298 of 826