Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
dynamically suggest completions for your argument/option values (for example, if the user is browsing resources over
the network).

Shellcode (only necessary if global completion is not activated - see Global completion below), to be put in e.g. .bashrc:

eval "$(register-python-argcomplete my-awesome-script.py)"

argcomplete.autocomplete(parser)

This method is the entry point to the module. It must be called after ArgumentParser construction is complete, but
before the ArgumentParser.parse_args() method is called. The method looks for an environment variable that the
completion hook shellcode sets, and if it’s there, collects completions, prints them to the output stream (fd 8 by
default), and exits. Otherwise, it returns to the caller immediately.

Side effects

Argcomplete gets completions by running your program. It intercepts the execution flow at the moment
argcomplete.autocomplete() is called. After sending completions, it exits using exit_method (os._exit
by default). This means if your program has any side effects that happen before argcomplete is called, those
side effects will happen every time the user presses <TAB> (although anything your program prints to stdout or
stderr will be suppressed). For this reason it’s best to construct the argument parser and call
argcomplete.autocomplete() as early as possible in your execution flow.

Specifying completers

You can specify custom completion functions for your options and arguments. Two styles are supported: callable and
readline-style. Callable completers are simpler. They are called with the following keyword arguments:

prefix: The prefix text of the last word before the cursor on the command line. All returned completions should begin with this prefix.

action: The argparse.Action instance that this completer was called for.

parser: The argparse.ArgumentParser instance that the action was taken by.

parsed_args: The result of argument parsing so far (the argparse.Namespace args object normally returned by
ArgumentParser.parse_args()).

Completers should return their completions as a list of strings. An example completer for names of environment
variables might look like this:

Note that if you use the choices=<completions> option, argparse will show
all these choices in the --help output by default. To prevent this, set
metavar (like parser.add_argument("--protocol",metavar="PROTOCOL",choices=('http', 'https', 'ssh', 'rsync', 'wss'))).

The following script uses
parsed_args and Requests to query GitHub for publicly known members of an
organization and complete their names, then prints the member description:

Readline-style completers

The readline module defines a completer protocol in rlcompleter. Readline-style completers are also supported by
argcomplete, so you can use the same completer object both in an interactive readline-powered shell and on the bash
command line. For example, you can use the readline-style completer provided by IPython to get introspective
completions like you would get in the IPython shell:

Printing warnings in completers

Normal stdout/stderr output is suspended when argcomplete runs. Sometimes, though, when the user presses <TAB>, it’s
appropriate to print information about why completions generation failed. To do this, use warn:

fromargcompleteimportwarndefAwesomeWebServiceCompleter(prefix,**kwargs):iflogin_failed:warn("Please log in to Awesome Web Service to use autocompletion")returncompletions

Using a custom completion validator

By default, argcomplete validates your completions by checking if they start with the prefix given to the completer. You
can override this validation check by supplying the validator keyword to argcomplete.autocomplete():

defmy_validator(current_input,keyword_to_check_against):# Pass through ALL options even if they don't all start with 'current_input'returnTrueargcomplete.autocomplete(parser,validator=my_validator)

Global completion

In global completion mode, you don’t have to register each argcomplete-capable executable separately. Instead, bash
will look for the string PYTHON_ARGCOMPLETE_OK in the first 1024 bytes of any executable that it’s running
completion for, and if it’s found, follow the rest of the argcomplete protocol as described above.

Bash version compatibility

Global completion requires bash support for complete -D, which was introduced in bash 4.2. On OS X or older Linux
systems, you will need to update bash to use this feature. Check the version of the running copy of bash with
echo $BASH_VERSION. On OS X, install bash via Homebrew (brew install bash), add
/usr/local/bin/bash to /etc/shells, and run chsh to change your shell.

Global completion is not currently compatible with zsh.

Note

If you use setuptools/distribute scripts or entry_points directives to package your module,
argcomplete will follow the wrapper scripts to their destination and look for PYTHON_ARGCOMPLETE_OK in the
destination code.

Activating global completion

The script activate-global-python-argcomplete will try to install the file
bash_completion.d/python-argcomplete.sh (see on GitHub) into an appropriate location on your system
(/etc/bash_completion.d/ or ~/.bash_completion.d/). If it
fails, but you know the correct location of your bash completion scripts directory, you can specify it with --dest:

activate-global-python-argcomplete --dest=/path/to/bash_completion.d

Otherwise, you can redirect its shellcode output into a file:

activate-global-python-argcomplete --dest=- > file

The file’s contents should then be sourced in e.g. ~/.bashrc.

Debugging

Set the _ARC_DEBUG variable in your shell to enable verbose debug output every time argcomplete runs. Alternatively,
you can bypass the bash completion shellcode altogether, and interact with the Python code directly with something like
this:


Q:

Thermodynamics Work Done At constant pressure and charles law

If we fix a piston in the mouth of a cylindrical container in such a way that the piston settles when the pressure from outside the piston is equal to that of the gas within the container, and increase the temperature, the molecules of the gas will collide more frequently with the wall of the container and also with the bottom surface of the piston, and the pressure will increase due to larger force from inside the container, and the pressure does not remain constant.
So how can volume change by keeping pressure constant ,pressure has to change. When gas stops to expand then of course pressure is same as it was initially but in the process it has to be greater than initial pressure so that it moves the piston up. Now my doubt is then how is Charles law correct and how is work done at constant pressure..?
I am really confused about this and I have my exam really soon, I have to get grip on thermodynamics.

A:

Charle's Law:
$\frac{V}{T}=k$
The idea is that, given an ideal gas, as the temperature rises the system instantly responds by balancing the potential increase in pressure with an actual increase in volume.
In the case of the piston, you can easily measure the work done by measuring how much the piston moved. But in a general case:
$dW = Fdx$
$Fdx$ or force times movement interval could be written as pressure (force over area) times interval of area times area interval times movement interval or $dW = pdAdx$. You can represent that better with $dW = pdV$ or volume interval.
So for a general case, with constant pressure, the work done by the gas is $W = p(V_f - V_i)$.
Nevertheless, depending on what they ask, you might need to use:
$pV = nRT$
In that case, you need to solve the integral:
$W = nRT\int_{V_i}^{V_f} \frac{dV}{V}$
Which solves to:
$W=nRT(\ln{V_f} - \ln{V_i})$
Or
$W=nRT \ln{\frac{V_f}{V_i}}$


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.lucene.queries.function.valuesource;

import java.io.IOException;

import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;

/** Function to divide "a" by "b"
 */
public class DivFloatFunction extends DualFloatFunction {
 /**
   * @param   a  the numerator.
   * @param   b  the denominator.
   */
  public DivFloatFunction(ValueSource a, ValueSource b) {
    super(a,b);
  }

  @Override
  protected String name() {
    return "div";
  }

  @Override
  protected float func(int doc, FunctionValues aVals, FunctionValues bVals) throws IOException {
    return aVals.floatVal(doc) / bVals.floatVal(doc);
  }
}


Novel metallo beta-lactamase mediated by a Shigella flexneri plasmid.
Novel carbapenem-hydrolyzing beta-lactamase (newly named MET-1) encoded on a transferable plasmid pMS390 from Shigella flexneri JS19622 was purified. The molecular weight was 28,000 by SDS-PAGE and the isoelectric point was higher than 9.3. This beta-lactamase favorably hydrolyzed classical cephalosporins and oxyimino-cephalosporins rather than penicillins and carbapenems, but did not hydrolyze monobactams. The enzymatic activity was inhibited by EDTA, and the enzyme was found to contain two moles of zinc per mole of enzyme protein by means of atomic absorption spectrophotometry. These results indicated that the enzyme is a zinc beta-lactamase which differs from known metallo beta-lactamases, especially in its cephalosporinase-type substrate profile.


Soyurgatmish

Soyurghatmïsh Khan (died 1384) was Khan of the Western Chagatai Khanate (1370–1384). He was the son of Danishmendji, of the House of Ogedei.

When Timur gained control of the territory of the western Chagatai Khanate in the 1360s, he did not abolish the office of khan. Instead, in order to legitimatize his authority, he placed on the throne Soyurgatmish, that was not a member of the house of Chagatai Khan, but from the house of Ogedei. Timur ruled as an amir in Soyurgatmish's name. The khan, however, was only a ceremonial figure, and Timur held all of the power within the state. Upon Soyurgatmish's death in 1384, he was replaced by his son Sultan Mahmud.

His daughter Urun Sultan Khanika was married to Timur's son Miran Shah.

References

Category:1384 deaths
Category:Chagatai khans
Category:14th-century monarchs in Asia
Category:Year of birth unknown


CARACAS, Venezuela — A Venezuelan Supreme Court justice and longtime government loyalist who fled the socialist country for a new life in the United States called Nicolas Maduro an incompetent president leading the once-wealthy country to ruins.

Christian Zerpa’s embarrassing defection came days before Maduro begins his second term amid calls from critics and the international community to relinquish power.

Zerpa on Monday accused Venezuela’s high court of becoming a tool of Maduro’s inner circle, lacking any judicial independence since he and a group of ruling party members were appointed to the bench in 2015.

“Nicolas Maduro doesn’t know the constitution, and he doesn’t know the laws,” Zerpa said in a Florida news conference. “This has no other name than a dictatorship.”

A once wealthy oil nation, Venezuela is in the throes of a historic crisis after two decades of socialist rule. Millions have fled, while runaway inflation leaves those remaining behind struggling to afford scarce food and medicine.

Maduro is expected to take his oath of office on Thursday before the Supreme Court, launching his second, six-year term.

Political opponents and many foreign nations consider it illegitimate, saying his re-election in May was a sham because popular opponents were banned from running and the largest anti-government parties boycotted the race.

Zerpa said that he fled with his family because he didn’t want to play a role legitimizing Maduro’s rule. Relatives staying behind have since been visited by Venezuela’s intelligence police, he said.

“Maduro is incompetent,” Zerpa said. “The country and it public companies are in ruins.”

In far-reaching comments, Zerpa said the military lacks a national conscience for allowing Maduro stay in power, and he accused Supreme Court chief justice Maikel Moreno of having ties with drug traffickers.

Zerpa didn’t provide evidence, holding back sensitive information, but said that he’s ready to cooperate with a sweeping U.S. investigation into corruption and human rights abuses among Venezuela’s well-connected.

Maduro loyalist Moreno said Sunday that Zerpa fled Venezuela to escape allegations of sexual harassment charges lodged by women in his office. Zerpa denied Moreno’s claims.

Zerpa surfaced publicly in Miami on Sunday, describing how he received directions from the influential first lady Cilia Flores on how to rule in politically sensitive cases.

As a newly installed justice, he recounted being summoned to the court and told to sign off on a key ruling without first reviewing its details. It disqualified three elected representatives of Amazonas state from taking their seats in congressfollowing the opposition’s sweep of legislative elections in 2015.

The key ruling cemented Maduro’s power, preventing the opposition from amassing a two-third super majority that would have severely curtailed Maduro’s power.

Zerpa apologized for propping up Maduro’s government as long as he did, saying that he feared being jailed as a dissident where his life would be put at risk.

“I will not be able to return to Venezuela,” Zerpa said. “I am a dead man.”

Zerpa is among the top Venezuelan officials who have been sanctioned by Canada, but he has not been targeted by U.S. authorities, who accuse dozens in Maduro’s administration of using their power for personal gain.

Pressure has been mounting against Maduro internationally and from his political opponents still inside Venezuela.

A dozen Latin American governments and Canada delivered a blistering rebuke Friday, rejecting the legitimacy of Maduro’s second term and urging him to hand over power as the only path to restoring democracy.

The opposition-led congress on Saturday opened its session for the year vowing to battle against Maduro’s socialist administration.

Maduro says he intends to take the oath despite his critics and press ahead with the socialist revolution, promising a turnaround of the failing economy.

“The revolution is stronger today than ever, more experienced than ever, to defend the sovereignty of the country,” he said. “Venezuelans have the opportunity to enjoy 2019 as a year of prosperity and progress.”

Sign up for Daily Newsletters Manage Newsletters

Copyright © 2020 The Washington Times, LLC.


Introduction {#fdy166s5}
============

Tobacco advertising is a major marketing activity that tobacco companies use to increase consumption of tobacco.^[@fdy166C1]^ With strengthened regulations for tobacco control, the types of cigarette advertisements have been limited.^[@fdy166C2]^ To promote the sale of tobacco products, tobacco companies pay enormous amounts to display tobacco products and install cigarette advertisements at the point of sale (POS).^[@fdy166C3]^

Cigarette advertising and display at POS contribute to making cigarettes a popular product,^[@fdy166C4]^ and adversely affect the creation of a smoke-free environment^[@fdy166C5]^ because they can undermine attempts to quit and create an impulse to buy cigarettes in smokers, as well as causing ever smokers to restart smoking and affecting smoking susceptibility and smoking initiation in adolescents.^[@fdy166C6],[@fdy166C7]^ Therefore, the Framework Convention on Tobacco Control (FCTC) requires that all types of tobacco advertising and promotional activities, including displays at POS, be banned within 5 years of the entry into force of the Convention.^[@fdy166C8]^

To enhance implementation of the Convention and to reduce socio-economic losses due to smoking, the Korean government announced comprehensive tobacco-control measures that included a plan to enact a comprehensive ban on tobacco advertising, promotion and sponsorship.^[@fdy166C9]^ The measures involved a plan for the gradual expansion of a ban on the advertisement and display of cigarettes at POS. Nevertheless, cigarettes were still displayed and various cigarette advertisements were evident in a survey of 2856 stores near schools in 2016.^[@fdy166C10]^

In addition, convenience stores (20.8 advertisements) had a higher average number of interior cigarette advertisements than supermarkets (8.0 advertisements) and small cigarette retailers (3.5 advertisements).^[@fdy166C10]^ Convenience stores, which have maintained a rapid, sustained growth rate since their entry into the market, now play an important role in retail distribution in Korea.^[@fdy166C11]^ As such, the market growth of convenience stores is related to tobacco advertising in these stores.^[@fdy166C12]^ Indeed, the tobacco industry is forced to concentrate on displays and advertisements placed at POS because these are the main ways to communicate with current and future customers,^[@fdy166C13]^ given that mass media tobacco advertising is banned in Korea.^[@fdy166C14]^ Because the Korea convenience store market is expected to grow gradually, especially as the consumption pattern has changed to local shopping and hand-to-mouth buying due to the increased number of one-person households and an aging population,^[@fdy166C11]^ exposure to cigarette advertisements and displays could increase, increasing the problem.

To communicate brand image, tobacco companies use the principle of repetition, including consistency and relevance,^[@fdy166C15]^ because consumers' choices and purchasing are influenced unconsciously by processed messages, as well as by conscious recognition.^[@fdy166C16],[@fdy166C17]^ Indeed, repetitive exposure increases positive emotional reactions, preference, favor and familiarity with a product that is remembered unconsciously, and is related to the likelihood of purchasing and using a product.^[@fdy166C18]^ However, previous research focused on the impact of tobacco promotion at POS among children, youths and young adults.^[@fdy166C19]^ Although cigarette displays at POS affect brand recall related to smoking uptake, few studies have examined recall of cigarette advertisements at POS, especially in a real situation immediately following exit from the store.^[@fdy166C20]^

It is necessary to examine how many people are exposed to cigarette advertisements and displays and how much of this advertising they recall. Moreover, there is a need to explore the factors that affect their recall. Therefore, in this study, we examined the extent to which visitors to convenience stores remembered the cigarette advertisements that they encountered in these stores, and investigated the relationship between advertisement recall and attitudes toward the advertisements.

Methods {#fdy166s6}
=======

Survey days and locations {#fdy166s7}
-------------------------

We conducted an exit survey of visitors to three convenience stores located in Seoul, Korea, for 12 days. To examine participants with various demographic characteristics, the locations of the convenience stores were varied. Three stores were selected in a downtown area: one in a commercial area, one in a school zone and one in a residential area. Each convenience store sold and displayed cigarettes and had installed cigarette advertisements, under similar advertising conditions.

Procedures {#fdy166s8}
----------

As our survey was aimed at people who visit convenience stores, people exiting convenience stores were asked by a trained interviewer to participate in the survey. We used a tablet computer to record the data collected during the interviews with consenting participants. Each participant was given a disposable hand warmer as a token of our gratitude for completing the survey.

Participants {#fdy166s9}
------------

The survey participants were selected randomly at the survey locations, and non-proportional allocation sampling was used to select the target groups:^[@fdy166C21]^ adult smokers, adult non-smokers and adolescents. Participants over the age of 19 years were defined as adults, while those between 12 and 18 years were defined as adolescents. Current or occasional smokers were defined as smokers and those who had smoked in the past but no longer smoked or had never smoked were defined as non-smokers. Ultimately, we asked 1200 respondents to participate in the survey. After excluding invalid responses, we analyzed data from 1007 respondents.

Measurements {#fdy166s10}
------------

The questionnaire consisted of three sections: demographic characteristics, advertising recall and attitude toward cigarette advertisements in convenience stores. The questions on demographics included the participant's sex, birth year, current occupation, current smoking status, average number of visits to the convenience store per week and products purchased. In addition, smokers were asked questions about the average number of cigarettes smoked per day, frequency of cigarette purchases per week, past experience with attempting to quit, intention to quit and type of cigarettes purchased.

To compare the accuracy of recall, we assessed the two types of advertising recall, namely free recall and cued recall, with different questions. The free recall measures, which we adapted from those used in previous alcohol and tobacco marketing studies,^[@fdy166C22],[@fdy166C23]^ were more objective than the perceived exposure measure. Successful free recall means that the stored information has been correctly retrieved. In the cued recall evaluation, we confirmed whether the information was stored for information processing purposes by showing the respondents images from the convenience store they had just visited and asking them if they recognized the advertisements. We asked the participants two advertising recall questions developed by Carter *et al.*^[@fdy166C23]^ The following free recall question was asked first: 'What cigarette ads, if any, did you see in the convenience store?' We considered the free recall task to have been completed successfully if the participant mentioned anything related to the cigarette advertisements or displays inside the store. Next, in preparation for the cued recall question, a view card was made for each convenience store. The participant was shown the card and asked, 'Which advertisement on this card do you remember?' If the participant selected any advertisement or display from the card, the cued recall was considered successful.

Finally, five questions were used to assess the participant's attitude toward cigarette advertisements in convenience stores: 'I usually pay close attention to the cigarette advertisements in the convenience store (Attention); I usually get information about new products from cigarette advertisements (Information); When I see cigarette advertisements, I usually become curious about the product (Curious); When I see cigarette advertisements, I usually have an urge to smoke (Smoking); and When I see cigarette advertisements, I usually get the urge to purchase the product (Purchase)'. The response options were cored using a 5-point Likert scale ranging from strongly disagree to strongly agree. For the data analysis, responses one through three were classified as the disagree group, and four and five were identified as the agree group.

Data analysis {#fdy166s11}
-------------

All statistical analyses were performed using IBM SPSS ver. 24.0. Descriptive statistics were generated to summarize the participants' characteristics, recall of advertising (free recall and cued recall) in the convenience store just visited, and attitude toward cigarette advertisements in the convenience store. After adjusting for store location, we performed a logistic regression analysis to elucidate the relationship between participants' demographic characteristics and their performance on both types of advertising recall task. To examine factors affecting their attitude, multiple logistic regression analysis was used to calculate the adjusted odds ratio (aOR) and 95% confidence interval (CI) adjusting for all other variables and store location in the model. In this study, *P*-values \<0.05 were considered significant.

Results {#fdy166s12}
=======

Participants {#fdy166s13}
------------

Table [1](#fdy166TB1){ref-type="table"} presents the participants' characteristics: 612 males (60.8%) and 395 (39.2%) females participated in this survey, including 298 adolescents (29.6%) and 709 adults (70.4%). The mean age of the participants was 31.4 (standard deviation \[SD\] = 13.7) years, and 28.7% (*n* = 289) of the participants were white-collar workers.

######

Summary of the key characteristics of study participants (*n* = 1007)

  Characteristic                                                    *n*   (%)
  ----------------------------------------------------------------- ----- --------
  Sex
  Male                                                              612   (60.8)
  Female                                                            395   (39.2)
  Age (years)
   12--18                                                           298   (29.6)
   19--29                                                           225   (22.3)
   30--39                                                           197   (19.6)
   40--49                                                           157   (15.6)
   ≥50                                                              130   (12.9)
  Occupation
   Student                                                          348   (34.6)
   White collar                                                     289   (28.7)
   Blue collar                                                      201   (20.0)
   Other                                                            169   (16.8)
  Convenience store visits per week
   5--7                                                             320   (31.8)
   4                                                                211   (21.0)
   3                                                                304   (30.2)
   1--2                                                             172   (17.0)
  Cigarettes purchased
   Yes                                                              299   (29.7)
   No                                                               708   (70.3)
  Smoking status
   Smoker                                                           357   (35.5)
   Non-smoker                                                       650   (64.5)
  Quitting attempted^a^
   Yes                                                              146   (40.9)
   No                                                               211   (59.1)
  Intention to quit^a^
   Within 1 month                                                   9     (2.5)
   Within 6 months                                                  30    (8.4)
   Thinking about quitting, but not within 6 months                 133   (37.3)
   No interest in quitting                                          185   (51.8)
  Type of cigarette purchase^a^
   Planned                                                          348   (97.5)
   Unplanned                                                        9     (2.5)
  Purchased an alternative brand rather than their usual brand^a^
   Yes                                                              29    (8.1)
   No                                                               328   (91.9)

^a^Data for the subset of 357 smoker participants.

The average number of visits to the convenience store per week was 3.8 (SD = 1.4) times for all participants. The average number of weekly visits to the convenience store was 5--7 times for 31.8% (*n* = 320), 4 times for 21.0% (*n* = 211), 3 times for 30.2% (*n* = 304) and 1--2 times for 17.0% (*n* = 172). Moreover, 29.7% (*n* = 299) of the participants purchased cigarettes during their visit to the convenience store.

Of the participants, 35.5% (*n* = 357) were smokers and 64.5% (*n* = 650) were non-smokers. The smokers smoked an average of 14.8 (SD = 5.2) cigarettes per day, and the average number of visits to the convenience store was 4.6 (SD = 1.3) per week. Most smokers (97.5%, *n* = 348) decided to buy a specific cigarette brand in advance and visited a tobacco retailer. In addition, most smokers tended to buy only one brand of cigarettes (91.9%, *n* = 328), although 8.1% (*n* = 29) of smokers often bought other brands. Of the smokers, 40.9% (*n* = 146) had attempted to quit smoking, 48.2% (*n* = 172) planned to quit smoking and 51.8% (*n* = 185) had no plan to quit at present.

Advertising recall for the convenience store just visited {#fdy166s14}
---------------------------------------------------------

The advertisements or displays in the store that participants had just visited were recalled by 23.4% (*n* = 236) of respondents in the free recall task and by 55.2% (*n* = 556) of respondents in the cued recall task. Participants' advertising recall increased by 73.8% when we showed them options on a card. This increase was particularly noticeable among adolescents, students and non-smokers.

Table [2](#fdy166TB2){ref-type="table"} shows the multiple logistic regression results after adjusting for store location. In the case of free recall, when compared with participants aged ≥50 years, the adjusted odds of recall of cigarette advertisements or displays in the convenience store just visited was significantly higher among participants aged 19--29 years (aOR = 2.8, 95% CI: 1.4--5.4), 30--39 years (aOR = 2.5, 95% CI: 1.3--4.8), and 40--49 years (aOR = 2.5, 95% CI: 1.3--4.6). In addition, smokers were 3.0 times (95% CI = 1.6--5.8) more likely to recall advertising than non-smokers.

######

Descriptive and multiple logistic regression analyses showing the adjusted odds ratio (aOR) and 95% confidence interval (95% CI) for risk factors associated with free recall and cued recall of cigarette advertisements or displays in the convenience store just visited

                                      Free recall success (*n* = 236)   Cued recall success (*n* = 556)
  ----------------------------------- --------------------------------- --------------------------------- --------- ---------------- ----- -------- --------- --------------------
  Sex
   Male                               161                               (68.2)                            1.1       (0.8--1.7)       365   (65.6)   1.4       (1.0--1.9)
   Female                             75                                (31.8)                            1.0       Ref.             191   (34.4)   1.0       Ref.
  Age (years)
   12--18                             25                                (10.6)                            1.1       (0.4--2.8)       133   (23.9)   1.4       (0.6--3.0)
   19--29                             75                                (31.8)                            **2.8**   **(1.4--5.4)**   139   (25.0)   1.6       (0.9--2.8)
   30--39                             60                                (25.4)                            **2.5**   **(1.3--4.8)**   118   (21.2)   1.5       (0.9--2.5)
   40--49                             52                                (22.0)                            **2.5**   **(1.3--4.6)**   93    (16.7)   1.1       (0.7--1.9)
   ≥50                                24                                (10.2)                            1.0       Ref.             73    (13.1)   1.0       Ref.
  Occupation
   Student                            40                                (16.9)                            0.9       (0.4--1.9)       160   (28.8)   0.7       (0.4--1.5)
   White collar                       86                                (36.4)                            0.9       (0.5--1.5)       173   (31.1)   1.0       (0.6--1.6)
   Blue collar                        68                                (28.8)                            1.3       (0.7--2.2)       123   (22.1)   1.2       (0.7--2.0)
   Other                              42                                (17.8)                            1.0       Ref.             100   (18.0)   1.0       Ref.
  Convenience store visits per week
   5--7                               111                               (47.0)                            **2.0**   **(1.0--3.7)**   204   (36.7)   1.1       (0.7--1.8)
   4                                  49                                (20.8)                            1.8       (0.9--3.4)       121   (21.8)   1.0       (0.7--1.6)
   3                                  59                                (25.0)                            1.7       (0.9--3.2)       155   (27.9)   1.1       (0.7--1.7)
   1--2                               17                                (7.2)                             1.0       Ref.             76    (13.7)   1.0       Ref.
  Cigarettes purchased
   Yes                                130                               (55.1)                            1.1       (0.6--1.9)       211   (37.9)   0.9       (0.5--1.6)
   No                                 106                               (44.9)                            1.0       Ref.             345   (62.1)   1.0       Ref.
  Smoking status
   Smoker                             153                               (64.8)                            **3.0**   **(1.6--5.8)**   252   (45.3)   **2.5**   **(1.3**--**4.7)**
   Non-smoker                         83                                (35.2)                            1.0       Ref.             304   (54.7)   1.0       Ref.

aOR, adjusted odds ratio; CI, confidence interval; Ref, reference. The values in bold are statistically significant (*P* \< 0.05).

^a^Including all control variables, regardless of significance of contribution to the model, and adjusted for store location.

The frequency of visiting the convenience store was also related to the recall of cigarette advertisements or displays, and those who visited 5--7 times a week were more likely to recall the advertisements than were those who visited 1--2 times per week (aOR = 2.0, 95% CI: 1.0--3.7). There were no significant associations between free recall and occupation or cigarette purchase or sex.

However, significantly, the cued recall performance was associated only with current smoking status; smokers were 2.5 times (95% CI = 1.3--4.7) more likely to recall advertising than were non-smokers.

Attitude toward cigarette advertisements {#fdy166s15}
----------------------------------------

Of the participants, 4.4% (*n* = 44) agreed that they usually paid close attention to the cigarette advertisements in the convenience store (Table [3](#fdy166TB3){ref-type="table"}). In addition, 7.5% (*n* = 76) of the participants usually tended to obtain information about new products from the cigarette advertisements in the convenience store. When they saw cigarette advertisements, 7.3% (*n* = 74) of the participants reported developing some degree of curiosity about the product advertised, 8.1% (*n* = 82) reported getting an urge to smoke, and 8.1% (*n* = 82) reported an urge to purchase the product advertised.

######

Descriptive analysis for attitudes toward cigarette advertisements (*n* = 1007)

                                                                                *n*   (%)
  ------------------------------------------------------------------------------------- ----- --------
  I usually pay close attention to the cigarette advertisements in convenience stores
   Agree                                                                                44    (4.4)
   Disagree                                                                             963   (95.6)
  I usually obtain information about new products from cigarette advertisements
   Agree                                                                                76    (7.5)
   Disagree                                                                             931   (92.5)
  When I see cigarette advertisements, I usually become curious about the products
   Agree                                                                                74    (7.3)
   Disagree                                                                             933   (92.7)
  When I see cigarette advertisements, I usually feel an urge to smoke
   Agree                                                                                82    (8.1)
   Disagree                                                                             925   (91.9)
  When I see cigarette advertisements, I usually feel an urge to purchase the product
   Agree                                                                                82    (8.1)
   Disagree                                                                             925   (91.9)

Next, Table [4](#fdy166TB4){ref-type="table"} shows the results from the multiple logistic regression between the participants' characteristics and their attitudes toward cigarette advertisements in convenience stores, after adjusting for store location. The frequency with which participants visited convenience stores was related to the level of attention that they paid to the cigarette advertisements inside; those who visited 5--7 times a week (aOR = 9.5, 95% CI: 1.2--76.2) or 4 times a week (aOR = 8.9, 95% CI: 1.1--72.3) were more likely to pay attention to the advertisements than were those who visited 1--2 times per week.

######

Multiple logistic regression analyses showing the adjusted odds ratio (aOR) and 95% confidence interval (95% CI) for the attitudes toward cigarette advertisements with respect to the participants' individual characteristics and advertising recall performance (free recall and cued recall) in the convenience store just visited

                                      Attention   Information       Curious   Smoking           Purchase
  ----------------------------------- ----------- ----------------- --------- ----------------- ---------- ----------------- --------- ----------------- --------- -----------------
  Sex
   Male                               0.8         (0.4--1.6)        0.9       (0.5--1.8)        0.9        (0.5--1.7)        1.6       (0.8--3.1)        1.2       (0.6--2.3)
   Female                             1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Age (years)
   12--18                             0.7         (0.1--3.6)        0.5       (0.1--2.3)        0.9        (0.2--4.7)        0.8       (0.2--3.7)        1.5       (0.3--7.2)
   19--29                             1.0         (0.3--3.3)        0.7       (0.2--2.0)        1.5        (0.5--4.5)        0.7       (0.2--2.1)        1.4       (0.5--4.2)
   30--39                             0.7         (0.2--2.4)        1.5       (0.6--4.0)        2.1        (0.7--6.4)        2.2       (0.8--5.8)        2.6       (0.9--7.5)
   40--49                             0.7         (0.2--2.3)        1.1       (0.4--2.9)        1.9        (0.7--5.5)        1.7       (0.7--4.4)        2.5       (0.9--6.9)
   ≥50                                1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Occupation
   Student                            0.8         (0.2--3.3)        2.0       (0.6--6.9)        1.9        (0.6--6.1)        1.1       (0.3--3.7)        0.9       (0.3--2.8)
   White collar                       0.5         (0.2--1.4)        1.1       (0.5--2.7)        0.8        (0.3--1.8)        0.7       (0.3--1.6)        0.7       (0.3--1.6)
   Blue collar                        0.9         (0.3--2.5)        0.9       (0.4--2.2)        0.5        (0.2--1.4)        0.3       (0.1--0.8)        0.4       (0.2--1.0)
   Other                              1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Convenience store visits per week
   5--7                               **9.5**     **(1.2--76.2)**   0.9       (0.3--2.4)        2.6        (0.7--9.6)        4.5       (1.0--20.9)       4.0       (0.9--18.2)
   4                                  **8.9**     **(1.1--72.3)**   0.6       (0.2--1.8)        0.7        (0.2--3.2)        1.8       (0.4--9.0)        2.8       (0.6--13.4)
   3                                  4.2         (0.5--34.8)       0.4       (0.2--1.3)        1.4        (0.4--5.2)        3.4       (0.7--15.6)       1.3       (0.3--6.5)
   1--2                               1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Cigarettes purchased
   Yes                                0.4         (0.1--1.0)        1.4       (0.6--3.2)        0.8        (0.4--1.7)        0.5       (0.2--1.1)        0.8       (0.3--1.7)
   No                                 1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Smoking status
   Smoker                             2.8         (1.0--8.2)        **3.1**   **(1.1--8.5)**    **5.3**    **(1.9--15.0)**   **4.7**   **(1.8--12.0)**   **5.0**   **(1.9--13.5)**
   Non-smoker                         1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Recall
   Free recall
   Success                            **6.4**     **(2.6--15.7)**   **4.5**   **(2.4--8.4)**    **4.7**    **(2.4--9.0)**    **3.8**   **(2.1--7.0)**    **4.6**   **(2.5--8.6)**
   Failure                            1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.
  Cued recall
   Success                            0.7         (0.3--1.8)        **4.6**   **(1.8--11.5)**   **2.9**    **(1.1--7.4)**    **2.3**   **(1.0--5.3)**    **3.5**   **(1.3--9.1)**
   Failure                            1.0         Ref.              1.0       Ref.              1.0        Ref.              1.0       Ref.              1.0       Ref.

Attention: endorsement meant that participants usually paid close attention to cigarette advertisements in convenience stores.

Information: endorsement meant that participants usually obtained information about new products from cigarette advertisements.

Curious: endorsement meant that participants usually felt curious about cigarettes when they saw them advertised.

Smoking: endorsement meant that participants usually felt an urge to smoke when they saw cigarette advertisements.

Purchase: endorsement meant that participants usually felt an urge to purchase cigarettes when they saw them advertised.

aOR, adjusted odds ratio; CI, confidence interval; Ref, reference. The values in bold are statistically significant (*P* \< 0.05).

^a^Including all control variables (e.g. sex, age, occupation, weekly frequency of visiting the convenience store, cigarettes purchase, smoking status and advertising recall (free recall and cued recall)) regardless of the significance of their contribution to the model and adjusted for store location.

The adjusted odds ratio for attention in the group that completed the free recall task successfully (aOR = 6.4, 95% CI: 2.6--15.7) was significantly higher than that in the group who failed the free recall trial. In addition, respondents who were successful at the free recall task were significantly more likely than did those who were not to agree that they usually recalled information from cigarette advertisements (aOR = 4.5, 95% CI: 2.4--8.4), that they usually became curious about the products advertised (aOR = 4.7, 95% CI: 2.4--9.0), that they usually felt the urge to smoke (aOR = 3.8, 95% CI: 2.1--7.0), and that they usually felt the urge to purchase the product advertised (aOR = 4.6, 95% CI: 2.5--8.6).

Likewise, those who completed the cued recall task successfully were significantly more likely than were those who failed the cued recall task to express positive attitudes toward cigarette advertisements (Information: aOR = 4.6, 95% CI: 1.8--11.5; Curious: aOR = 2.9, 95% CI: 1.1--7.4; Smoking: aOR = 2.3, 95% CI: 1.0--5.3; Purchase: aOR = 3.5, 95% CI: 1.3--9.1). In addition, smokers were significantly more likely than non-smokers to report a positive attitude toward cigarette advertisements (Information: aOR = 3.1, 95% CI: 1.1--8.5; Curious: aOR = 5.3, 95% CI: 1.9--15.0; Smoking: aOR = 4.7, 95% CI: 1.8--12.0; Purchase: aOR = 5.0, 95% CI: 1.9--13.5).

Discussion {#fdy166s16}
==========

Main finding of this study {#fdy166s17}
--------------------------

The purpose of this study was to assess exposure to cigarette advertisements and displays in convenience stores and to evaluate the effects of this exposure. To this end, this study investigated recall of cigarette advertisements, including displays, in convenience stores just visited and the factors that affected recall. To minimize bias in advertising recall tasks, we administered our survey as consumers were exiting a store and assessed the two types of advertising recall, free recall and cued recall, using different questions. In total, 23.4% (*n* = 236) and 55.2% (*n* = 556) of the participants successfully completed the free and cued recall tasks, respectively. Cued recall was about twice as successful as free recall; this difference was particularly noticeable among adolescents, students and non-smokers.

The free recall performance of participants in their 20 s was stronger than that of participants aged 50 and over, in smokers than in non-smokers, and in those who visited convenience stores 5--7 times per week than in those who visited 1--2 times a week. The cued recall success of participants who identified themselves as smokers was higher than that of non-smokers. Moreover, although most people do not usually pay attention to cigarette advertisements in convenience stores, those who succeeded in recalling cigarette advertisements were likely to have a positive attitude toward them.

What is already knowns on this topic {#fdy166s18}
------------------------------------

Exposure to tobacco advertising and displays at POS influences the smoking behavior of smokers. Indeed, such exposure enables smokers to continue to smoke and is associated with impulsive cigarette purchase.^[@fdy166C24],[@fdy166C25]^ It also makes it more difficult for smokers to quit smoking.^[@fdy166C5]^ As a result, the ban on tobacco advertising and display affects the decline in the prevalence of smoking. Yanyyn *et al.*^[@fdy166C26]^ presented results implying that imposing a POS display ban reduced the overall adult daily smoking rate, male smoking rate and female smoking rate by \~7, 6 and 9%, respectively. In addition, the removal of POS tobacco advertising and displays is a popular measure that is supported by the majority of adults. Adults from countries where these measures have been adopted agree that the ban has made it easier for people to quit smoking.^[@fdy166C27]^

Although the teenage participants did not report that this type of exposure significantly influenced their behavior or attitudes, POS tobacco advertisements distort adolescents' perceptions of the availability, use, and popularity of tobacco products,^[@fdy166C28]^ and are associated with positive attitudes toward smoking.^[@fdy166C29]^ This renders adolescents much more vulnerable to starting smoking.^[@fdy166C30]--[@fdy166C33]^ Indeed, repeated exposure to cigarette advertisements by visiting convenience stores may increase the likelihood of smoking and the possibility of adolescents' becoming smokers in adulthood.^[@fdy166C34],[@fdy166C35]^ Since advertising can distort young people's emotions and the processes that lead them to accept information,^[@fdy166C36]^ it is necessary to protect vulnerable young people from cigarette advertisements.

What this study adds {#fdy166s19}
--------------------

The results of the free recall and cued recall experiments require different interpretations. The free recall performance indicates whether participants could verbalize their memories of cigarette advertisements, whereas their cued recall performance confirms that they remembered an advertisement, either verbally or non-verbally.^[@fdy166C22],[@fdy166C23]^ Thus, free recall is the clearest indication that stored information has been successfully recalled after it has been processed. This is noteworthy because it does not simply mirror the way that free recall tasks differ from cued recall tasks.

Notably, Korean smokers were better at free recall than Australian smokers (42.9 versus 20.0%),^[@fdy166C23]^ which demonstrates the significance of the effects of the high levels of exposure to cigarette advertisements and displays in Korean convenience stores. That is because Australia has gradually implemented a ban on the display of tobacco at POS.^[@fdy166C26]^

Additionally, participants were easily able to recall, with only minimal cues, whether there were cigarette advertisements and/or displays in a store and, if so, to report on their contents. Although we may have overestimated the cued recall performance because our option card may have led participants to a particular response, our results imply that Koreans are exposed to cigarette advertising without even realizing that this is the case. They apparently store the contents of these advertisements unconsciously, as only 4.4% (*n* = 44) of the 1007 survey participants said that they usually paid attention to cigarette advertisements, but 23.4% (*n* = 236) and 55.2% (*n* = 556) successfully completed the free and cued recall tasks, respectively.

In purchasing decisions, consumers have different feelings and thoughts depending on what product they are considering. Consumer involvement is determined according to the level of personal interest.^[@fdy166C37]^ Generally, cigarette products are considered as ranking low in terms of the level of personal involvement and feelings.^[@fdy166C37]^ Indeed, cigarettes are low in price and are not immediately dangerous, even if consumers are mistaken to purchase them. This means that consumers often make relatively quick decisions when purchasing them and consider the satisfaction of their personal tastes as highly important.^[@fdy166C37]^

In other words, consumers behave passively in response to information about low-involvement products,^[@fdy166C37]^ so companies develop advertising that consumers can easily remember, rather than strategies based on large volumes of content.^[@fdy166C38]^ As a result, strategies based on mere exposure to advertisements have been applied in the case of low-involvement products such as cigarettes. These strategies aim to make consumers feel more familiar with the brand. Furthermore, they may even unconsciously encourage consumers to purchase a product.^[@fdy166C38],[@fdy166C39]^

We found that people recalled tobacco advertisements easily, despite not usually paying close attention to tobacco advertising. These results imply that many people store information about cigarette advertisements unconsciously due to repeated exposure to tobacco advertising and displays. In particular, we should highlight the results showing that 10.6% of adolescents completed the free recall task successfully, and 23.9% succeeded in the cued recall task, indicating that repeated exposure to cigarette advertisements may affect their future purchasing behavior. Therefore, the installation of POS cigarette advertisements and displays of tobacco products should be prohibited to protect adolescents from indiscriminate exposure to tobacco advertisements and thereby to prevent smoking.

Additionally, the more frequently the convenience stores were visited, the greater was the probability of successful free recall. Thus, repeatedly exposing people to cigarette advertisements or displays maintains their positive attitudes toward cigarette advertisements^[@fdy166C18]^ and attracts the attention of vulnerable people who are susceptible to advertisements.^[@fdy166C40]^ In particular, although most people disagreed with our results on the influence of cigarette advertising, recall was found to be associated with a positive attitude toward cigarette advertisements.

Conflicts between people's beliefs and behaviors cause cognitive dissonance,^[@fdy166C41]^ which in turn affects consumer's post-purchase attitudes. After purchasing a particular product, people tend to change their beliefs or behaviors to address any cognitive dissonance they may be experiencing, even if they do not usually pay attention to or express any interest in such products.^[@fdy166C41],[@fdy166C42]^ As a result, repeated exposure to tobacco advertising can lead to cognitive dissonance about tobacco products. This implies that the likelihood that both smokers and non-smokers will make impulse tobacco purchases will increase in the future. Furthermore, product preferences may become more positive or the likelihood of buying may increase to reduce the cognitive dissonance.^[@fdy166C42]^

As they increase in popularity, convenience stores are becoming more and more integrated into daily life,^[@fdy166C11]^ with most participants visiting their local convenience store more than three times per week. Exposure to tobacco advertising has become common and will continue to increase in the future. We will be exposed to environments where we can buy cigarettes at any time. Therefore, to create smoke-free environments, we must prohibit tobacco advertising across all mass media formats, including TV.

Limitations of this study {#fdy166s20}
-------------------------

There are some limitations to this study. First, the association between advertising recall and perceptions of cigarettes and smoking was not examined. Therefore, our results are insufficient to interpret the effects of repeated exposure to cigarette advertisements and display at POS, especially convenience stores. Second, because this study targeted specific convenience stores, the results for recall not comparable. There may have been differences in the immediate recall because the type and number of advertisements varied from store to store. A future study should examine differences in recall, according to the site of the tobacco sales. Third, to reduce the non-sampling error, we trained the interviewers in advance, but the survey still had the same problems as a face-to-face interview.

Conclusions {#fdy166s21}
-----------

We found that the free recall performance of participants in their 20 s was stronger than that of participants aged 50 and older, in smokers than in non-smokers, and in those who visited the convenience store 5--7 times per week versus 1--2 times a week. Moreover, participants expressed positive attitudes toward cigarette advertisements that they successfully recalled. The display and sale of tobacco products at the convenience store itself not only makes cigarettes a general commodity like other goods but also makes them recognizable because of repeated exposure, even if we do not remember the content of the advertisements. Repeated exposure to cigarette advertisements and displays can help to maintain a positive emotion about the products and increase the likelihood of purchasing cigarettes and the intent to smoke. Therefore, to protect adolescents from exposure to tobacco advertisements, to prevent smoking, and to create smoke-free environments, cigarette advertisements and displays at POS should be banned to denormalize and phase-out smoking and tobacco products in society.

The authors thank the Korea Ministry of Health and Welfare and the Korea Health Promotion Institute.

Conflict of interest {#fdy166s22}
====================

None declared.

Authorship {#fdy166s23}
==========

JH, YY, JL, SL and YO designed the study. JH analyzed the data and wrote the article. SC contributed to the interpretation of the results. YO was involved in manuscript revision and study supervisor. All authors reviewed and approved the final article.

Funding {#fdy166s24}
=======

This work was supported by the Korea Health Promotion Fund (KHPF), Ministry of Health and Welfare, Republic of Korea.

Ethics approval {#fdy166s25}
===============

This study was approved by the Institutional Review Board of the Korea Health Promotion Institute (No.1709-HR-009-01).


Census Data Highlights Pacific Northwest Population Growth

Washington, Oregon and Idaho gained over 200,000 new people from July 2016 to July 2017.

U.S. Census Bureau

Listen

Listening...

/

1:07

States in the Pacific Northwest are among the fastest growing in the country. And according to the latest census figures, it’s gaining people more than twice as fast as the national average.

Migration to the region—rather than births—made up the bulk of population growth.

Last year, Idaho was the smallest state in the region with just under 1.7 million people. So when approximately 36,917 babies and newcomers landed in the state, it gave Idaho’s population a big boost.

And, according to new Census numbers, all those new people made the state’s growth rate the fastest in the country since July 2016.

Clark Krause is with the Boise Valley Economic Partnership, which works to attract business and workers to the area. He said Idaho is home to some major employers.

“We have a nice tech cluster that is started here and of course that is anchored by Hewlett Packard and Micron who have huge units here,” he said.

Krause also said Boise’s access to the outdoors is a selling point.

Washington and Oregon had their share of newcomers too. In fact, Washington was No. 4 in overall population growth in the country. In all, the region added more than 200,000 people from July 2016 to July 2017.


var b = require('./b');
var a = require('./a');
t.equal(b, 'foo');
t.equal(a, 'bar');


/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.elasticsearch.index.analysis;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ckb.SoraniNormalizationFilter;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.assistedinject.Assisted;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.settings.IndexSettingsService;

/**
 * Factory for {@link SoraniNormalizationFilter}
 */
public class SoraniNormalizationFilterFactory extends AbstractTokenFilterFactory {

    @Inject
    public SoraniNormalizationFilterFactory(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings) {
        super(index, indexSettingsService.getSettings(), name, settings);
    }

    @Override
    public TokenStream create(TokenStream tokenStream) {
        return new SoraniNormalizationFilter(tokenStream);
    }

}


Q:

Moment js return always zero time

I am trying to get duration between now and future time:
var d = moment.utc('27.03.2018 - 15:43:01', 'DD.MM.YYYY - HH:mm:ss')
var v = moment.utc(moment.duration(d).asMilliseconds()).format("HH:mm:ss")
console.log(v);

Problem is that v is always 00:00:00, why?
d is valid moment object.

A:

When calling duration(param), the parameter must be one of the values described in the docs: https://momentjs.com/docs/#/durations/creating/
ex: if you call it like moment.duration(100), this creates a duration of 100 milliseconds. A duration represents a span of elapsed time, or an "amount of time".
If you pass a date object to it (moment.duration(d)), this doesn't make sense. You're trying to create a duration (a span of elapsed time) from a date value. And that's a misunderstanding of 2 concepts:

a date/time represents a specific point in the calendar
a duration represents a span of elapsed time, and it's not attached to any specific point in the calendar

You can do things like:

calculate the difference between 2 dates: the result is a duration (between today 10 AM and tomorrow 2 PM, the difference - the duration is 28 hours - not considering DST effects: https://www.timeanddate.com/time/dst/transition.html)
add/subtract a duration to a date: today 8 AM, plus a duration of 2 hours, equals today 10 AM

But creating a duration from a date, without having another date as reference, doesn't make sense. In this specific case, moment just decided to return a duration with the value equals to zero: print the value of moment.duration(d), you'll see P0T - that's the ISO 8601 representation of a zero-duration: https://en.wikipedia.org/wiki/ISO_8601#Durations
Then you call .asMilliseconds(), that returns the total amount of milliseconds that the duration represents. In this case, it's returning zero.
Then you call moment.utc() passing the result above as parameter. In other words, you're doing the same as moment.utc(0). When you pass a number to utc(), it interprets this number as "the number of milliseconds since Unix epoch": https://momentjs.com/docs/#/parsing/utc/
As you're passing zero, the result is the Unix epoch itself, which is January 1st 1970 at midnight in UTC.
Then you call .format("HH:mm:ss") to print the hours, minutes and seconds. As moment.utc(0) is at midnight, the result is 00:00:00.
If you want to calculate the difference between 2 dates, use the diff method as explained by Pavlo's answer.


377 N.W.2d 62 (1985)
STATE of Minnesota, Respondent,
v.
James A. FORD, Appellant.
No. CX-85-719.
Court of Appeals of Minnesota.
November 19, 1985.
Review Granted January 31, 1986.
*63 Hubert H. Humphrey, III, Atty. Gen., St. Paul, R. Kathleen Morris, Scott Co. Atty., Mary Yunker, Asst. Co. Atty., Shakopee, for respondent.
Phillip Gainsley, Minneapolis, for appellant.
Heard, considered, and decided by HUSPENI, P.J., and RANDALL and CRIPPEN, JJ.

OPINION
RANDALL, Judge.
Appellant, James A. Ford, appeals from an order denying his motion to dismiss the charges, from a judgment of conviction entered on April 10, 1985, and from an order denying his motion to withdraw his guilty plea to two of twelve charged counts.
Appellant makes two claims. Appellant first claims that the acts alleged in the complaint do not come within the scope of Minn.Stat. § 609.43(2) (1984). Appellant further claims that if the acts do come under § 609.43(2), he should be allowed to withdraw his plea of guilty and stand trial because the State reneged on the plea agreement.
The trial court erred in denying appellant's motion to dismiss. We reverse.

*64 FACTS
Appellant, assistant vice principal and teacher of history and speech at Shakopee High School, was charged with ten counts of misconduct of a public employee under Minn.Stat. §§ 609.43(2) and 609.43(3), one count of sodomy, and one count of fornication. All counts were based on alleged sexual contact with four Shakopee High female students and former students: J.A.S. (age 17), K.S. (age 16), D.B. (age 17), and J.M. (age 19). The acts occurred between 1980 and 1984.
The State alleges that appellant did such things as allow the young women to violate school rules by smoking on the school grounds, avoid physical education requirements, use his office for personal business after school hours, and leave the school grounds during school hours for unauthorized purposes.
The twelve counts alleged various acts including claims that appellant hugged, kissed, and fondled these students and engaged in consensual oral and vaginal sex with two of them, D.B. and J.A.S.
The State alleges that appellant cultivated personal relationships with the students while they were under the age of sixteen, but refrained from making sexual advances until they turned sixteen, the age of consent.[1] It is not disputed that all alleged acts complained of were consensual.
Appellant moved to dismiss claiming that the charged acts did not come within the scope of Minn.Stat. §§ 609.43(2) and 609.43(3). The court denied his motion but allowed appellant to preserve this claim while the State and appellant negotiated a plea agreement.
The State and appellant negotiated the following plea agreement: appellant pleaded guilty to counts two and six of the complaint alleging misconduct of a public employee (Minn.Stat. § 609.43(2)); he also agreed to fully cooperate with the presentence investigation (P.S.I.), to comply with therapy recommendations, to refrain from making derogatory public statements about the witnesses against him, and to admit a factual basis supporting the plea.
In return, the prosecutor agreed to drop the remaining ten counts, recommend a pre-sentence investigation and psychological examination, and recommend no further incarceration if appellant cooperated fully with the P.S.I. The plea agreement was silent as to who would determine whether or not appellant fully "cooperated" with the P.S.I.
Prior to accepting appellant's guilty plea the court stated to both attorneys that it would not be bound by the State's sentencing recommendation.
The court repeated that it would not be bound by the State's sentencing recommendation in an in-chambers hearing held prior to sentencing. At this in-chambers hearing, in the presence of defense counsel, the prosecutor attempted to withdraw his recommendation that appellant not be incarcerated based on the prosecutor's belief that appellant had not cooperated with the P.S.I.
The court refused to allow the State to withdraw from the plea agreement and made a finding that appellant had cooperated with the P.S.I. The court advised the prosecutor:
Now how you word what you have to say when I ask if you have anything further beyond what you said at the time the bargain was entered into is up to you but the record will show that I am saying you're not going to be allowed to tell me *65 that you're changing your position on that recommendation.
Prior to sentencing, when the judge asked the prosecutor if he had anything further to say, the prosecutor responded "no." When the court asked the same question of the defense attorney, the defense attorney made no reference to the prosecutor's failure to make the bargained for recommendation of no jail time. Defense counsel reiterated his contention that Minn.Stat. §§ 609.43(2) and 609.43(3) were inappropriate statutes under which to charge appellant.
The trial court sentenced appellant to consecutive terms of two years probation on each of the two counts. As a condition of probation, appellant was to serve two consecutive six-month sentences in the Scott County Jail, one for each count.
The prosecutor inadvertently failed to make a motion to drop the remaining ten counts in exchange for appellant's guilty plea to two counts, and the court never did formally dismiss those counts. At oral argument on appeal, the county attorney assured this court that failure to drop the charges was an oversight and that the charges would be dropped at the close of the proceeding. The prosecutor vowed to the court that the State had no intent to pursue the charges further.
On April 16, 1985, the trial court denied appellant's post-sentencing motion to withdraw his guilty plea. At the hearing the court stated its position:
The record should show that I still take the position that the sentence is up to the Judge, regardless of the plea bargain. I know your position is, "Hey, he (prosecutor) should have gotten up and mouthed the words, say, `I recommend no further incarceration.'"
The Appellate Court will have the entire background of what went on in this particular case and the position that the State took to the effect that, "Hey, that was a conditional bargain on that point and we don't think he lived up to the condition," and I said I think he did, so I directed the State not to attempt to make any recommendations of further incarceration, so they were just living by my Order on that. Whether or not the Appellate Court will feel that, despite my ruling back there, he should have gotten up and said, "We will stand by our recommendations," I don't know. That's up to them.
The trial court stayed execution of the jail sentence to allow appellant time to file the appeal and preserved appellant's right to claim that the facts alleged in the complaint did not constitute a crime under §§ 609.43(2) and 609.43(3).
From the judgment of conviction and denial of appellant's motion to withdraw his guilty plea, appellant appeals.

ISSUES
1. Did the trial court err in denying appellant's motion to dismiss and in ruling that the complaint alleged sufficient probable cause to charge appellant under Minn. Stat. § 609.43(2) and (3)?
2. Did the trial court err in refusing to allow appellant to withdraw his guilty plea based on appellant's claim that the plea bargain had been violated?

ANALYSIS

I.

Probable Cause
Appellant challenges the trial court's finding of probable cause under Minn.Stat. §§ 609.43(2) and 609.43(3) (1984). Because appellant pleaded guilty only to counts charged under § 609.43(2), we reach neither the issues of probable cause under § 609.43(3) nor the propriety of the counts of sodomy and fornication.
Appellant argues that § 609.43(2) was not intended to prohibit private conduct, such as participation in consensual sexual relationships with persons of the age of consent.
Minn.Stat. § 609.43(2) states:
A public officer or employee who does any of the following, for which no other *66 sentence is specifically provided by law, may be sentenced to imprisonment for not more than one year or to payment of a fine of not more than $3,000, or both:
(2) In his capacity as such officer or employee, does an act which he knows is in excess of his lawful authority or which he knows he is forbidden by law to do in his official capacity.
The construction of a statute is a question of law. See State v. Schwarze, 120 Wis.2d 453, 457, 355 N.W.2d 842, 843 (1984). Our review of questions of law is independent and we need not defer to the trial court's interpretation of a statute. Durfee v. Rod Baxter Imports, Inc., 262 N.W.2d 349, 354 (Minn.1977).
A high school vice principal and teacher, as an employee of the state public school system supported by state funds, is a public employee for purposes of § 609.43(2).
The advisory committee comment to Minn.Stat.Ann. § 609.43 (West 1964) discusses the kinds of misconduct intended to be reached by the statute:
Among the specific acts dealt with * * are bribery, permitting escape of prisoners, accepting unauthorized fees, etc.
In general * * * no attempt has been made to bring very many special provisions within the compass of the general or to expand the number of special situations dealt with separately.
Section 609.43 subjects public employees and officials to criminal sanctions for acts done in an official capacity.
No Minnesota cases construing sexual conduct under Minn.Stat. § 609.43(2) and its application to sexual misconduct could be found.
Criminal statutes are to be strictly construed in favor of defendants. State v. Haas, 280 Minn. 197, 159 N.W.2d 118, (1968), U.S. v. Bramblett, 348 U.S. 503, 509, 75 S.Ct. 504, 508, 99 L.Ed. 594 (1955). All reasonable doubt concerning legislative intent should be resolved in favor of the defendant. Haas, 280 Minn. at 200, 159 N.W.2d at 121.
There is a scarcity of case law interpreting 609.43. With one exception, the statute has not been litigated at the appellate level in Minnesota since 1949. That case is State v. Anderson, 370 N.W.2d 653 (Minn. Ct.App.1985). Anderson, the mayor of Jordan, Minnesota, was convicted under Minn. Stat. § 609.43(2) of official misconduct for verbally harassing a Jordan family.
This court rejected Anderson's arguments that her speech was protected by the first amendment and that § 609.43(2) is unconstitutionally vague and overbroad. The court found Anderson's acts were done in her official capacity as mayor.
Anderson did not dispute that her acts were done in her official capacity. She argued that her position as mayor of Jordan, as well as the protection of the First Amendment, gave her authority to do certain acts.
Here appellant makes a different claim. He does not claim that in his official capacity as a vice-principal he had the right to make sexual contact with students, but instead claims that the sexual contacts he made, if any, were done in a purely private capacity and were legal because done with persons of the age of consent.
We note that even though we upheld § 609.43(2) against Anderson's attack of unconstitutional vagueness, the statute is not a model of clarity. Section 609.43(2) nowhere defines "acts done in excess of lawful authority," nor does it define what "law" must forbid the act, e.g. civil, criminal, administrative, school internal regulations, etc.
Case law interpreting § 609.43(2) includes the prosecution of officeholders and political appointees for willful neglect of duty. See State v. Palmersten, 210 Minn. 476, 299 N.W. 669 (1941). Little precedent exists to guide interpretation of its language as it applies to public employees charged with official misconduct who argue, as appellant does, that the complained of conduct was private, not in express violation of any known law, and not within the legislative intent of § 609.43(2).
*67 A recent Wisconsin case, State v. Schmit, 115 Wis.2d 657, 340 N.W.2d 752 (1983), factually similar to this case and interpreting an identically worded Wisconsin statute,[2] is persuasive.
Schmit, a prison guard at Dodge Correctional Institution, was charged with misconduct under Wis.Stat. § 946.43(2) (1984) for engaging in consensual intercourse with a prisoner. In affirming the dismissal of charges, the Wisconsin Supreme Court distinguished between a public employee's official acts and acts done in a purely private capacity:
Although the meaning of the statute is far from clear, it requires on its face more than a mere violation of the criminal code by a public official. It requires both that the officer commit the act in an official capacity, and that the act be one which he is forbidden by law to do in an official capacity. We think this dual requirement of the statute evinces a legislative intention to confine the application of the statute to acts committed within the scope of public employment. The purpose of the law appears to be the prevention of the misuse of power entrusted to public officers, rather than the imposition of an additional penalty for conduct which is forbidden to all persons generally when that conduct is committed by a public officer or employee.
Schmit, 115 Wis.2d at 660, 340 N.W.2d at 754 (emphasis in original).
We agree that for an act to come within the narrow confines of Minnesota's statute, § 609.43(2) three tests must be met. The act must be done by a public officer or employee, the act must be committed while the defendant is acting in his official capacity as a public officer or employee, and either must be forbidden by law or be in excess of his lawful authority.
Here, although appellant is a public employee, the mere fact that he was on duty at the time of some of the alleged acts does not alone transform the questioned act into acts done "in his official capacity."
We adopt the distinction between purely private acts and acts done in an official capacity in United States v. Heliczer, 373 F.2d 241, 245 (2d Cir.), cert. den. 388 U.S. 917, 87 S.Ct. 2133, 18 L.Ed.2d 1359 (1967):
"Engaged in * * * performance of official duties" is simply acting within the scope of what the agent is employed to do. The test is whether the agent is acting within that compass or is engaging in a personal frolic of his own.
Although the allegations against appellant may be morally reprehensible and offensive, the State has not pointed to any criminal law specifically forbidding school teachers to have sexual contact with students of the age of consent.[3] The State has failed to make the necessary allegations to charge appellant with violating § 609.43(2). We have found nothing in Minnesota statutes or case law indicating a legislative intent to criminalize consensual sexual relations between persons of the age of consent merely because one of the participants happens to be a public employee.
In addition to failing to allege acts forbidden by a law, the State has failed to allege in the complaint that appellant violated any civil law or administrative rule, assuming that "forbidden by law" includes forbidden by administrative rule (and that distinction, as previously noted, is not clear *68 from the statute). Thus, the complaint is facially defective.
We hold that the State did not allege conduct sufficient to charge appellant with violating Minn.Stat. § 609.43(2). Therefore, the trial court erred in not granting appellant's motion to dismiss.
Our rationale is similar to Schmit:
There is no suggestion in the record that the defendant utilized the power of her office in any manner when she had intercourse with the prisoner, or that she committed those acts in any other than a "purely private capacity." There is no suggestion, for instance, that she threatened sanctions or offered benefits within her power as a public officer to bestow or withhold in order to obtain the prisoner's consent to the acts.
Schmit, 115 Wis.2d at 662, 340 N.W.2d at 755.
The allegations that appellant turned his head and allowed the students to smoke on school property and leave the school grounds during school hours are not sufficient to show coercion. Students do not need the acquiesence of school officials to get away with breaking regulations like those. Had appellant agreed to or threatened to change a student's grades or write letters to colleges that would result in a student's being deprived of admission or a scholarship in exchange for sex, the result may have been different as these acts could be interpreted as acts performed in an official capacity.
We hold that as a matter of statutory interpretation, the trial court did not have facts presented to it sufficient for the criminal activity under Minn.Stat. 609.43(2).

II.

Plea agreement
Because of our disposition of the statutory interpretation issue, we do not address the claim that the plea bargain was violated.

DECISION
The trial court erred in finding the State properly alleged criminal activity under Minn.Stat. § 609.43(2).
Reversed.
CRIPPEN, J., specially concurs.
CRIPPEN, Judge (concurring specially).
I believe the panel has correctly analyzed the scope of Minnesota Statutes section 609.43, subdivision 2 and therefore concur in the majority opinion. At this stage of the proceedings, however, I would decide that the trial court erred in denying the defendant's motion to withdraw his plea of guilty.
The defendant and the prosecutor reached a plea agreement. It is apparent that defendant expected under this agreement a recommendation from the prosecutor against further incarceration.
The prosecutor's plea agreement did not call for a formal hypocrisy, the statement of a recommendation and the informal revealing of a different opinion. Once the prosecutor stated to the trial judge an official disavowal of the plea agreement, the agreement was irrevocably withdrawn and wholly void.
The trial court attempted to attribute some significance to the original plea agreement after it was voided by the declarations of the prosecutor. This was an error. The trial court's statements about the agreement could do nothing but mislead the defendant, suggesting to him that the prosecutor's commitment to recommend against incarceration was of some continued significance. The agreement had no continued significance, and the trial court should have said to the defendant that this was the case.
When a plea agreement is set aside by the court, "it shall so advise the parties in open court and then call upon the defendant to either affirm or withdraw his plea." Minn.R.Crim.P. 15.04, subd. 3(1). Here the agreement was set aside by the prosecutor, and the trial court should have used the same approach called for by this rule, not *69 an approach that could mislead the defendant.
Under these circumstances, the conviction was manifestly unjust. The defendant is entitled to withdraw his plea and to enjoy a trial on any accusations against him. Minn.R.Crim.P. 15.05, subd. 1.
NOTES
[1]  Respondent claims the State had to prosecute appellant under 609.43, subds. 2 and 3 because no other criminal statute makes sexual relations with a consenting person, legally of age, a crime. We note the existence of Minn.Stat. § 609.344(e) (1984) which provides for criminal penalties when the complainant is at least sixteen but less than eighteen and the actor is more than 48 months older than the complainant, is in a position of authority, and uses that authority to cause the complainant to submit. Under 609.344(e), neither consent nor mistake as to complainant's age are a defense. Because the State did not pursue such a charge under § 609.344(e), we do not address it here.
[2]  The material portion of Wis.Stat.Ann. § 946.12 (West 1982) provides:

Any public officer or public employe who does any of the following is guilty of a Class E felony:
* * * * * *
(2) In his capacity as such officer or employe, does an act which he knows is in excess of his lawful authority or which he knows he is forbidden by law to do in his official capacity.
[3]  In August the Minnesota State Board of Teaching revoked appellant's licenses to teach history full-time and speech part-time. In September, the Minnesota State Board of Teaching revoked appellant's licenses to act as a principal of a secondary school or superintendent of schools. We do not address any civil ramifications of appellant's actions nor his fitness to teach.