* @type {boolean}
     * @name pc.platform.windows
     * @description If it is Windows.
     */
    windows: false,

    /**
     * @static
     * @readonly
     * @type {boolean}
     * @name pc.platform.xbox
     * @description If it is Xbox.
     */
    xbox: false,

    /**
     * @static
     * @readonly
     * @type {boolean}
     * @name pc.platform.gamepads
     * @description If platform supports gamepads.
     */
    gamepads: false,

    /**
     * @static
     * @readonly
     * @type {boolean}
     * @name pc.platform.touch
     * @description If platform supports touch input.
     */
    touch: false,

    /**
     * @static
     * @readonly
     * @type {boolean}
     * @name pc.platform.workers
     * @description If the platform supports Web Workers.
     */
    workers: false,
};

if (typeof navigator!== 'undefined') {
    var ua = navigator.userAgent;

    if (/(windows|mac os|linux|cros)/i.test(ua))
        platform.desktop = true;

    if (/xbox/i.test(ua))
        platform.xbox = true;

    if (/(windows phone|iemobile|wpdesktop)/i.test(ua)) {
        platform.desktop = false;
        platform.mobile = true;
        platform.windows = true;
    } else if (/android/i.test(ua)) {
        platform.desktop = false;
        platform.mobile = true;
        platform.android = true;
    } else if (/ip([ao]d|hone)/i.test(ua)) {
        platform.desktop = false;
        platform.mobile = true;
        platform.ios = true;
    }

    if (typeof window!== 'undefined') {
        platform.touch = 'ontouchstart' in window || ('maxTouchPoints' in navigator && navigator.maxTouchPoints > 0);
    }

    platform.gamepads = 'getGamepads' in navigator;

    platform.workers = (typeof(Worker)!== 'undefined');
}

export { platform };<reponame>moewes/openRecruiting
package org.openrecruiting.ui.services;

import com.vaadin.cdi.annotation.VaadinServiceEnabled;
import com.vaadin.cdi.annotation.VaadinServiceScoped;
import com.vaadin.flow.i18n.I18NProvider;

import javax.annotation.PostConstruct;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Logger;

@VaadinServiceEnabled
@VaadinServiceScoped
public class LocaliseService implements I18NProvider {

  private final Locale LOCALE_DE = new Locale("de", "DE");
  private final Locale LOCALE_EN = new Locale("en", "GB");

  private final List<Locale> locales = Collections
         .unmodifiableList(Arrays.asList(LOCALE_DE, LOCALE_EN));

  private final Map<Locale, ResourceBundle> bundles = new HashMap<>();

  @PostConstruct
  public void init() {

    for (Locale locale:locales) {
      bundles.put(locale,readProperties(locale));
    }
  }

  @Override
  public List<Locale> getProvidedLocales() {
    return locales;
  }

  @Override
  public String getTranslation(String key, Locale locale, Object... params) {

    ResourceBundle resourceBundle = bundles.get(locale);

    String value;
    try {
      value = resourceBundle.getString(key);
    } catch (MissingResourceException e) {
      value = "<" + key + ">" + locale.getLanguage();
    }

      if (params.length > 0) {
        value = MessageFormat.format(value, params);
      }

    return value;
  }

  private ResourceBundle readProperties(final Locale locale) {
    final ClassLoader cl = LocaliseService.class.getClassLoader();

    ResourceBundle propertiesBundle = null;
    try {
      propertiesBundle = ResourceBundle.getBundle("openRecruiting", locale,
              cl);
    } catch (final MissingResourceException e) {
      Logger.getLogger(LocaliseService.class.getName())
             .info("Missing resource");
              e.printStackTrace();
    }
    return propertiesBundle;
  }
}
Sorry for the late post everyone. I had my first Spanish class today, it went really well and now everyday I will have a 2 hour lesson. But dont worry – I will be posting before class each day so you can get your morning fix.
Anyway. Yesterday was probably one of the best day’s I have had in Barcelona so far. Dan woke me up with a lovely cup of tea and the sun was pouring in through the bedroom window. We scheduled to meet some friends for brunch at eleven so we just took our time getting ready and then walked the short distance into the old town.
Our friends had suggested we meet at Milk in Gotico and we had no idea what to expect. Milk is an uber cool but very chilled bistro that specialises in recovery brunches. I ordered the most amazing Eggs Benedict I have ever eaten and Dan had their full brunch.
Afterward we took a stroll along Palau De Mar and stopped in at the Museu d’Historia de Catalunya but not for the history. Riding the lift up to the roof we had no idea where our friends were taking us. We got out of the lift and walked onto a huge, sun drenched terrace with elegant white wicker furniture. I had no idea this gorgeous place even existed. We ordered Estrella Inedit (a delicious beer) and sat and watched the world go by. Seriously guys, this place is a must see!
Dan and I ended our blissful day on the beach with a coffee and the sound of the waves. I really do have to pinch myself sometimes.
Tetrahydrocannabinol (THC): this is a primary psychoactive ingredient of cannabis that causes many of the feelings of being high.
Cannabidiol (CBD): this is a non-psychoactive compound, meaning that it does not induce the highs associated with cannabis.
Cannabidiol oil (CBD) is legally available as an over the counter supplement in the UK with a restricted maximum THC content of 0.2%. CBD oil should be distinguished from high-CBD strains of medical marijuana, which contains larger percentages of THC. CBD is not a licenced medicine and therefore only can be sold as long as claims are not made about its medical benefits.
However, CBD is marketed by the producers for a variety of medical and psychological conditions, including insomnia. Cannabis has long been used recreationally to aid sleep. It is frequently presented as a “healthier and more natural” alternative to prescription medication. It is also advertised as “having fewer side effects”.
With the legislation around cannabis use changing rapidly, cannabidiol oil (CBD) is becoming an in­creasingly popular over-the-counter pharmacological treatment of sleep issues. The question of whether it can help with sleep is becoming ever more critical.
Research on the impact of cannabis on sleep started in the 1970s and but high-quality studies are lacking because of the drug’s legal status. Absolute majority of clinical research on the effect of cannabinoids on sleep involved the whole cannabis plant, THC components and synthetic THC.
These studies produced mixed results. Some papers reported faster sleep initiation (Cousens and DiMascio, 1973) or reduced time of awakening in the middle of the night (Pivik et al., 1972). However, other studies did not observed the same effect ((Feinberg et al., 1975, Feinberg et al., 1976, Barratt et al., 1974). It would be worth noting that these studies are old. They were conducted such a long time ago, when robust methodology expected in modern scientific research was not followed.
Some newer studies, which reported positive finding, were conducted with financial support a pharmaceutical company producing medical cannabis (Nicholson et al., 2004, Russo et al., 2007). Such studies, therefore, might be biased.
Few studies, which reported sleep improvement following cannabis administration, were done in very special populations groups, such as patients with chronic pain, fibromyalgia or multiple sclerosis (Wade et al., 2003, Wade et al., 2006, Notcutt et al., 2004, Rog et al., 2005). It is possible, that in these patients sleep improvement was related to the reduction of pain intensity. The results therefore can not be generalised to the population with primary sleep problems, such as insomnia.
Clinical research investigating the effect of CBD in insomnia is very limited. A series of experiments with CBD were performed in Brazil comparing different doses of CBD to placebo and old-fashioned hypnotic nitrazepam in 15 people with insomnia (