Tutorial by Examples: and

You might want to import and export your database for bacukups for example. Dont forget about the permissions. public void exportDatabase(){ try { File sd = Environment.getExternalStorageDirectory(); File data = Environment.getDataDirectory(); String currentD...
This basic example shows how an application can instantiate a classloader and use it to dynamically load a class. URL[] urls = new URL[] {new URL("file:/home/me/extras.jar")}; Classloader loader = new URLClassLoader(urls); Class<?> myObjectClass = loader.findClass("com.exampl...
If the underlying type is not explicitly specified for an unscoped enumeration type, it is determined in an implementation-defined manner. enum E { RED, GREEN, BLUE, }; using T = std::underlying_type<E>::type; // implementation-defined However, the standard does require th...
C++11 All standard library containers are left in a valid but unspecified state after being moved from. For example, in the following code, v2 will contain {1, 2, 3, 4} after the move, but v1 is not guaranteed to be empty. int main() { std::vector<int> v1{1, 2, 3, 4}; std::vector&l...
Most printable characters can be included in string or regular expression literals just as they are, e.g. var str = "ポケモン"; // a valid string var regExp = /[Α-Ωα-ω]/; // matches any Greek letter without diacritics In order to add arbitrary characters to a string or regular expression,...
KafkaConsumers request messages from a Kafka broker via a call to poll() and their progress is tracked via offsets. Each message within each partition of each topic, has a so-called offset assigned—its logical sequence number within the partition. A KafkaConsumer tracks its current offset for each p...
WTForms provides a FileField to render a file type input. It doesn't do anything special with the uploaded data. However, since Flask splits the form data (request.form) and the file data (request.files), you need to make sure to pass the correct data when creating the form. You can use a Combine...
When the shell performs parameter expansion, command substitution, variable or arithmetic expansion, it scans for word boundaries in the result. If any word boundary is found, then the result is split into multiple words at that position. The word boundary is defined by a shell variable IFS (Interna...
while IFS= read -r line;do echo "**$line**" done < <(ping google.com) or with a pipe: ping google.com | while IFS= read -r line;do echo "**$line**" done
Let's assume that the field separator is : while IFS= read -d : -r field || [ -n "$field" ];do echo "**$field**" done < <(ping google.com) Or with a pipe: ping google.com | while IFS= read -d : -r field || [ -n "$field" ];do echo "**$field**&q...
The following function reads an entire file into a new string and returns it: (defun read-file (infile) (with-open-file (instream infile :direction :input :if-does-not-exist nil) (when instream (let ((string (make-string (file-length instream)))) (read-sequence string instr...
These two properties work in a similar fashion as the overflow property and accept the same values. The overflow-x parameter works only on the x or left-to-right axis. The overflow-y works on the y or top-to-bottom axis. HTML <div id="div-x"> If this div is too small to displa...
This is how the author sets their personal PS1 variable: gitPS1(){ gitps1=$(git branch 2>/dev/null | grep '*') gitps1="${gitps1:+ (${gitps1/#\* /})}" echo "$gitps1" } #Please use the below function if you are a mac user gitPS1ForMac(){ git branch 2> ...
class ImageCreationExample { static Image createSampleImage() { // instantiate a new BufferedImage (subclass of Image) instance BufferedImage img = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB); //draw something on the image paintOnI...
Create a simple DataFrame. import numpy as np import pandas as pd # Set the seed so that the numbers can be reproduced. np.random.seed(0) df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC')) # Another way to set column names is "columns=['column_1_name','column_2_name','c...
~$ ping -c 1 google.com # unmodified output PING google.com (16.58.209.174) 56(84) bytes of data. 64 bytes from wk-in-f100.1e100.net (16.58.209.174): icmp_seq=1 ttl=53 time=47.4 ms ~$ ping google.com | grep -o '^[0-9]\+[^()]\+' # modified output 64 bytes from wk-in-f100.1e100.net 64 bytes from...
Read, write and insert into internal tables with a header line: " Read from table with header (using a loop): LOOP AT i_compc_all. " Loop over table i_compc_all and assign header line CASE i_compc_all-ftype. " Read cell ftype from header line from table i_com...
Creating a WebM video from canvas frames and playing in canvas, or upload, or downloading. Example capture and play canvas name = "CanvasCapture"; // Placed into the Mux and Write Application Name fields of the WebM header quality = 0.7; // good quality 1 Best < 0.7 ok to poor fps =...
core.async is about making processes that take values from and put values into channels. (require [clojure.core.async :as a]) Creating channels with chan You create a channel using the chan function: (def chan-0 (a/chan)) ;; unbuffered channel: acts as a rendez-vous point. (def chan-1 (a/chan...
You can improve the security for data transit or storing by implementing encrypting techniques. Basically there are two approaches when using System.Security.Cryptography: symmetric and asymmetric. Symmetric Encryption This method uses a private key in order to perform the data transformation. ...

Page 86 of 153