Tutorial by Examples: al

If you have a stored DATE or DATETIME (in a column somewhere) it was stored with respect to some time zone, but in MySQL the time zone is not stored with the value. So, if you want to convert it to another time zone, you can, but you must know the original time zone. Using CONVERT_TZ() does the con...
An integer literal is a primary expression of the form decimal-literal It is a non-zero decimal digit (1, 2, 3, 4, 5, 6, 7, 8, 9), followed by zero or more decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) int d = 42; octal-literal It is the digit zero (0) followed by zero or more octal dig...
This is really easy. All TIMESTAMP values are stored in universal time, and always converted to the present time_zone setting whenever they are rendered. SET SESSION time_zone='America/Los_Angeles'; SELECT timestamp_sold FROM sales WHERE state_sold = 'CA' Why is this? TIMESTAMP values are...
Each server has a default global time_zone setting, configured by the owner of the server machine. You can find out the current time zone setting this way: SELECT @@time_zone Unfortunately, that usually yields the value SYSTEM, meaning the MySQL time is governed by the server OS's time zone sett...
To get a list of possible time_zone values in your MySQL server instance, use this command. SELECT mysql.time_zone_name.name Ordinarily, this shows the ZoneInfo list of time zones maintained by Paul Eggert at the Internet Assigned Numbers Authority. Worldwide there are appproximately 600 time z...
%f is the fractional precision format specifier for the DATE_FORMAT() function. SELECT DATE_FORMAT(NOW(3), '%Y-%m-%d %H:%i:%s.%f') displays a value like 2016-11-19 09:52:53.248000 with fractional microseconds. Because we used NOW(3), the final three digits in the fraction are 0.
There are a few ways to setup a local copy of your Shopify theme: Node.js ( gulp/grunt ) Ruby Theme App ( Mac only ) There might be a few other ways, but I found the ruby way the most easy to work with. In order to work locally on the Shopify theme files you will need a few things: Ruby ...
grant all privileges on schema_name.* to 'new_user_name'@'%' identified by 'newpassword'; Attention: This can be used to create new root user
Given an m times n matrix A with n larger than m. The singular value decomposition [U,S,V] = svd(A); computes the matrices U,S,V. The matrix U consists of the left singular eigenvectors which are the eigenvectors of A*A.' while V consists of the right singular eigenvalues which are the eigenvec...
Server Application Session
There are two kinds of persistent storage modes in Redis: AOF and RDB. To temporarily disable RDB execute the following commands on the Redis command line: config set save "" to temporarily disable AOF execute the following from the Redis command line: config set appendonly no The...
It is simple to start using Redis using docker: docker pull redis docker run -p 6379:6379 --rm --name redis redis Now you have running instance on port 6397 Attention: All data will be deleted, when Redis will be stopped. To connect the redis-cli, start another docker: docker run -it --link ...
You can use conditional operators in WordPress to enqueue scripts on specific pages of your Website. function load_script_for_single_post(){ if(is_single()){ wp_enqueue_script( 'some', get_template_directory_uri().'/js/some.js', array...
Using SBT to manage the library dependency, add this to build.sbt: libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.0" libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % "test" More details can be f...
It's quite simple to install wordpress in MAMP. You have to follow a few simple steps: 1 - Download MAMP from here, it's free and you probably don't need the pro version. 2 - Install on your PC or Mac. 3 - Run the program -> you will see a little window open, from there you can set MAMP. At t...
Python allows you to hack list comprehensions to evaluate conditional expressions. For instance, [value_false, value_true][<conditional-test>] Example: >> n = 16 >> print [10, 20][n <= 15] 10 Here n<=15 returns False (which equates to 0 in Python). So what Python i...
Install Java 8 from the Oracle website. (Optional) Install a Java build tool. Whether you choose to use Maven or Gradle, you normally don’t have to install anything, as JHipster will automatically install the Maven Wrapper or the Gradle Wrapper for you. If you don’t want to use those wrappers, ...
18.0 By default, any function specified in a -callback directive in a behaviour module must be exported by a module that implements that behaviour. Otherwise, you'll get a compiler warning. Sometimes, you want a callback function to be optional: the behaviour would use it if present and exported,...
Suppose that we have a text and a pattern. We need to determine if the pattern exists in the text or not. For example: +-------+---+---+---+---+---+---+---+---+ | Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +-------+---+---+---+---+---+---+---+---+ | Text | a | b | c | b | c | g | l | x | +-------...
Entity falling distance is the distance the entity have fallen without reaching a block. It can be used to calculate different damage from falling, or activating an effect after a big fall. Retrieving the falling distance float distanceFell = entity.getFallingDistance(); Setting the falling ...

Page 202 of 269