Tutorial by Examples: e

Redis keys are binary-safe, so literally anything can be used as a key. The only limitations are that they must be less than 512MB. Examples of valid keys: 7 ++++ `~!@#$%^&*()-_=+ user:10134 search/9947372/?query=this%20is%20a%28test%29%20query <div id="div64"> Any othe...
For clarity and maintainability, it is often recommended to develop a system or schema for naming your Redis keys. Here are some examples of common and maintainable systems for naming your keys: user:10134 user:10134:favorites user:10134:friends user:10134:friends-of-friends user:10134 user:...
IPython has two parts to it: A command line interface that replaces the default python REPL and a way to run Python through the web browser as a graphical user interface. With the latest developments the browser part has been split into the Jupyter project that enables multiple programming language...
The System.String.Trim method can be used to remove all leading and trailing white-space characters from a string: string s = " String with spaces at both ends "; s = s.Trim(); // s = "String with spaces at both ends" In addition: To remove white-space only fro...
Using the System.String.Replace method, you can replace part of a string with another string. string s = "Hello World"; s = s.Replace("World", "Universe"); // s = "Hello Universe" All the occurrences of the search string are replaced: string s = "He...
Use the System.String.Split method to return a string array that contains substrings of the original string, split based on a specified delimiter: string sentence = "One Two Three Four"; string[] stringArray = sentence.Split(' '); foreach (string word in stringArray) { Console.W...
The System.String.Join method allows to concatenate all elements in a string array, using a specified separator between each element: string[] words = {"One", "Two", "Three", "Four"}; string singleString = String.Join(",", words); // singleString =...
String Concatenation can be done by using the System.String.Concat method, or (much easier) using the + operator: string first = "Hello "; string second = "World"; string concat = first + second; // concat = "Hello World" concat = String.Concat(first, second); // ...
A few most salient variants: Below 100 import Data.List ( (\\) ) ps100 = ((([2..100] \\ [4,6..100]) \\ [6,9..100]) \\ [10,15..100]) \\ [14,21..100] -- = (((2:[3,5..100]) \\ [9,15..100]) \\ [25,35..100]) \\ [49,63..100] -- = (2:[3,5..100]) \\ ([9,15..100] ++ [25,35..100] ++ [49,63..1...
In some cases we need to apply functions to a set of ND-arrays. Let's look at this simple example. A(:,:,1) = [1 2; 4 5]; A(:,:,2) = [11 22; 44 55]; B(:,:,1) = [7 8; 1 2]; B(:,:,2) = [77 88; 11 22]; A = ans(:,:,1) = 1 2 4 5 ans(:,:,2) = 11 22 44 55 >&...
Let's look at a sample of logging which you can see in many programs: public class LoggingComplex { private static final Logger logger = Logger.getLogger(LoggingComplex.class.getName()); private int total = 50, orders = 20; private String username = "Bob";...
In MATLAB, we can set new default custom orders, such as a colour order and a line style order. That means new orders will be applied to any figure that is created after these settings have been applied. The new settings remains until MATLAB session is closed or new settings has been made. Default ...
Add the required network permissions to the application manifest file: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android....
Add below dependencies to your build.gradle // Facebook login compile 'com.facebook.android:facebook-android-sdk:4.21.1' Add below helper class to your utility package: /** * Created by Andy * An utility for Facebook */ public class FacebookSignInHelper { private static final...
The %s conversion of printf states that the corresponding argument a pointer to the initial element of an array of character type. A null pointer does not point to the initial element of any array of character type, and thus the behavior of the following is undefined: char *foo = NULL; printf(&quo...
Read a file all at once (not recommended for large files): (slurp "./small_file.txt") Write data to a file all at once: (spit "./file.txt" "Ocelots are Awesome!") ; overwrite existing content (spit "./log.txt" "2016-07-26 New entry." :append...
Extension Resources in Azure are resources that extend other resources. This template creates an Azure Key Vault as well as a DiagnosticSettings extension. Things to note: The extension resource is created under the resources attribute of the parent resource It needs to have a dependsOn attrib...
Create interface for clickHandler public interface ClickHandler { public void onButtonClick(View v); } Layout XML <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android"> <data> ...
Define Interface public interface ClickHandler { public void onButtonClick(User user); } Create Model class public class User { private String name; public User(String name) { this.name = name; } public String getName() { return name; } ...
With this example, you will be able to perform following operations: Connect to Firebase Storage Create a directory named “images” Upload a file in images directory Download a file from images directory Delete a file from images directory public class MainActivity extends AppCompatActivity...

Page 465 of 1191