Tutorial by Examples: e

In order to clear (flush) the entire log: adb logcat -c
HTML email is the use of a subset of HTML and CSS to format an email message like a web page using colors, graphics, table columns and links. When you send an email it’s important to send both plain text and HTML. You do this by sending your email as multi-part MIME. Most email service providers ha...
(Caveat emptor: there are many, many programmers who go into absolute conniptions if they meet code that uses recordsets instead of commands and stored procedures.) <% dim rs, sql dim SelectedUser SelectedUser = request.form("user") if IsNumeric(SelectedUser) then SelectedUser...
To add shadows to text, use the text-shadow property. The syntax is as follows: text-shadow: horizontal-offset vertical-offset blur color; Shadow without blur radius h1 { text-shadow: 2px 2px #0000FF; } This creates a blue shadow effect around a heading Shadow with blur radius To add a...
Using UISettings, the appearance of the Google Map can be modified. Here is an example of some common settings: mGoogleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); mGoogleMap.getUiSettings().setMapToolbarEnabled(true); mGoogleMap.getUiSettings().setZoomControlsEnabled(true); mGoog...
aws s3 ls Use a named profile aws --profile myprofile s3 ls List all objects in a bucket, including objects in folders, with size in human-readable format and a summary of the buckets properties in the end - aws s3 ls --recursive --summarize --human-readable s3://<bucket_name>/
You can do a permissions check when sending an Intent to a registered broadcast receiver. The permissions you send are cross-checked with the ones registered under the tag. They restrict who can send broadcasts to the associated receiver. To send a broadcast request with permissions, specify the p...
A function declared inline may be defined in multiple translation units, provided that all definitions are identical. It also must be defined in every translation unit in which it is used. Therefore, inline functions should be defined in headers and there is no need to mention them in the implementa...
Once you understand how to create an HTTP Server with node, it's important to understand how to make it "do" things based on the path that a user has navigated to. This phenomenon is called, "routing". The most basic example of this would be to check if (request.url === 'some/pa...
C++11 Note: in all the following, the existence of the C++11 constant nullptr is assumed. For earlier versions, replace nullptr with NULL, the constant that used to play a similar role. Creating a pointer variable A pointer variable can be created using the specific * syntax, e.g. int *pointer_...
$ mkdir backup_download_directory && cd !#:1 mkdir backup_download_directory && cd backup_download_directory This will substitute the Nth argument of the current command. In the example !#:1 is replaced with the first argument, i.e. backup_download_directory.
$ mplayer Lecture_video_part1.mkv $ ^1^2^ mplayer Lecture_video_part2.mkv This command will replace 1 with 2 in the previously executed command. It will only replace the first occurrence of the string and is equivalent to !!:s/1/2/. If you want to replace all occurrences, you have to use !!:gs...
$ apt-get install r-base E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? $ sudo !! sudo apt-get install r-base [sudo] password for <user>:
This is a TCP daytime client kept as simple as possible. #include <unistd.h> /* unix standard library */ #include <arpa/inet.h> /* IP addresses manipulation utilities */ #include <netinet/in.h> /* sockaddr_in structure definition */ #include <sys/socket.h> /* ber...
ActionMailer also allows attaching files. attachments['filename.jpg'] = File.read('/path/to/filename.jpg') By default, attachments will be encoded with Base64. To change this, you can add a hash to the attachments method. attachments['filename.jpg'] = { mime_type: 'application/gzip', enco...
ActionMailer supports three callbacks before_action after_action around_action Provide these in your Mailer class class UserMailer < ApplicationMailer after_action :set_delivery_options, :prevent_delivery_to_guests, :set_business_headers Then create these methods under the private ...
Using Ubuntu you have different ways to read a text file, all similar but useful in different context. cat This is the simplest way to read a text file; it simply output the file content inside the terminal. Be careful: if the file is huge, it could take some time to complete the printing process!...
public static string CreateBLOBContainer(string containerName) { try { string result = string.Empty; CloudMediaContext mediaContext; mediaContext = new CloudMediaContext(mediaServicesAccountName, mediaServicesAccou...
private static void GetAllTheAssetsAndFiles(MediaServicesCredentials _medServCredentials) { try { string result = string.Empty; CloudMediaContext mediaContext; mediaContext = new CloudMediaContext(_medServCredentials); ...
Sometimes conversion of primitive types to boxed types is necessary. To convert the array, it's possible to use streams (in Java 8 and above): Java SE 8 int[] primitiveArray = {1, 2, 3, 4}; Integer[] boxedArray = Arrays.stream(primitiveArray).boxed().toArray(Integer[]::new); With lowe...

Page 604 of 1191