Tutorial by Examples: 4

If you want to migrate from existing log4j 1.x in your project to log4j 2.x then remove all existing log4j 1.x dependencies and add the following dependency: Log4j 1.x API Bridge Maven Build <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> ...
Note: There will be some Objective-c in this example.. We will make a wrapper to C++ in this example, So don't worry to much about it. First start Xcode and create a project. And select a Cocoa application Delete all sources except the Info.plist file.(Your app won't work without it) Creat...
Encoding //convert the image to NSData first let imageData:NSData = UIImagePNGRepresentation(image)! // convert the NSData to base64 encoding let strBase64:String = imageData.base64EncodedStringWithOptions(.Encoding64CharacterLineLength) Decoding let dataDecoded:NSData = NSData(base64Encoded...
Checking whether the current date contains the symbol for AM or PM Objective-C NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setLocale:[NSLocale currentLocale]]; [formatter setDateStyle:NSDateFormatterNoStyle]; [formatter setTimeStyle:NSDateFormatterShortStyle]; NSStr...
Since there is no STRING_SPLIT function we need to use XML hack to split the string into rows: Example: SELECT split.a.value('.', 'VARCHAR(100)') AS Value FROM (SELECT Cast ('<M>' + Replace('A|B|C', '|', '</M><M>')+ '</M>' AS XML) AS Data) AS A CROSS apply data...
For a 12hour time format one can use: ^(?:0?[0-9]|1[0-2])[-:][0-5][0-9]\s*[ap]m$ Where (?:0?[0-9]|1[0-2]) is the hour [-:] is the separator, which can be adjusted to fit your need [0-5][0-9] is the minute \s*[ap]m followed any number of whitespace characters, and am or pm If you need th...
Sometimes you have to deal with structures defined in terms of C data types from Perl. One such application is the creation of raw network packets, in case you want to do something fancier than what the regular socket API has to offer. This is just what pack() (and unpack() of course) is there for. ...
You can find the Android Sample in [SFML_ROOT]\examples\android You can copy it to leave the SFML repository in it's original state. Open cmd.exe in the sample location. To get a list of all available Android build targets: android list target Run Update Project for the Sample: android upda...
from bs4 import BeautifulSoup import requests # Use the requests module to obtain a page res = requests.get('https://www.codechef.com/problems/easy') # Create a BeautifulSoup object page = BeautifulSoup(res.text, 'lxml') # the text field contains the source of the page # Now use a CSS ...
C++14 C++14 allows to use auto in lambda argument auto print = [](const auto& arg) { std::cout << arg << std::endl; }; print(42); print("hello world"); That lambda is mostly equivalent to struct lambda { template <typename T> auto operator ()(const...
/* * The built-in (previously called default) VCL code. * * NB! You do NOT need to copy & paste all of these functions into your * own vcl code, if you do not provide a definition of one of these * functions, the compiler will automatically fall back to the default * code from this f...
The C++14 standard is often referred to as a bugfix for C++11. It contains only a limited list of changes of which most are extensions to the new features in C++11. Below you can find an overview of the changes as they have been grouped on the isocpp FAQ with links to more detailed documentation. L...
Introduction Play has several plugins for different IDE-s. The eclipse plugin allows to transform a Play application into a working eclipse project with the command activator eclipse. Eclipse plugin may be set per project or globally per sbt user. It depends on team work, which approach should be u...
Prior to Json.NET 4.5 dates were written using the Microsoft format: "/Date(1198908717056)/". If your server sends date in this format you can use the below code to serialize it to NSDate: Objective-C (NSDate*) getDateFromJSON:(NSString *)dateString { // Expect date in this format ...
This tutorial will guide you through the process from scratch. Please note some preliminary notes about this particular setup, useful in case that you already have some requested package: Is needed a version of php >=5.0 (I had troubles with php 7.0) Is requested any version of perl Is need...
See discussions in "GRANT" and "Recovering root password".
1067 This is probably related to TIMESTAMP defaults, which have changed over time. See TIMESTAMP defaults in the Dates & Times page. (which does not exist yet) 1292/1366 DOUBLE/Integer Check for letters or other syntax errors. Check that the columns align; perhaps you think you are putting i...
When you try access the records from MySQL database, you may get these error messages. These error messages occurred due to corruption in MySQL database. Following are the types MySQL error code 126 = Index file is crashed MySQL error code 127 = Record-file is crashed MySQL error code 134 = Recor...
(taking a break) With the inclusion of those 4 error numbers, I think this page will have covered about 50% of the typical errors users get. (Yes, this 'Example' needs revision.) 24 Can't open file (Too many open files) open_files_limit comes from an OS setting. table_open_cache needs to be les...
The summation 1/1 + 1/2 + 1/3 + 1/4 + ... + 1/n is equal to the nth harmonic number, denoted Hn. The nth harmonic number obeys the inequalities ln (n + 1) ≤ Hn ≤ (ln n) + 1 and therefore Hn = Θ(log n). The harmonic numbers often arise in the analysis of algorithms, with randomized quicks...

Page 3 of 8