Input:
  public BwFreeBusy getFreeBusy(BwCalendar cal,
                                String account,
                                BwDateTime start,
                                BwDateTime end) throws WebdavException {
    try {
      String serviceName = getServiceName(cal.getPath());
      DominoInfo di = serversInfo.get(serviceName);
      if (di == null) {
        throw WebdavIntfException.badRequest();
      }
      DavReq req = new DavReq();
      req.setMethod("GET");
      req.setUrl(di.getUrlPrefix() + "/" +
                 cal.getOwner().getAccount() + "?" +
                 "start-min=" + makeDateTime(start) + "&" +
                 "start-max=" + makeDateTime(end));
      req.addHeader("Accept",
                    "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
      req.addHeader("Accept-Language", "en-us,en;q=0.7,es;q=0.3");
      req.addHeader("Accept-Encoding", "gzip,deflate");
      req.addHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
      DavResp resp = send(req, di);
      String vfb = makeVfb(new InputStreamReader(resp.getContentStream()));
      if (debug) {
        debugMsg(vfb);
      }
      Icalendar ic = trans.fromIcal(null, new StringReader(vfb));
      TreeSet<Period> periods = new TreeSet<Period>();
      Iterator fbit = ic.iterator();
      while (fbit.hasNext()) {
        Object o = fbit.next();
        if (o instanceof BwFreeBusy) {
          BwFreeBusy fb = (BwFreeBusy)o;
          Collection<BwFreeBusyComponent> times = fb.getTimes();
          if (times != null) {
            for (BwFreeBusyComponent fbcomp: times) {
              if (fbcomp.getType() != BwFreeBusyComponent.typeFree) {
                throw WebdavIntfException.serverError();
              }
              for (Period p: fbcomp.getPeriods()) {
                periods.add(p);
              }
            }
          }
        }
      }
      BwFreeBusy fb = new BwFreeBusy();
      fb.setStart(start);
      fb.setEnd(end);
      BwFreeBusyComponent fbcomp = new BwFreeBusyComponent();
      fb.addTime(fbcomp);
      fbcomp.setType(BwFreeBusyComponent.typeBusy);
      DateTime bstart = (DateTime)start.makeDate();
      Iterator pit = periods.iterator();
      while (pit.hasNext()) {
        Period p = (Period)pit.next();
        if (!bstart.equals(p.getStart())) {
          Period busyp = new Period(bstart, p.getStart());
          fbcomp.addPeriod(busyp);
        }
        bstart = p.getEnd();
      }
      DateTime bend = (DateTime)end.makeDate();
      if (!bstart.equals(bend)) {
        Period busyp = new Period(bstart, bend);
        fbcomp.addPeriod(busyp);
      }
      return fb;
    } catch (WebdavIntfException wie) {
      throw wie;
    } catch (Throwable t) {
      throw new WebdavIntfException(t);
    }
  }

Output:
  public BwFreeBusy getFreeBusy(BwCalendar cal,
                                String account,
                                BwDateTime start,
                                BwDateTime end) throws WebdavException {
    try {
      String serviceName = getServiceName(cal.getPath());
      DominoInfo di = serversInfo.get(serviceName);
      if (di == null) {
        throw WebdavIntfException.badRequest();
      }
      DavReq req = new DavReq();
      req.setMethod("GET");
      req.setUrl(di.getUrlPrefix() + "/" +
                 cal.getOwner().getAccount() + "?" +
                 "start-min=" + makeDateTime(start) + "&" +
                 "start-max=" + makeDateTime(end));
      req.addHeader("Accept",
                    "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
      req.addHeader("Accept-Language", "en-us,en;q=0.7,es;q=0.3");
      req.addHeader("Accept-Encoding", "gzip,deflate");
      req.addHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
      DavResp resp = send(req, di);
      String vfb = makeVfb(new InputStreamReader(resp.getContentStream()));
      if (debug) {
        debugMsg(vfb);
      }
      Icalendar ic = trans.fromIcal(null, new StringReader(vfb));
      TreeSet<Period> periods = new TreeSet<Period>();
      Iterator fbit = ic.iterator();
      while (fbit.hasNext()) {
        Object o = fbit.next();
        if (o instanceof BwFreeBusy) {
          BwFreeBusy fb = (BwFreeBusy)o;
          Collection<BwFreeBusyComponent> times = fb.getTimes();
          if (times != null) {
            for (BwFreeBusyComponent fbcomp: times) {
              if (fbcomp.getType() != BwFreeBusyComponent.typeFree) {
                throw WebdavIntfException.serverError();
              }
              for (Period p: fbcomp.getPeriods()) {
                periods.add(p);
              }
            }
          }
        }
      }
      BwFreeBusy fb = new BwFreeBusy();
      fb.setDtstart(start);
      fb.setDtend(end);
      BwFreeBusyComponent fbcomp = new BwFreeBusyComponent();
      fb.addTime(fbcomp);
      fbcomp.setType(BwFreeBusyComponent.typeBusy);
      DateTime bstart = (DateTime)start.makeDate();
      Iterator pit = periods.iterator();
      while (pit.hasNext()) {
        Period p = (Period)pit.next();
        if (!bstart.equals(p.getStart())) {
          Period busyp = new Period(bstart, p.getStart());
          fbcomp.addPeriod(busyp);
        }
        bstart = p.getEnd();
      }
      DateTime bend = (DateTime)end.makeDate();
      if (!bstart.equals(bend)) {
        Period busyp = new Period(bstart, bend);
        fbcomp.addPeriod(busyp);
      }
      return fb;
    } catch (WebdavIntfException wie) {
      throw wie;
    } catch (Throwable t) {
      throw new WebdavIntfException(t);
    }
  }


Input:
    public static void copyExtendedInfo(ModelItem[] items) {
        if (items == null && items.length == 0) {
            return;
        }
        String keyNotAvailableMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.keyNotAvailableYet");
        String fileMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.file")+" ";
        String keyMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.key")+" ";
        String bytesMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.bytes")+" ";
        StringBuilder textToCopy = new StringBuilder();
        CopyToClipboardItem item;
        for (ModelItem ditem : items) {
            if( !(ditem instanceof CopyToClipboardItem) ) {
                continue;
            }
            item = (CopyToClipboardItem) ditem;
            String key = item.getKey();
            if (key == null) {
                key = keyNotAvailableMessage;
            } else {
                key = key + item.getFilename();
            }
            String fs;
            if( item.getFileSize() < 0 ) {
                fs = "?";
            } else {
                fs = Long.toString(item.getFileSize());
            }
            textToCopy.append(fileMessage);
            textToCopy.append(item.getFilename()).append("\n");
            textToCopy.append(keyMessage);
            textToCopy.append(key).append("\n");
            textToCopy.append(bytesMessage);
            textToCopy.append(fs).append("\n\n");
        }
        textToCopy.deleteCharAt(textToCopy.length() - 1);
        StringSelection selection = new StringSelection(textToCopy.toString());
        getClipboard().setContents(selection, dummyClipboardOwner);
    }

Output:
    public static void copyExtendedInfo(ModelItem[] items) {
        if (items == null && items.length == 0) {
            return;
        }
        String keyNotAvailableMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.keyNotAvailableYet");
        String fileMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.file")+" ";
        String keyMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.key")+" ";
        String bytesMessage = Language.getInstance().getString("Common.copyToClipBoard.extendedInfo.bytes")+" ";
        StringBuilder textToCopy = new StringBuilder();
        CopyToClipboardItem item;
        for (ModelItem ditem : items) {
            if( !(ditem instanceof CopyToClipboardItem) ) {
                continue;
            }
            item = (CopyToClipboardItem) ditem;
            String key = item.getKey();
            if (key == null) {
                key = keyNotAvailableMessage;
            } else {
                key = new StringBuffer().append(key).append("/").append(item.getFilename()).toString();
            }
            String fs;
            if( item.getFileSize() < 0 ) {
                fs = "?";
            } else {
                fs = Long.toString(item.getFileSize());
            }
            textToCopy.append(fileMessage);
            textToCopy.append(item.getFilename()).append("\n");
            textToCopy.append(keyMessage);
            textToCopy.append(key).append("\n");
            textToCopy.append(bytesMessage);
            textToCopy.append(fs).append("\n\n");
        }
        textToCopy.deleteCharAt(textToCopy.length() - 1);
        StringSelection selection = new StringSelection(textToCopy.toString());
        getClipboard().setContents(selection, dummyClipboardOwner);
    }


Input:
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		HttpServletRequest req = (HttpServletRequest) request;
		HttpServletResponse resp = (HttpServletResponse) response;
		String uri = req.getRequestURI();
		if (!uri.contains("/servlet/admin/media/")) {
			chain.doFilter(request, response);
			return;
		}
		try {
			PhotoService photoService = getSpringContext().getBean("photoServiceImpl", PhotoServiceImpl.class);
			String path = uri.substring(uri.indexOf("/servlet/admin/media/") + "/servlet/admin/media/".length(), uri.length());
			String scalerType = SimpleServletRequestUtils.getStringParameter(req, "scalerType", null);
			int width = SimpleServletRequestUtils.getIntParameter(req, "width", 0);
			int hight = SimpleServletRequestUtils.getIntParameter(req, "hight", 0);
			byte[] photoStream = null;
			if (StringUtils.isBlank(scalerType)) {
				photoStream = photoService.getPhoto(path, width, hight);
			} else {
				try {
					PhotoScalerType photoScalerType = PhotoScalerType.valueOf(scalerType);
					photoStream = photoService.getPhoto(path, photoScalerType);
				} catch (Exception e) {
					photoStream = photoService.getPhoto(path, -1, -1);
				}
			}
			String suffix = path.substring(path.lastIndexOf(".") + 1, path.length());
			resp.setHeader("Cache-Control", "max-age=3600, must-revalidate");
			resp.setContentType("image/" + mimeTable.get(suffix.toUpperCase()));
			resp.setCharacterEncoding("UTF-8");
			ServletOutputStream out = resp.getOutputStream();
			out.write(photoStream);
			out.close();
			return;
		} catch (Exception ex) {
			logger.error("Can not find the media item[" + uri + "]", ex);
			chain.doFilter(request, response);
		}
	}

Output:
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		HttpServletRequest req = (HttpServletRequest) request;
		HttpServletResponse resp = (HttpServletResponse) response;
		String uri = req.getRequestURI();
		if (!uri.contains("/servlet/media/")) {
			chain.doFilter(request, response);
			return;
		}
		try {
			PhotoService photoService = getSpringContext().getBean("photoServiceImpl", PhotoServiceImpl.class);
			String path = uri.substring(uri.indexOf("/servlet/media/") + "/servlet/media/".length(), uri.length());
			String scalerType = SimpleServletRequestUtils.getStringParameter(req, "scalerType", null);
			int width = SimpleServletRequestUtils.getIntParameter(req, "width", 0);
			int hight = SimpleServletRequestUtils.getIntParameter(req, "hight", 0);
			byte[] photoStream = null;
			if (StringUtils.isBlank(scalerType)) {
				photoStream = photoService.getPhoto(path, width, hight);
			} else {
				try {
					PhotoScalerType photoScalerType = PhotoScalerType.valueOf(scalerType);
					photoStream = photoService.getPhoto(path, photoScalerType);
				} catch (Exception e) {
					photoStream = photoService.getPhoto(path, -1, -1);
				}
			}
			String suffix = path.substring(path.lastIndexOf(".") + 1, path.length());
			resp.setHeader("Cache-Control", "max-age=3600, must-revalidate");
			resp.setContentType("image/" + mimeTable.get(suffix.toUpperCase()));
			resp.setCharacterEncoding("UTF-8");
			ServletOutputStream out = resp.getOutputStream();
			out.write(photoStream);
			out.close();
			return;
		} catch (Exception ex) {
			logger.error("Can not find the media item[" + uri + "]", ex);
			chain.doFilter(request, response);
		}
	}


Input:
	public void create(KindletContext context) {
		this.ctx = context;
		this.root = ctx.getRootContainer();
		screenManager = KRepaintManager.getInstance();
		get_date();
		String[] crew_list = load_list(dir.concat("config/crew.csv"));
		Flight.init(crew_list);
		fmodel = new FlightModel(filename, save_date);
		try {
			Font menu_font = ctx.getUIResources().getFont(KFontFamilyName.MONOSPACE,14);
			Font table_font = ctx.getUIResources().getFont(KFontFamilyName.MONOSPACE,10);
			Font edit_font = ctx.getUIResources().getFont(KFontFamilyName.MONOSPACE,12);
			KMenu menu = new KMenu();
			menu.add("Save",new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					fmodel.save();
					KOptionPane.showMessageDialog(root,"Data Saved");
				}
			});
			menu.add("Sync",new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					fmodel.save();
					if(python("sync.py"))
						KOptionPane.showMessageDialog(root,"Sync Completed");
					else KOptionPane.showMessageDialog(root,"Sync Failed");
				}
			});
			menu.add("Update",new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					fmodel.save();
					if(python("update.py"))
						KOptionPane.showMessageDialog(root,"Update Completed");
					else KOptionPane.showMessageDialog(root,"Update Failed");
				}
			});
			ctx.setMenu(menu);
			logs_day_info = new JLabel(date.concat("   Flights: ")
					.concat(Integer.toString(fmodel.getFlightCount())));
			logs_day_info.setFont(menu_font);
			logs_day_info.setBorder(new LineBorder(Color.black));
			JPanel log = new JPanel(new BorderLayout());
			logs_cells = new JTable(fmodel);
			logs_cells.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION);
			logs_cells.setRowSelectionAllowed(true);
			logs_cells.setFont(table_font);
			logs_cells.setRowHeight(29);
			logs_cells.getColumnModel().getColumn(0).setPreferredWidth(50);
			logs_cells.getColumnModel().getColumn(1).setPreferredWidth(306);
			logs_cells.getColumnModel().getColumn(2).setPreferredWidth(130);
			logs_cells.getColumnModel().getColumn(3).setPreferredWidth(50);
			logs_cells.getColumnModel().getColumn(4).setPreferredWidth(50);
			logs_cells.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					switch(e.getButton()) {
						case Gestures.BUTTON_FLICK_NORTH :
						case Gestures.BUTTON_FLICK_WEST :
							fmodel.next_page();
							break;
						case Gestures.BUTTON_FLICK_SOUTH :
						case Gestures.BUTTON_FLICK_EAST :
							fmodel.prev_page();
							break;
						case Gestures.BUTTON_HOLD :
							Point p = e.getPoint();
							int row = logs_cells.rowAtPoint(p);
							int col = logs_cells.columnAtPoint(p);
							int flight_num = Integer.parseInt((String)logs_cells.getValueAt(row,0));
							flight = (Flight)fmodel.fdata.get(flight_num-1);
							flight_backup = flight.toString();
							switch(col) {
								case 0 :
									StringBuffer to_del = new StringBuffer();
									to_del.append(Integer.toString(flight_num)).append(" ?\n");
									to_del.append(' ').append(flight.name).append('\n');
									to_del.append(' ').append(flight.notes).append('\n');
									to_del.append(' ').append(flight.getAltstr()).append('\n');
									to_del.append(' ').append(new String(flight.work));
									int result = KOptionPane.showConfirmDialog(root,
											"Save A copy of flight #".concat(to_del.toString()),
											"Duplication Confirmation",
											KOptionPane.CANCEL_SAVE_OPTIONS);
									if(result!=KOptionPane.CANCEL_OPTION) {
										fmodel.addFlight((Flight)fmodel.fdata.get(flight_num-1));
										screenManager.repaint(root,false);
										break;
									}
									result = KOptionPane.showConfirmDialog(root,
											"**Delete** flight #".concat(to_del.toString()),
											"Deletion Confirmation",
											KOptionPane.NO_YES_OPTIONS);
									if(result==KOptionPane.YES_OPTION) {
										fmodel.remove(flight_num);
										update_log();
									}
									break;
								case 1 :
									get_name(false);
									break;
								case 2 :
								case 3 :
								case 4 :
									get_other(false);
									break;
								default :
							}
							break;
						case Gestures.BUTTON_GROW :
						case Gestures.BUTTON_SHRINK :
						case Gestures.BUTTON_TAP :
					}
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			logs_cells.getTableHeader().setBorder(new LineBorder(Color.black));
			log.add(logs_cells.getTableHeader(),BorderLayout.NORTH);
			log.add(logs_cells,BorderLayout.CENTER);
			JButton tandem = new JButton("Add Tandem");
			tandem.setFont(menu_font);
			tandem.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					int row = fmodel.fdata.indexOf(flight);
					switch(e.getButton()) {
						case Gestures.BUTTON_HOLD :
							int pos = fmodel.fdata.size()-1;
							while(pos>=0) {
								Flight cur = (Flight)fmodel.fdata.get(pos--);
								if(cur.solo==false) {
									fmodel.addFlight(new Flight(cur.toString()));
									screenManager.repaint(root,false);
									return;
								}
							}
						case Gestures.BUTTON_TAP :
							flight_backup = null;
							flight = fmodel.createFlight(false,def_crew);
							get_name(false);
							break;
					}
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			JButton solo = new JButton("Add Solo");
			solo.setFont(menu_font);
			solo.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					int row = fmodel.fdata.indexOf(flight);
					switch(e.getButton()) {
						case Gestures.BUTTON_HOLD :
							int pos = fmodel.fdata.size()-1;
							while(pos>=0) {
								Flight cur = (Flight)fmodel.fdata.get(pos--);
								if(cur.solo==true) {
									fmodel.addFlight(new Flight(cur.toString()));
									screenManager.repaint(root,false);
									return;
								}
							}
						case Gestures.BUTTON_TAP :
							flight_backup = null;
							flight = fmodel.createFlight(true,def_crew);
							get_name(true);
							break;
					}
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			JPanel log_buttons = new JPanel(new GridLayout(1,2));
			log_buttons.add(tandem);
			log_buttons.add(solo);
			ActionListener name_listener = new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					String name = e.getSource() instanceof JTextField ?
						name_input.getText() : ((JButton)e.getSource()).getText();
					if( name.equals("") ) return;
					flight.name = name;
					if(flight_backup==null) get_other(true);
					else {
						card.show(root, "logs");
					}
				}
			};
			name_input = new JTextField();
			name_input.setFont(edit_font);
			name_input.addActionListener(name_listener);
			name_input.getDocument().addDocumentListener(new DocumentListener() {
				public void changedUpdate(DocumentEvent e) { textValueChanged(e); }
				public void insertUpdate(DocumentEvent e) { textValueChanged(e); }
				public void removeUpdate(DocumentEvent e) { textValueChanged(e); }
				public void textValueChanged(DocumentEvent e) {
					Process match = null;
					BufferedReader matches = null;
					if(name_input.getText().equals("")) {
						mod_recent_names();
						return;
					}
					String[] cmd = {"/bin/sh", dir.concat(".dropbox/match_")
						.concat(flight.solo?"solo":"tandem"),name_input.getText()};
					try {
						match = Runtime.getRuntime().exec(cmd);
						matches = new BufferedReader(new InputStreamReader(match.getInputStream()));
						String line; int i=0; Component[] buts = name_buttons.getComponents();
						while((line=matches.readLine())!=null) {
							buts[i].setEnabled(true);
							((JButton)buts[i]).setText(line);
							i++;
						}
						matches.close();
						while(i<buts.length) {
							buts[i++].setEnabled(false);
						}
						screenManager.repaint(name_buttons,false);
					}
					catch(IOException x) { x.printStackTrace();}
				}
			});
			OnscreenKeyboardUtil.configure(name_input, OnscreenKeyboardUtil.KEYBOARD_MODE_INIT_CAP_ONCE);
			JButton name_cancel = new JButton("Cancel");
			name_cancel.setFont(edit_font);
			name_cancel.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					card.show(root, "logs");
				}
			});
			JPanel name_head = new JPanel(new BorderLayout());
			name_head.add(name_input, BorderLayout.CENTER);
			name_head.add(name_cancel, BorderLayout.EAST);
			name_buttons = new JPanel(new GridLayout(10,1));
			for(int i=0;i<10;i++) {
				JButton but = new JButton();
				but.setFont(edit_font);
				but.addActionListener(name_listener);
				name_buttons.add(but);
			}
			JLabel name_keyboard_space = new JLabel("Keyboard Space",JLabel.CENTER);
			name_keyboard_space.setPreferredSize(ctx.getOnscreenKeyboardManager().getSize());
			String[] alt_button_text = {"X","Pat","2500","3500","Mile","10k"};
			alt_buttons = new JPanel();
			for(int i=0;i<alt_button_text.length;i++){
				JButton but = new JButton(alt_button_text[i]);
				but.setFont(edit_font);
				but.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						int alt = flight.alt;
						alt_buttons.getComponent(alt).setEnabled(true);
						JButton but = (JButton)e.getSource();
						mod_alt_button(but.getText().charAt(0),false);
					}
				});
				alt_buttons.add(but);
			}
			String[] tandem_list = load_list(dir.concat("config/notes.tandem.csv"));
			String[] solo_list = load_list(dir.concat("config/notes.solo.csv"));
			notes_tandem = new JPanel();
			notes_solo = new JPanel();
			for(int i=0;i<tandem_list.length;i++) {
				JCheckBox but = new JCheckBox(tandem_list[i],false);
				but.setFont(edit_font);
				but.setPreferredSize(new Dimension(200,50));
				notes_tandem.add(but);
			}
			for(int i=0;i<solo_list.length;i++) {
				JCheckBox but = new JCheckBox(solo_list[i],false);
				but.setFont(edit_font);
				but.setPreferredSize(new Dimension(200,50));
				notes_solo.add(but);
			}
			card_notes = new CardLayout();
			notes = new JPanel();
			notes.setLayout(card_notes);
			notes.add(notes_tandem, "tandem");
			notes.add(notes_solo, "solo");
			work_tug = new JPanel(new GridLayout(crew_list.length,1));
			work_tug.add(new JLabel("Tug"));
			work_tug.add(new JLabel());
			work_crew = new JPanel(new GridLayout(crew_list.length,1));
			work_crew.add(new JLabel("Crew"));
			work_tandem = new JPanel(new GridLayout(crew_list.length,1));
			work_tandem.add(new JLabel("Tan"));
			work_tandem.add(new JLabel());
			for(int i=1;i<crew_list.length;i++) {
				JButton worker;
				String initial = crew_list[i].substring(0,1);
				char def_char = crew_list[i].charAt(2);
				if(def_char=='@') {
					def_crew[2]=initial.charAt(0);
				}
				else if(def_char=='*') {
					def_crew[0]=initial.charAt(0);
				}
				int index = crew_list[i].lastIndexOf(",");
				if(crew_list[i].charAt(index+1)=='1') {
					worker = new JButton(initial); worker.setFont(edit_font); work_crew.add(worker);
					worker.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							work_crew_but.setEnabled(true);
							work_crew_but = (JButton)e.getSource();
							flight.work[1] = work_crew_but.getText().charAt(0);
							work_crew_but.setEnabled(false);
						}
					});
				}
				if(crew_list[i].charAt(index-3)=='1') {
					worker = new JButton(initial); worker.setFont(edit_font); work_tug.add(worker);
					worker.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							work_tug_but.setEnabled(true);
							work_tug_but = (JButton)e.getSource();
							flight.work[0] = work_tug_but.getText().charAt(0);
							work_tug_but.setEnabled(false);
						}
					});
				}
				if(crew_list[i].charAt(index-1)=='1') {
					worker = new JButton(initial); worker.setFont(edit_font); work_tandem.add(worker);
					worker.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							work_tandem_but.setEnabled(true);
							work_tandem_but = (JButton)e.getSource();
							flight.work[2] = work_tandem_but.getText().charAt(0);
							work_tandem_but.setEnabled(false);
						}
					});
				}
			}
			JPanel work_logs = new JPanel(new FlowLayout(FlowLayout.CENTER,30,0));
			work_logs.add(work_tug);
			work_logs.add(work_crew);
			work_logs.add(work_tandem);
			JPanel other_center = new JPanel(new GridLayout(1,2));
			other_center.add(notes);
			other_center.add(work_logs);
			JButton other_save = new JButton("Save (Hold to Cancel)");
			other_save.setFont(menu_font);
			other_save.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					int row = fmodel.fdata.indexOf(flight);
					switch(e.getButton()) {
						case Gestures.BUTTON_HOLD :
							if(flight_backup!=null)
								fmodel.fdata.set(row,new Flight(flight_backup));
							break;
						case Gestures.BUTTON_TAP :
							StringBuffer new_notes = new StringBuffer();
							Component[] buts = flight.solo ?
								notes_solo.getComponents():
								notes_tandem.getComponents();
							for(int i=0;i<buts.length;i++) {
								JCheckBox but = (JCheckBox)buts[i];
								if(but.isSelected())
									new_notes.append(but.getText()).append("/");
							}
							if(new_notes.length() > 0)
								flight.notes = new_notes.deleteCharAt(new_notes.length()-1).toString();
							if(flight_backup==null) {
								fmodel.addFlight(flight);
								update_log();
							} else fmodel.update_row(row);
							break;
					}
					card.show(root,"logs");
					alt_buttons.getComponent(flight.alt).setEnabled(true);
					work_tug_but.setEnabled(true);
					work_crew_but.setEnabled(true);
					if(!flight.solo) work_tandem_but.setEnabled(true);
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			JPanel log_card = new JPanel(new BorderLayout());
			log_card.add(logs_day_info, BorderLayout.NORTH);
			log_card.add(log, BorderLayout.CENTER);
			log_card.add(log_buttons, BorderLayout.SOUTH);
			JPanel name_card = new JPanel(new BorderLayout());
			name_card.add(name_head, BorderLayout.NORTH);
			name_card.add(name_buttons, BorderLayout.CENTER);
			name_card.add(name_keyboard_space, BorderLayout.SOUTH);
			JPanel other_card = new JPanel(new BorderLayout());
			other_card.add(alt_buttons, BorderLayout.NORTH);
			other_card.add(other_center, BorderLayout.CENTER);
			other_card.add(other_save, BorderLayout.SOUTH);
			card = new CardLayout();
			root.setLayout(card);
			root.add(log_card,"logs");
			root.add(name_card,"name");
			root.add(other_card,"other");
		} catch (Throwable t) {
			t.printStackTrace();
		}
	}

Output:
	public void create(KindletContext context) {
		this.ctx = context;
		this.root = ctx.getRootContainer();
		screenManager = KRepaintManager.getInstance();
		get_date();
		String[] crew_list = load_list(dir.concat("config/crew.csv"));
		Flight.init(crew_list);
		fmodel = new FlightModel(filename, save_date);
		try {
			Font menu_font = ctx.getUIResources().getFont(KFontFamilyName.MONOSPACE,14);
			Font table_font = ctx.getUIResources().getFont(KFontFamilyName.MONOSPACE,10);
			Font edit_font = ctx.getUIResources().getFont(KFontFamilyName.MONOSPACE,12);
			KMenu menu = new KMenu();
			menu.add("Save",new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					fmodel.save();
					KOptionPane.showMessageDialog(root,"Data Saved");
				}
			});
			menu.add("Sync",new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					fmodel.save();
					if(python("sync.py"))
						KOptionPane.showMessageDialog(root,"Sync Completed");
					else KOptionPane.showMessageDialog(root,"Sync Failed");
				}
			});
			menu.add("Update",new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					fmodel.save();
					if(python("update.py"))
						KOptionPane.showMessageDialog(root,"Update Completed");
					else KOptionPane.showMessageDialog(root,"Update Failed");
				}
			});
			ctx.setMenu(menu);
			logs_day_info = new JLabel(date.concat("   Flights: ")
					.concat(Integer.toString(fmodel.getFlightCount())));
			logs_day_info.setFont(menu_font);
			logs_day_info.setBorder(new LineBorder(Color.black));
			JPanel log = new JPanel(new BorderLayout());
			logs_cells = new JTable(fmodel);
			logs_cells.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION);
			logs_cells.setRowSelectionAllowed(true);
			logs_cells.setFont(table_font);
			logs_cells.setRowHeight(29);
			logs_cells.getColumnModel().getColumn(0).setPreferredWidth(50);
			logs_cells.getColumnModel().getColumn(1).setPreferredWidth(306);
			logs_cells.getColumnModel().getColumn(2).setPreferredWidth(130);
			logs_cells.getColumnModel().getColumn(3).setPreferredWidth(50);
			logs_cells.getColumnModel().getColumn(4).setPreferredWidth(50);
			logs_cells.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					switch(e.getButton()) {
						case Gestures.BUTTON_FLICK_NORTH :
						case Gestures.BUTTON_FLICK_WEST :
							fmodel.next_page();
							break;
						case Gestures.BUTTON_FLICK_SOUTH :
						case Gestures.BUTTON_FLICK_EAST :
							fmodel.prev_page();
							break;
						case Gestures.BUTTON_HOLD :
							Point p = e.getPoint();
							int row = logs_cells.rowAtPoint(p);
							int col = logs_cells.columnAtPoint(p);
							int flight_num = Integer.parseInt((String)logs_cells.getValueAt(row,0));
							flight = (Flight)fmodel.fdata.get(flight_num-1);
							flight_backup = flight.toString();
							switch(col) {
								case 0 :
									StringBuffer to_del = new StringBuffer();
									to_del.append(Integer.toString(flight_num)).append(" ?\n");
									to_del.append(' ').append(flight.name).append('\n');
									to_del.append(' ').append(flight.notes).append('\n');
									to_del.append(' ').append(flight.getAltstr()).append('\n');
									to_del.append(' ').append(new String(flight.work));
									int result = KOptionPane.showConfirmDialog(root,
											"Save A copy of flight #".concat(to_del.toString()),
											"Duplication Confirmation",
											KOptionPane.CANCEL_SAVE_OPTIONS);
									if(result!=KOptionPane.CANCEL_OPTION) {
										fmodel.addFlight((Flight)fmodel.fdata.get(flight_num-1));
										screenManager.repaint(root,false);
										break;
									}
									result = KOptionPane.showConfirmDialog(root,
											"**Delete** flight #".concat(to_del.toString()),
											"Deletion Confirmation",
											KOptionPane.NO_YES_OPTIONS);
									if(result==KOptionPane.YES_OPTION) {
										fmodel.remove(flight_num);
										update_log();
									}
									break;
								case 1 :
									get_name(false);
									break;
								case 2 :
								case 3 :
								case 4 :
									get_other(false);
									break;
								default :
							}
							break;
						case Gestures.BUTTON_GROW :
						case Gestures.BUTTON_SHRINK :
						case Gestures.BUTTON_TAP :
					}
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			logs_cells.getTableHeader().setBorder(new LineBorder(Color.black));
			log.add(logs_cells.getTableHeader(),BorderLayout.NORTH);
			log.add(logs_cells,BorderLayout.CENTER);
			JButton tandem = new JButton("Add Tandem");
			tandem.setFont(menu_font);
			tandem.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					int row = fmodel.fdata.indexOf(flight);
					switch(e.getButton()) {
						case Gestures.BUTTON_HOLD :
							int pos = fmodel.fdata.size()-1;
							while(pos>=0) {
								Flight cur = (Flight)fmodel.fdata.get(pos--);
								if(cur.solo==false) {
									fmodel.addFlight(new Flight(cur.toString()));
									screenManager.repaint(root,false);
									return;
								}
							}
						case Gestures.BUTTON_TAP :
							flight_backup = null;
							flight = fmodel.createFlight(false,def_crew);
							get_name(false);
							break;
					}
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			JButton solo = new JButton("Add Solo");
			solo.setFont(menu_font);
			solo.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					int row = fmodel.fdata.indexOf(flight);
					switch(e.getButton()) {
						case Gestures.BUTTON_HOLD :
							int pos = fmodel.fdata.size()-1;
							while(pos>=0) {
								Flight cur = (Flight)fmodel.fdata.get(pos--);
								if(cur.solo==true) {
									fmodel.addFlight(new Flight(cur.toString()));
									screenManager.repaint(root,false);
									return;
								}
							}
						case Gestures.BUTTON_TAP :
							flight_backup = null;
							flight = fmodel.createFlight(true,def_crew);
							get_name(true);
							break;
					}
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			JPanel log_buttons = new JPanel(new GridLayout(1,2));
			log_buttons.add(tandem);
			log_buttons.add(solo);
			ActionListener name_listener = new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					String name = e.getSource() instanceof JTextField ?
						name_input.getText() : ((JButton)e.getSource()).getText();
					if( name.equals("") ) return;
					flight.name = name;
					if(flight_backup==null) get_other(true);
					else {
						card.show(root, "logs");
					}
				}
			};
			name_input = new JTextField();
			name_input.setFont(edit_font);
			name_input.addActionListener(name_listener);
			name_input.getDocument().addDocumentListener(new DocumentListener() {
				public void changedUpdate(DocumentEvent e) { textValueChanged(e); }
				public void insertUpdate(DocumentEvent e) { textValueChanged(e); }
				public void removeUpdate(DocumentEvent e) { textValueChanged(e); }
				public void textValueChanged(DocumentEvent e) {
					Process match = null;
					BufferedReader matches = null;
					if(name_input.getText().equals("")) {
						mod_recent_names();
						return;
					}
					String[] cmd = {"/bin/sh", dir.concat(".dropbox/match_")
						.concat(flight.solo?"solo":"tandem"),name_input.getText()};
					try {
						match = Runtime.getRuntime().exec(cmd);
						matches = new BufferedReader(new InputStreamReader(match.getInputStream()));
						String line; int i=0; Component[] buts = name_buttons.getComponents();
						while((line=matches.readLine())!=null) {
							buts[i].setEnabled(true);
							((JButton)buts[i]).setText(line);
							i++;
						}
						matches.close();
						while(i<buts.length) {
							buts[i++].setEnabled(false);
						}
						screenManager.repaint(name_buttons,false);
					}
					catch(IOException x) { x.printStackTrace();}
				}
			});
			OnscreenKeyboardUtil.configure(name_input, OnscreenKeyboardUtil.KEYBOARD_MODE_INIT_CAP_ONCE);
			JButton name_cancel = new JButton("Cancel");
			name_cancel.setFont(edit_font);
			name_cancel.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					card.show(root, "logs");
				}
			});
			JPanel name_head = new JPanel(new BorderLayout());
			name_head.add(name_input, BorderLayout.CENTER);
			name_head.add(name_cancel, BorderLayout.EAST);
			name_buttons = new JPanel(new GridLayout(10,1));
			for(int i=0;i<10;i++) {
				JButton but = new JButton();
				but.setFont(edit_font);
				but.addActionListener(name_listener);
				name_buttons.add(but);
			}
			JLabel name_keyboard_space = new JLabel("Keyboard Space",JLabel.CENTER);
			name_keyboard_space.setPreferredSize(ctx.getOnscreenKeyboardManager().getSize());
			String[] alt_button_text = {"X","Pat","2500","3500","Mile","10k"};
			alt_buttons = new JPanel();
			for(int i=0;i<alt_button_text.length;i++){
				JButton but = new JButton(alt_button_text[i]);
				but.setFont(edit_font);
				but.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						int alt = flight.alt;
						alt_buttons.getComponent(alt).setEnabled(true);
						JButton but = (JButton)e.getSource();
						mod_alt_button(but.getText().charAt(0),false);
					}
				});
				alt_buttons.add(but);
			}
			String[] tandem_list = load_list(dir.concat("config/notes.tandem.csv"));
			String[] solo_list = load_list(dir.concat("config/notes.solo.csv"));
			notes_tandem = new JPanel();
			notes_solo = new JPanel();
			for(int i=0;i<tandem_list.length;i++) {
				JCheckBox but = new JCheckBox(tandem_list[i],false);
				but.setFont(edit_font);
				but.setPreferredSize(new Dimension(200,50));
				notes_tandem.add(but);
			}
			for(int i=0;i<solo_list.length;i++) {
				JCheckBox but = new JCheckBox(solo_list[i],false);
				but.setFont(edit_font);
				but.setPreferredSize(new Dimension(200,50));
				notes_solo.add(but);
			}
			card_notes = new CardLayout();
			notes = new JPanel();
			notes.setLayout(card_notes);
			notes.add(notes_tandem, "tandem");
			notes.add(notes_solo, "solo");
			work_tug = new JPanel(new GridLayout(crew_list.length,1));
			work_tug.add(new JLabel("Tug"));
			work_tug.add(new JLabel());
			work_crew = new JPanel(new GridLayout(crew_list.length,1));
			work_crew.add(new JLabel("Crew"));
			work_tandem = new JPanel(new GridLayout(crew_list.length,1));
			work_tandem.add(new JLabel("Tan"));
			work_tandem.add(new JLabel());
			for(int i=1;i<crew_list.length;i++) {
				JButton worker;
				String initial = crew_list[i].substring(0,1);
				char def_char = crew_list[i].charAt(2);
				if(def_char=='@') {
					def_crew[2]=initial.charAt(0);
				}
				else if(def_char=='*') {
					def_crew[0]=initial.charAt(0);
				}
				int index = crew_list[i].lastIndexOf(",");
				if(crew_list[i].charAt(index+1)=='1') {
					worker = new JButton(initial); worker.setFont(edit_font); work_crew.add(worker);
					worker.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							work_crew_but.setEnabled(true);
							work_crew_but = (JButton)e.getSource();
							flight.work[1] = work_crew_but.getText().charAt(0);
							work_crew_but.setEnabled(false);
						}
					});
				}
				if(crew_list[i].charAt(index-3)=='1') {
					worker = new JButton(initial); worker.setFont(edit_font); work_tug.add(worker);
					worker.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							work_tug_but.setEnabled(true);
							work_tug_but = (JButton)e.getSource();
							flight.work[0] = work_tug_but.getText().charAt(0);
							work_tug_but.setEnabled(false);
						}
					});
				}
				if(crew_list[i].charAt(index-1)=='1') {
					worker = new JButton(initial); worker.setFont(edit_font); work_tandem.add(worker);
					worker.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							work_tandem_but.setEnabled(true);
							work_tandem_but = (JButton)e.getSource();
							flight.work[2] = work_tandem_but.getText().charAt(0);
							work_tandem_but.setEnabled(false);
						}
					});
				}
			}
			JPanel work_logs = new JPanel(new FlowLayout(FlowLayout.CENTER,30,0));
			work_logs.add(work_tug);
			work_logs.add(work_crew);
			work_logs.add(work_tandem);
			JPanel other_center = new JPanel(new GridLayout(1,2));
			other_center.add(notes);
			other_center.add(work_logs);
			JButton other_save = new JButton("Save (Hold to Cancel)");
			other_save.setFont(menu_font);
			other_save.addMouseListener(new MouseListener() {
				public void mouseClicked(MouseEvent e) {
					int row = fmodel.fdata.indexOf(flight);
					switch(e.getButton()) {
						case Gestures.BUTTON_HOLD :
							if(flight_backup!=null)
								fmodel.fdata.set(row,new Flight(flight_backup));
							break;
						case Gestures.BUTTON_TAP :
							StringBuffer new_notes = new StringBuffer();
							Component[] buts = flight.solo ?
								notes_solo.getComponents():
								notes_tandem.getComponents();
							for(int i=0;i<buts.length;i++) {
								JCheckBox but = (JCheckBox)buts[i];
								if(but.isSelected())
									new_notes.append(but.getText()).append("/");
							}
							if(new_notes.length() > 0)
								flight.notes = new_notes.deleteCharAt(new_notes.length()-1).toString();
							else flight.notes = "";
							if(flight_backup==null) {
								fmodel.addFlight(flight);
								update_log();
							} else fmodel.update_row(row);
							break;
					}
					card.show(root,"logs");
					alt_buttons.getComponent(flight.alt).setEnabled(true);
					work_tug_but.setEnabled(true);
					work_crew_but.setEnabled(true);
					if(!flight.solo) work_tandem_but.setEnabled(true);
				}
				public void mouseReleased(MouseEvent e) { }
				public void mousePressed(MouseEvent e) { }
				public void mouseExited(MouseEvent e) { }
				public void mouseEntered(MouseEvent e) { }
			});
			JPanel log_card = new JPanel(new BorderLayout());
			log_card.add(logs_day_info, BorderLayout.NORTH);
			log_card.add(log, BorderLayout.CENTER);
			log_card.add(log_buttons, BorderLayout.SOUTH);
			JPanel name_card = new JPanel(new BorderLayout());
			name_card.add(name_head, BorderLayout.NORTH);
			name_card.add(name_buttons, BorderLayout.CENTER);
			name_card.add(name_keyboard_space, BorderLayout.SOUTH);
			JPanel other_card = new JPanel(new BorderLayout());
			other_card.add(alt_buttons, BorderLayout.NORTH);
			other_card.add(other_center, BorderLayout.CENTER);
			other_card.add(other_save, BorderLayout.SOUTH);
			card = new CardLayout();
			root.setLayout(card);
			root.add(log_card,"logs");
			root.add(name_card,"name");
			root.add(other_card,"other");
		} catch (Throwable t) {
			t.printStackTrace();
		}
	}


Input:
    public Response all() {
        List<Hotel> hotels = new ArrayList<Hotel>();
        for (HotelProvider provider : providers) {
            hotels.addAll(provider.hotels());
        }
        if (app.isValid()) {
            return Render.view("hotel/all.xhtml", getClass())
                    .param("hotels", hotels)
                    .param("providers", providers)
                    .render();
        } else {
            return Render.view("hotel/none.xhtml", getClass())
                    .param("hotels", hotels)
                    .param("providers", providers).render();
        }
    }

Output:
    public Response all() {
        List<Hotel> hotels = new ArrayList<Hotel>();
        for (HotelProvider provider : providers) {
            hotels.addAll(provider.hotels());
        }
        if (app.isValid()) {
            return Render.view("hotel/all.xhtml", getClass())
                    .param("hotels", hotels)
                    .param("providers", providers)
                    .render();
        } else {
            return Render.view("hotel/none.xhtml", getClass())
                    .param("hotels", hotels)
                    .param("providers", providers)
                    .render();
        }
    }


Input:
	public void unmanage(ProductContainer pc) {
		if (pc instanceof StorageUnit) {
			StorageUnit storageUnit = (StorageUnit) pc;
			rootStorageUnits.remove(storageUnit);
			nameToStorageUnit.remove(storageUnit.getName());
		} else {
			ProductGroup pg = (ProductGroup) pc;
			for (StorageUnit su : rootStorageUnits) {
				if (su.containsProductGroup(pg.getName())) {
					su.remove(pg);
				}
			}
		}
		setChanged();
		Action a = new Action(pc, ActionType.DELETE);
		this.notifyObservers(a);
	}

Output:
	public void unmanage(ProductContainer pc) {
		if (pc instanceof StorageUnit) {
			StorageUnit storageUnit = (StorageUnit) pc;
			rootStorageUnits.remove(storageUnit);
			nameToStorageUnit.remove(storageUnit.getName());
		} else {
			ProductGroup pg = (ProductGroup) pc;
			for (StorageUnit su : rootStorageUnits) {
				if (su.containsProductGroup(pg) || su.hasDescendantProductContainer(pg)) {
					su.remove(pg);
				}
			}
		}
		setChanged();
		Action a = new Action(pc, ActionType.DELETE);
		this.notifyObservers(a);
	}


Input:
	protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
		int saveCount = canvas.save();
		if(mIconSize==0){
			Drawable[] tmp=((TextView)child).getCompoundDrawables();
			mIconSize=tmp[1].getIntrinsicHeight()+child.getPaddingTop();
		}
		if(child.getDrawingCache()==null){
			child.setDrawingCacheQuality(DRAWING_CACHE_QUALITY_HIGH);
			child.setDrawingCacheEnabled(true);
		}
		Bitmap cache=child.getDrawingCache();
		if(isAnimating){
			postInvalidate();
			if(cache!=null){
				float x;
				float y;
				int distH=(child.getLeft()+(child.getWidth()/2))-(getWidth()/2);
				int distV=(child.getTop()+(child.getHeight()/2))-(getHeight()/2);
				x=child.getLeft()+(distH*(mScaleFactor-1))*(mScaleFactor);
				y=child.getTop()+(distV*(mScaleFactor-1))*(mScaleFactor);
				float width=child.getWidth()*mScaleFactor;
				float height=(child.getHeight()-(child.getHeight()-mIconSize))*mScaleFactor;
				Rect r1=new Rect(0, 0, cache.getWidth(), cache.getHeight()-(child.getHeight()-mIconSize));
				Rect r2=new Rect((int)x, (int)y, (int)x+(int)width, (int)y+(int)height);
				if(shouldDrawLabels){
					Rect rl1=new Rect(0,mIconSize,cache.getWidth(),cache.getHeight());
					Rect rl2=new Rect(child.getLeft(),child.getTop()+mIconSize,child.getLeft()+cache.getWidth(),child.getTop()+cache.getHeight());
					mLabelPaint.setAlpha(mBgAlpha);
					canvas.drawBitmap(cache, rl1, rl2, mLabelPaint);
				}
				canvas.drawBitmap(cache, r1, r2, mPaint);
			}else{
				child.draw(canvas);
			}
		}else{
			if(cache!=null){
				canvas.drawBitmap(cache, child.getLeft(), child.getTop(), mPaint);
			}else{
				child.draw(canvas);
			}
		}
		canvas.restoreToCount(saveCount);
		return true;
	}

Output:
	protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
		int saveCount = canvas.save();
		if(mIconSize==0){
			Drawable[] tmp=((TextView)child).getCompoundDrawables();
			mIconSize=tmp[1].getIntrinsicHeight()+child.getPaddingTop();
		}
		if(child.getDrawingCache()==null){
			child.setDrawingCacheQuality(DRAWING_CACHE_QUALITY_HIGH);
			child.setDrawingCacheEnabled(true);
		}
		Bitmap cache=child.getDrawingCache();
		if(isAnimating){
			postInvalidate();
			if(cache!=null){
				float x;
				float y;
				int distH=(child.getLeft()+(child.getWidth()/2))-(getWidth()/2);
				int distV=(child.getTop()+(child.getHeight()/2))-(getHeight()/2);
				x=child.getLeft()+(distH*(mScaleFactor-1))*(mScaleFactor);
				y=child.getTop()+(distV*(mScaleFactor-1))*(mScaleFactor);
				float width=child.getWidth()*mScaleFactor;
				float height=(child.getHeight()-(child.getHeight()-mIconSize))*mScaleFactor;
				Rect r1=new Rect(0, 0, cache.getWidth(), cache.getHeight()-(child.getHeight()-mIconSize));
				Rect r2=new Rect((int)x, (int)y, (int)x+(int)width, (int)y+(int)height);
				if(shouldDrawLabels){
					Rect rl1=new Rect(0,mIconSize,cache.getWidth(),cache.getHeight());
					Rect rl2=new Rect(child.getLeft(),child.getTop()+mIconSize,child.getLeft()+cache.getWidth(),child.getTop()+cache.getHeight());
					mLabelPaint.setAlpha(mBgAlpha);
					canvas.drawBitmap(cache, rl1, rl2, mLabelPaint);
				}
				canvas.drawBitmap(cache, r1, r2, mPaint);
			}else{
				child.draw(canvas);
			}
		}else{
			if(cache!=null){
				mPaint.setAlpha(255);
				canvas.drawBitmap(cache, child.getLeft(), child.getTop(), mPaint);
			}else{
				child.draw(canvas);
			}
		}
		canvas.restoreToCount(saveCount);
		return true;
	}


Input:
	public void run() {
		for(int i =0; i < logNum; i++){
			try{
				if(randomValue.nextInt(100) <= abnormalRandomValue){
					randomFlag = false;
				}else{
					randomFlag = true;
				}
				System.out.println(this.logProducer.ModelParser(randomFlag, "random"));
				queue.put(this.logProducer.ModelParser(false, "random"));
			} catch (Exception e){
				e.printStackTrace();
			}
		}
	}

Output:
	public void run() {
		for(int i =0; i < logNum; i++){
			try{
				if(randomValue.nextInt(100) <= abnormalRandomValue){
					randomFlag = false;
				}else{
					randomFlag = true;
				}
				System.out.println(this.logProducer.ModelParser(randomFlag, "random"));
			} catch (Exception e){
				e.printStackTrace();
			}
		}
	}


Input:
	public static void setStyle( String name)
	{
		ServletManager servletManager = Activator.getServletManager();
		if( name.equals( "default")) {
			servletManager.removeResource( "/css");
			servletManager.addResources("/css","/resources/templates/layout/css");
			servletManager.removeResource( "/js");
			servletManager.addResources("/js","/resources/js");
			servletManager.removeResource( "/images");
			servletManager.addResources("/images", "/resources/images");
			return;
		}
		HttpContext httpContextStyle = new HttpContextStyle( name);
		try {
			JarFile styleJarFile = new JarFile( name);
			Enumeration<?> jarEntryEnum = styleJarFile.entries();
			while (jarEntryEnum.hasMoreElements()) {
				JarEntry entry = (JarEntry) jarEntryEnum.nextElement();
				if (entry.isDirectory()) {
					String alias = "/" + entry.getName().substring( 0, entry.getName().length() - 1);
					servletManager.removeResource( alias);
					servletManager.addResources( alias, alias, httpContextStyle);
				}
			}
		} catch (IOException e) {
			logger.error( "io: " + e);
			e.printStackTrace();
		}
		return;
	}

Output:
	public static void setStyle( String name)
	{
		ServletManager servletManager = Activator.getServletManager();
		if( name.equals( "default")) {
			servletManager.addResources("/css","/resources/templates/layout/css");
			servletManager.addResources("/js","/resources/js");
			servletManager.addResources("/images", "/resources/images");
			return;
		}
		HttpContext httpContextStyle = new HttpContextStyle( name);
		try {
			JarFile styleJarFile = new JarFile( name);
			Enumeration<?> jarEntryEnum = styleJarFile.entries();
			while (jarEntryEnum.hasMoreElements()) {
				JarEntry entry = (JarEntry) jarEntryEnum.nextElement();
				if (entry.isDirectory()) {
					String alias = "/" + entry.getName().substring( 0, entry.getName().length() - 1);
					servletManager.removeResource( alias);
					servletManager.addResources( alias, alias, httpContextStyle);
				}
			}
		} catch (IOException e) {
			logger.error( "io: " + e);
			e.printStackTrace();
		}
		return;
	}


Input:
  public static void main(String[] args) throws Exception {
    int reps = 10;
    int sets = 100;
    List<Benchmark> benchmarks = Lists.newArrayList();
    benchmarks.add(new Linpack());
    List<Benchmark.Parameterised> pBenchmarks = Lists.newArrayList();
    pBenchmarks.add(new Ddot());
    pBenchmarks.add(new Dgemm());
    for (Benchmark b : benchmarks) {
      File file = new File(getTarget(b) + ".csv");
      log.info("writing to " + file);
      @Cleanup CSVWriter csv = new CSVWriter(new FileWriter(file));
      for (int i = 0; i < reps; i++) {
        long result = b.benchmark();
        csv.writeNext(new String[]{Long.toString(result)});
      }
    }
    double factor = 6 / 100.0;
    for (Benchmark.Parameterised b : pBenchmarks) {
      File file = new File(getTarget(b) + ".csv");
      log.info("writing to " + file);
      @Cleanup CSVWriter csv = new CSVWriter(new FileWriter(file));
      for (int i = 0; i < reps; i++) {
        for (int j = sets; j > 0; j--) {
          int size = (int) Math.pow(10, factor * j);
          if (size < 10) continue;
          long result = b.benchmark(size);
          csv.writeNext(new String[]{Long.toString(result)});
        }
      }
    }
  }

Output:
  public static void main(String[] args) throws Exception {
    int reps = 10;
    int sets = 100;
    List<Benchmark> benchmarks = Lists.newArrayList();
    benchmarks.add(new Linpack());
    List<Benchmark.Parameterised> pBenchmarks = Lists.newArrayList();
    pBenchmarks.add(new Ddot());
    pBenchmarks.add(new Dgemm());
    for (Benchmark b : benchmarks) {
      File file = new File(getTarget(b) + ".csv");
      log.info("writing to " + file);
      @Cleanup CSVWriter csv = new CSVWriter(new FileWriter(file));
      for (int i = 0; i < reps; i++) {
        long result = b.benchmark();
        csv.writeNext(new String[]{Long.toString(result)});
      }
    }
    double factor = 6 / 100.0;
    for (Benchmark.Parameterised b : pBenchmarks) {
      File file = new File(getTarget(b) + ".csv");
      log.info("writing to " + file);
      @Cleanup CSVWriter csv = new CSVWriter(new FileWriter(file));
      for (int i = 0; i < reps; i++) {
        for (int j = sets; j > 0; j--) {
          int size = (int) Math.pow(10, factor * j);
          if (size < 10) continue;
          long result = b.benchmark(size);
          csv.writeNext(new String[]{Integer.toString(size), Long.toString(result)});
        }
      }
    }
  }