Tutorial by Examples

Given the table Employee idName3Yooden Vranx And the file employee.txt 1 \t Arthur Dent 2 \t Marvin 3 \t Zaphod Beeblebrox The --ignore option will ignore the entry on duplicate keys $ mysqlimport --ignore mycompany employee.txt idName1Arthur Dent2Marvin3Yooden Vranx The --replace opt...
$ mysqlimport --where="id>2" mycompany employee.txt
$ mysqlimport --fields-optionally-enclosed-by='"' --fields-terminated-by=, --lines-terminated-by="\r\n" mycompany employee.csv
The Q :: * -> * type constructor defined in Language.Haskell.TH.Syntax is an abstract type representing computations which have access to the compile-time environment of the module in which the computation is run. The Q type also handles variable substituion, called name capture by TH (and discus...
The familiar curry :: ((a,b) -> c) -> a -> b -> c curry = \f a b -> f (a,b) function can be generalized to tuples of arbitrary arity, for example: curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -&gt...
Template Haskell is enabled by the -XTemplateHaskell GHC extension. This extension enables all the syntactic features further detailed in this section. The full details on Template Haskell are given by the user guide. Splices A splice is a new syntactic entity enabled by Template Haskell, writ...
First, add Fresco to your build.gradle as shown in the Remarks section: If you need additional features, like animated GIF or WebP support, you have to add the corresponding Fresco artifacts as well. Fresco needs to be initialized. You should only do this 1 time, so placing the initialization in y...
The autocomplete feature in the Google Places API for Android provides place predictions to user. While user types in the search box, autocomplete shows places according to user's queries. AutoCompleteActivity.java private TextView txtSelectedPlaceName; @Override protected void onCreate(@Nulla...
When accessing a non-static member of an object through a pointer to member, if the object does not actually contain the member denoted by the pointer, the behavior is undefined. (Such a pointer to member can be obtained through static_cast.) struct Base { int x; }; struct Derived : Base { int y; ...
CHAR(n) is a string of a fixed length of n characters. If it is CHARACTER SET utf8mb4, that means it occupies exactly 4*n bytes, regardless of what text is in it. Most use cases for CHAR(n) involve strings that contain English characters, hence should be CHARACTER SET ascii. (latin1 will do just ...
Jumps out of the nearest enclosing loop or switch statement. // print the numbers to a file, one per line for (const int num : num_list) { errno = 0; fprintf(file, "%d\n", num); if (errno == ENOSPC) { fprintf(stderr, "no space left on device; output will be t...
List subList(int fromIndex, int toIndex) Here fromIndex is inclusive and toIndex is exclusive. List list = new ArrayList(); List list1 = list.subList(fromIndex,toIndex); If the list doesn't exist in the give range, it throws IndexOutofBoundException. What ever changes made on the list1 wi...
Often you want to match an expression only in specific places (leaving them untouched in others, that is). Consider the following sentence: An apple a day keeps the doctor away (I eat an apple everyday). Here the "apple" occurs twice which can be solved with so called backtracking cont...
Detailed instructions on getting image set up or installed.
The DATE datatype comprises the date but no time component. Its format is 'YYYY-MM-DD' with a range of '1000-01-01' to '9999-12-31'. The DATETIME type includes the time with a format of 'YYYY-MM-DD HH:MM:SS'. It has a range from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. The TIMESTAMP type is...
The result of a reinterpret_cast from one function pointer type to another, or one function reference type to another, is unspecified. Example: int f(); auto fp = reinterpret_cast<int(*)(int)>(&f); // fp has unspecified value C++03 The result of a reinterpret_cast from one object poi...
So your query has failed (see MySQLi connect for how we made $conn) $result = $conn->query('SELECT * FROM non_existent_table'); // This query will fail How do we find out what happened? $result is false so that's no help. Thankfully the connect $conn can tell us what MySQL told us about the f...
Consider following is our function call. FindArea(120, 56); In this our first argument is length (ie 120) and second argument is width (ie 56). And we are calculating the area by that function. And following is the function definition. private static double FindArea(int length, int width) ...
Consider preceding is our function definition with optional arguments. private static double FindAreaWithOptional(int length, int width=56) { try { return (length * width); } catch (Exception) { thro...
Custom validation attributes can be created by deriving from the ValidationAttribute base class, then overriding virtual methods as needed. [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] public class NotABananaAttribute : ValidationAttribute { public ov...

Page 720 of 1336