Examples of Forecast


Examples of com.google.api.ads.dfp.v201311.Forecast

    // Set the line item to get a forecast for.
    Long lineItemId = Long.parseLong("INSERT_LINE_ITEM_ID_HERE");

    // Get forecast for line item.
    Forecast forecast = forecastService.getForecastById(lineItemId);

    // Display results.
    long matched = forecast.getMatchedUnits();
    double availablePercent = (forecast.getAvailableUnits() / (matched * 1.0)) * 100;
    String unitType = forecast.getUnitType().toString().toLowerCase();

    System.out.println(matched + " " + unitType + " matched.\n"
        + availablePercent + "% " + unitType + " available.");

    if (forecast.getPossibleUnits() != null) {
      double possiblePercent = (forecast.getPossibleUnits() / (matched * 1.0)) * 100;
      System.out.println(possiblePercent + "% " + unitType + " possible.\n");
    }
  }
View Full Code Here

Examples of com.openhouseautomation.model.Forecast

      XPathExpression exprmin =
          xpath.compile("/dwml/data/parameters/temperature[@type='minimum']/value[1]");
      String minimum = (String) exprmin.evaluate(doc, XPathConstants.STRING);
      // update datastore
      Forecast forecast = ofy().load().type(Forecast.class).id(zipcode).now();
      if (forecast == null) {
          forecast = new Forecast();
          forecast.setZipCode(zipcode);
      }
      forecast.setForecastLow(minimum);

      XPathExpression exprmax =
          xpath.compile("/dwml/data/parameters/temperature[@type='maximum']/value[1]");
      String maximum = (String) exprmax.evaluate(doc, XPathConstants.STRING);
      forecast.setForecastHigh(maximum);
     
      XPathExpression exprpop =
          xpath.compile("/dwml/data/parameters/probability-of-precipitation[@type='12 hour']/value[1]");
      String pop = (String) exprpop.evaluate(doc, XPathConstants.STRING);
      forecast.setForecastPop(pop);
      forecast.setLastUpdate(new Date());
     
      log.log(Level.INFO, "forecast cron took " + (System.currentTimeMillis() - curtime) + "ms");
      ofy().save().entity(forecast).now();
      out.println(forecast);
    } catch (Exception e) {
View Full Code Here

Examples of com.openhouseautomation.model.Forecast

      String zipcode = request.getParameter("k");
      if (zipcode == null || "".equals(zipcode)) {
        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Missing zipcode (k=?)");
        return;
      }
      Forecast forecast = ofy().load().type(Forecast.class).id(zipcode).now();
      if (forecast == null) {
        response.sendError(HttpServletResponse.SC_NOT_FOUND,
            "I don't have information for that zip code");
        return;
      }
      String param = request.getParameter("v");
      if (null == param || "".equals(param)) {
        response.sendError(HttpServletResponse.SC_NOT_FOUND, "Use a param: {high,low,pop,all}");
        return;
      }
      if ("forecasthigh".equals(param)) {
        out.println(forecast.getForecastHigh());
      }
      if ("forecastlow".equals(param)) {
        out.println(forecast.getForecastLow());
      }
      if ("forecastpop".equals(param)) {
        out.println(forecast.getForecastPop());
      }
      if ("forecastall".equals(param)) {
        out.println("high=" + forecast.getForecastHigh());
        out.println("low=" + forecast.getForecastLow());
        out.println("pop=" + forecast.getForecastPop());
        out.println("last update=" + forecast.getLastUpdate().getTime() / 1000);
        out.println("last update(human)=" + forecast.getLastUpdate());
      }
    }
  }
View Full Code Here

Examples of com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation.Forecast

    //handled by some other class say, WeatherStationSetUp
    //That class would get the displays to be used, and add them a list
    //as I've done, and pass that list to this program
   
    Display firstDisplay = new Display(new CurrentConditions(weatherData));
    Display secondDisplay = new Display(new Forecast(weatherData));
    displaysToUse.add(firstDisplay.getCurrentDisplay());
    displaysToUse.add(secondDisplay.getCurrentDisplay());
    weatherData.addDisplay(displaysToUse);
   
    weatherData.setMeasurements(80, 65, 30.4f);
View Full Code Here

Examples of com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation.Forecast

   
    //And the books implementation of the Observer method is not as flexible as mine
    //You can't select what displays to show beforehand, it just displays what is programmed in
   
    CurrentConditions currentDisplay = new CurrentConditions(weatherData);
    Forecast forecastDisplay = new Forecast(weatherData);
    weatherData.setMeasurements(80, 65, 30.4f);
    weatherData.setMeasurements(82, 70, 29.2f);
    weatherData.setMeasurements(78, 90, 29.2f);
   
    weatherData.deleteObserver(currentDisplay);
View Full Code Here

Examples of org.boris.expr.function.excel.FORECAST

        FISHERNV f = new FISHERNV();
        fail("FISHERNV not implemented");
    }

    public void testFORECAST() throws Exception {
        FORECAST f = new FORECAST();
        assertEquals(eval(f, 30, toArray(6, 7, 9, 15, 21), toArray(20, 28, 31,
                38, 40)), 10.6072530864198);
    }
View Full Code Here

Examples of org.rometools.feed.module.yahooweather.types.Forecast

        if(weather.getForecasts() != null) {
            for(int i = 0; i < weather.getForecasts().length; i++) {
                Element forecast = new Element("forecast",
                        WeatherModuleGenerator.NS);
                Forecast f = weather.getForecasts()[i];

                if(f.getCode() != null) {
                    forecast.setAttribute("code",
                        Integer.toString(f.getCode().getCode()));
                }

                if(f.getDate() != null) {
                    forecast.setAttribute("date", SHORT_DATE.format(f.getDate()));
                }

                if(f.getDay() != null) {
                    forecast.setAttribute("day", f.getDay());
                }

                if(f.getText() != null) {
                    forecast.setAttribute("text", f.getText());
                }

                forecast.setAttribute("high", Integer.toString(f.getHigh()));
                forecast.setAttribute("low", Integer.toString(f.getLow()));
                element.addContent(forecast);
            }
        }
    }
View Full Code Here

Examples of org.rometools.feed.module.yahooweather.types.Forecast

            for(Iterator it = forecasts.iterator(); it.hasNext(); i++) {
                Element forecast = (Element) it.next();

                try {
                    f[i] = new Forecast(forecast.getAttributeValue("day"),
                            SHORT_DATE.parse(forecast.getAttributeValue("date")),
                            Integer.parseInt(forecast.getAttributeValue("low")),
                            Integer.parseInt(forecast.getAttributeValue("high")),
                            forecast.getAttributeValue("text"),
                            ConditionCode.fromCode(Integer.parseInt(
View Full Code Here

Examples of solysombra.shared.domain.wwo.Forecast

    // http://api.worldweatheronline.com/free/v1/weather.ashx?key=xhfhyuvuvegtfs2juvcstyjr&q=48.85,2.35&fx=no&format=json
    String uri = "http://api.worldweatheronline.com/free/v1/weather.ashx?key="
        + WWO_API_KEY + "&q=" + lat + "," + lon + "&fx=no&format=json";
    System.out.println(uri);
    ClientResource cr = new ClientResource(uri);
    Forecast res = cr.get(Forecast.class);
    return res;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.