Examples of Program


Examples of Program.Program

                error.setLength(0);
                res = -1;
                if (fillData(rs)) { // заполнить необходимые данные
                    if (setInProcessStatus()) { // установить статус "обрабатывается"
                        if (Problems.getInstance().contains(problemId)) { // если соответствующая задача найдена
                            Program p = new Program( // создать экземпляр программы
                                    langId, programtext,
                                    Problems.getInstance().getProblemById(problemId));
                            if (createProgram(p)) { // создать необходимые файлы на диске
                                if (compileProgram(p)) { // компилировать программу
                                    if (testProgram(p)) { // тестировать программу
                                        res = ExitCodes.SUCCESS; // тесты пройдены
                                        comment.append(ExitCodes.getMsg(ExitCodes.SUCCESS));
                                    } // ошибка при тестировании программы
                                } // ошибка при компиляции программы
                                p.close(); // удаляем созданные файлы
                            } // ошибка при создании необходимых файлов
                        } else { // задача не найдена
                            comment.append(ExitCodes.getMsg(ExitCodes.INTERNAL_ERROR));
                            error.append("Problem not found :-(");
                            res = ExitCodes.INTERNAL_ERROR;
View Full Code Here

Examples of aQute.service.library.Library.Program

    if (target.length == 0)
      return getRepositoryActions();

    final String bsn = (String) target[0];
    Program careful = null;

    if (connected)
      try {
        careful = getProgram(bsn, true);
      }
      catch (Exception e) {
        reporter.error("Offline? %s", e);
      }

    final Program p = careful;
    if (target.length == 1)
      return getProgramActions(bsn, p);

    if (target.length >= 2) {
      final Version version = (Version) target[1];
View Full Code Here

Examples of ast.Program

    Parser parser = new Parser();
    try {
      List<Module> modules = new List<Module>();
      for(String src : srcs)
        modules.add((Module)parser.parse(new Lexer(new StringReader(src))));
      Program prog = new Program(modules);
      prog.namecheck();
      if(!prog.hasErrors()) prog.typecheck();
      if(succeed) {
        if(prog.hasErrors()) {
          StringBuffer errors = new StringBuffer();
          for(CompilerError err : prog.getErrors())
            errors.append("\n" + err);
          fail("Program was expected to pass semantic checks, but the following " +
             "errors were reported:" + errors);
        }
      } else if(!prog.hasErrors()) {
        fail("Program was expected to fail semantic checks, but passed.");
      }
    } catch (Throwable e) {
      if(e instanceof AssertionError) {
        throw (AssertionError)e;
View Full Code Here

Examples of avrora.core.Program

            simulator.delay(startup);
        }

        private void updateNodeID() {
            if ( UPDATE_NODE_ID.get() ) {
                Program p = path.getProgram();
                SourceMapping smap = p.getSourceMapping();
                SourceMapping.Location location = smap.getLocation("TOS_LOCAL_ADDRESS");
                if ( location == null ) location = smap.getLocation("node_address");
                if ( location != null ) {
                    BaseInterpreter bi = simulator.getInterpreter();
                    bi.writeFlashByte(location.address, Arithmetic.low(id));
View Full Code Here

Examples of co.cask.cdap.app.program.Program

      final File destinationUnpackedJarDir = new File(tmpDir, String.format("%s.%s",
                                                                      program.getName(), UUID.randomUUID().toString()));
      Preconditions.checkState(!destinationUnpackedJarDir.exists());
      destinationUnpackedJarDir.mkdirs();

      Program bundleJarProgram = Programs.createWithUnpack(program.getJarLocation(), destinationUnpackedJarDir);
      RuntimeInfo info = super.run(bundleJarProgram, options);
      info.getController().addListener(new AbstractListener() {
        @Override
        public void stopped() {
          try {
View Full Code Here

Examples of co.cask.tigon.app.program.Program

  }

  @Override
  public void startFlow(File jarPath, String className, Map<String, String> userArgs) {
    try {
      Program program = deployClient.createProgram(jarPath, className, jarUnpackDir);
      String flowName = program.getSpecification().getName();
      if (listAllFlows().contains(flowName)) {
        throw new Exception("Flow with the same name is running! Stop or Delete the Flow before starting again");
      }

      Location jarInHDFS = location.append(flowName);
      //Delete any existing JAR with the same flowName.
      jarInHDFS.delete();
      jarInHDFS.createNew();

      //Copy the JAR to HDFS.
      ByteStreams.copy(Locations.newInputSupplier(program.getJarLocation()), Locations.newOutputSupplier(jarInHDFS));
      //Start the Flow.
      deployClient.startFlow(program, userArgs);
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
    }
View Full Code Here

Examples of com.google.minijoe.compiler.ast.Program

  public static void compile(String input, OutputStream os) throws CompilerException, IOException {
    Lexer lexer = new Lexer(input);
    Parser parser = new Parser(lexer);

    Program program = parser.parseProgram();

    if (Config.DEBUG_SOURCE) {
      Writer w = new OutputStreamWriter(System.out);
      new RoundtripVisitor(w).visit(program);
      w.flush();
View Full Code Here

Examples of com.zaranux.os.client.core.Program

   
  }
 
  public Program getProgram()
  {
    Program program = null;
      if(isExecutable())
      {
        Log.debug("Executing " + absolutePath);
        String[] args = new String[1];
        args[0] = absolutePath;
View Full Code Here

Examples of de.willuhn.jameica.gui.internal.action.Program

            GUI.getDisplay().asyncExec(new Runnable() {
              public void run()
              {
                try
                {
                  new Program().handleAction(file);
                }
                catch (ApplicationException ae)
                {
                  Application.getMessagingFactory().sendMessage(new StatusBarMessage(ae.getLocalizedMessage(),StatusBarMessage.TYPE_ERROR));
                }
View Full Code Here

Examples of devplugin.Program

    int remainingMinutesMax = 0;

    ArrayList<ProgramPanel> panels = new ArrayList<ProgramPanel>(reminders.size());

    for (ReminderListItem reminder : reminders) {
      Program program = reminder.getProgram();
      mGlobalReminderList.blockProgram(program);
      // text label
      String msg;
      final int progMinutesAfterMidnight = program.getStartTime();
      int remainingMinutes = 0;
      if (today.compareTo(program.getDate()) >= 0
          && IOUtilities.getMinutesAfterMidnight() > progMinutesAfterMidnight) {
        msg = updateRunningTime();
      } else {
        msg = mLocalizer.msg("soonStarts", "Soon starts");
        remainingMinutes = ReminderPlugin.getTimeToProgramStart(program);
      }
      mHeader.setText(msg);
      remainingMinutesMax = Math.max(remainingMinutesMax, remainingMinutes);

      List<JComponent> componentList = new ArrayList<JComponent>();
      mComponents.put(reminder, componentList);

      final ProgramPanel panel = new ProgramPanel(program,
          new ProgramPanelSettings(new PluginPictureSettings(
              PluginPictureSettings.ALL_PLUGINS_SETTINGS_TYPE), false,
              ProgramPanelSettings.X_AXIS));
      componentList.add(panel);
      panels.add(panel);
      panel.setMinimumSize(new Dimension(300,50));
      panel.setWidth(300);
      // register panel with tooltip manager
      panel.setToolTipText("");
      panel.addPluginContextMenuMouseListener(ReminderPluginProxy
          .getInstance());

      final JPanel channelPanel = new JPanel(new BorderLayout());
      componentList.add(channelPanel);
      if (program.getLength() > 0) {
        final JLabel endTime = new JLabel(mLocalizer.msg("endTime",
            "until {0}", program.getEndTimeString()));
        channelPanel.add(endTime, BorderLayout.PAGE_START);
      }
      String channelName = program.getChannel().getName();
      JLabel channelLabel = new JLabel();
      channelLabel.setToolTipText(channelName);
      channelLabel.setIcon(UiUtilities.createChannelIcon(program.getChannel()
          .getIcon()));
      channelLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
      channelPanel.add(channelLabel, BorderLayout.CENTER);
      channelLabel = new JLabel(channelName);
      channelPanel.add(channelLabel, BorderLayout.PAGE_END);
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.