Delete History not visible (RunHistoryPanel.java)
179175
public boolean isDemo() {
		if (!isSignedIn()) {
			return false;
		}
		
		Settings settings = storageService.getSettings();
		String baseUrl = settings.getBaseUrl();

		return getUser().getName().equals("demo")
				&& "http://demo.next-reports.com".equals(baseUrl);
	}
953698
public static int deleteExpiredHistory(EntityManager em) {
        requireArgument(em != null, "Entity manager cannot be null.");

        Query query = em.createNamedQuery("History.cullExpired");

        query.setParameter("expiryTime", System.currentTimeMillis() - (2 * MILLIS_PER_WEEK));
        return query.executeUpdate();
    }
1039132
public void historyUpdated (int adjustment)
    {
        if (adjustment != 0) {
            for (int ii = 0, nn = _showingHistory.size(); ii < nn; ii++) {
                ChatGlyph cg = _showingHistory.get(ii);
                cg.histIndex -= adjustment;
            }
            // some history entries were deleted, we need to re-figure the history scrollbar action
            resetHistoryOffset();
        }

        if (isLaidOut() && isHistoryMode()) {
            int val = _historyModel.getValue();
            updateHistBar(val - adjustment);

            // only repaint if we need to
            if ((val != _historyModel.getValue()) || (adjustment != 0) || !_histOffsetFinal) {
                figureCurrentHistory();
            }
        }
    }
1128218
private void pruneExcessiveHistoricalRecordsIfNeeded() {
        final int pruneCount = mHistoricalRecords.size() - mHistoryMaxSize;
        if (pruneCount <= 0) {
            return;
        }
        mHistoricalRecordsChanged = true;
        for (int i = 0; i < pruneCount; i++) {
            HistoricalRecord prunedRecord = mHistoricalRecords.remove(0);
            if (DEBUG) {
                Log.i(LOG_TAG, "Pruned: " + prunedRecord);
            }
        }
    }
985005
@Override
	public synchronized void delete(long historyId, String tag) throws DatabaseException {
    	try {
			psDeleteTag.setLong(1, historyId);
			psDeleteTag.setString(2, tag);
			psDeleteTag.executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
500698
public void deleteInactiveContent() throws PatchingException {
        List<File> dirs = getInactiveHistory();
        if (!dirs.isEmpty()) {
            for (File dir : dirs) {
                deleteDir(dir, ALL);
            }
        }
        dirs = getInactiveOverlays();
        if (!dirs.isEmpty()) {
            for (File dir : dirs) {
                deleteDir(dir, ALL);
            }
        }
    }
1239135
protected void addToHistory (String cmd)
    {
        // remove any previous instance of this command
        _history.remove(cmd);

        // append it to the end
        _history.add(cmd);

        // prune the history once it extends beyond max size
        if (_history.size() > MAX_COMMAND_HISTORY) {
            _history.remove(0);
        }
    }
1211794
def OnBackView(self, event):
        """"""
        self.historyIndex -= 1
        try:
            self.RestoreHistory(self.history[self.historyIndex])
        except IndexError, err:
            self.SetStatusText(_('No further history available'))
1136379
def do_history(self, args: argparse.Namespace) -> None:
        """"""

        # -v must be used alone with no other options
        if args.verbose:
            if args.clear or args.edit or args.output_file or args.run or args.transcript \
                    or args.expanded or args.script:
                self.poutput("-v can not be used with any other options")
                self.poutput(self.history_parser.format_usage())
                return

        # -s and -x can only be used if none of these options are present: [-c -r -e -o -t]
        if (args.script or args.expanded) \
                and (args.clear or args.edit or args.output_file or args.run or args.transcript):
            self.poutput("-s and -x can not be used with -c, -r, -e, -o, or -t")
            self.poutput(self.history_parser.format_usage())
            return

        if args.clear:
            # Clear command and readline history
            self.history.clear()

            if rl_type != RlType.NONE:
                readline.clear_history()
                if self.persistent_history_file:
                    os.remove(self.persistent_history_file)
            return

        # If an argument was supplied, then retrieve partial contents of the history
        cowardly_refuse_to_run = False
        if args.arg:
            # If a character indicating a slice is present, retrieve
            # a slice of the history
            arg = args.arg
            arg_is_int = False
            try:
                int(arg)
                arg_is_int = True
            except ValueError:
                pass

            if '..' in arg or ':' in arg:
                # Get a slice of history
                history = self.history.span(arg)
            elif arg_is_int:
                history = [self.history.get(arg)]
            elif arg.startswith(r'/') and arg.endswith(r'/'):
                history = self.history.regex_search(arg)
            else:
                history = self.history.str_search(arg)
        else:
            # If no arg given, then retrieve the entire history
            cowardly_refuse_to_run = True
            # Get a copy of the history so it doesn't get mutated while we are using it
            history = self.history[:]

        if args.run:
            if cowardly_refuse_to_run:
                self.perror("Cowardly refusing to run all previously entered commands.", traceback_war=False)
                self.perror("If this is what you want to do, specify '1:' as the range of history.",
                            traceback_war=False)
            else:
                for runme in history:
                    self.pfeedback(runme)
                    if runme:
                        self.onecmd_plus_hooks(runme)
        elif args.edit:
            import tempfile
            fd, fname = tempfile.mkstemp(suffix='.txt', text=True)
            with os.fdopen(fd, 'w') as fobj:
                for command in history:
                    if command.statement.multiline_command:
                        fobj.write('{}\n'.format(command.expanded.rstrip()))
                    else:
                        fobj.write('{}\n'.format(command))
            try:
                self.do_edit(fname)
                self.do_load(fname)
            except Exception:
                raise
            finally:
                os.remove(fname)
        elif args.output_file:
            try:
                with open(os.path.expanduser(args.output_file), 'w') as fobj:
                    for command in history:
                        if command.statement.multiline_command:
                            fobj.write('{}\n'.format(command.expanded.rstrip()))
                        else:
                            fobj.write('{}\n'.format(command))
                plural = 's' if len(history) > 1 else ''
                self.pfeedback('{} command{} saved to {}'.format(len(history), plural, args.output_file))
            except Exception as e:
                self.perror('Saving {!r} - {}'.format(args.output_file, e), traceback_war=False)
        elif args.transcript:
            self._generate_transcript(history, args.transcript)
        else:
            # Display the history items retrieved
            for hi in history:
                self.poutput(hi.pr(script=args.script, expanded=args.expanded, verbose=args.verbose))
913151
def _do_history(self, cmd, args):
        
        if args and args[0] == 'clear':
            readline.clear_history()
            readline.write_history_file(self.history_fname)
        elif args and args[0] == 'clearall':
            readline.clear_history()
            shutil.rmtree(self._temp_dir, ignore_errors = True)
            os.makedirs(os.path.join(self._temp_dir, 'history'))
        else:
            readline.write_history_file(self.history_fname)
            with open(self.history_fname, 'r', encoding = 'utf8') as f:
                self.stdout.write(f.read())
1025192
public static final ThreadHistoryEvent deleted(long threadId, String threadName){
		return new ThreadHistoryEvent(threadId, threadName, OPERATION.DELETED);
	}
1095452
public void delete() {
       if (historyId > 0) {
           try {
        	   // ZAP: Support for multiple tags
               staticTableTag.deleteTagsForHistoryID(historyId);
               staticTableHistory.delete(historyId);
               notifyEvent(HistoryReferenceEventPublisher.EVENT_REMOVED);
           } catch (DatabaseException e) {
        	   log.error(e.getMessage(), e);
           }
       }
   }
266507
private void pruneExcessiveHistoricalRecordsLocked() {
        List<HistoricalRecord> choiceRecords = mHistoricalRecords;
        final int pruneCount = choiceRecords.size() - mHistoryMaxSize;
        if (pruneCount <= 0) {
            return;
        }
        mHistoricalRecordsChanged = true;
        for (int i = 0; i < pruneCount; i++) {
            HistoricalRecord prunedRecord = choiceRecords.remove(0);
            if (DEBUG) {
                Log.i(LOG_TAG, "Pruned: " + prunedRecord);
            }
        }
    }
886678
void resetStatistics(boolean clearHistory) {
        lastTimerPop = System.currentTimeMillis();
        previousCompleted = threadPool == null ? 0 : threadPool.getCompletedTaskCount();
        previousThroughput = 0;

        consecutiveQueueEmptyCount = 0;
        consecutiveNoAdjustment = 0;
        consecutiveOutlierAfterAdjustment = 0;

        consecutiveIdleCount = 0;

        if (clearHistory) {
            threadStats = new TreeMap<Integer, ThroughputDistribution>();
        }

        lastAction = LastAction.NONE;
    }
764730
def rooms_clean_history(self, room_id, latest, oldest, **kwargs):
        """"""
        return self.__call_api_post('rooms.cleanHistory', roomId=room_id, latest=latest, oldest=oldest, kwargs=kwargs)
1160417
def enter_history(self):
        
        app = get_app()
        app.vi_state.input_mode = InputMode.NAVIGATION

        def done(f):
            result = f.result()
            if result is not None:
                self.default_buffer.text = result

            app.vi_state.input_mode = InputMode.INSERT

        history = History(self, self.default_buffer.document)

        future = run_coroutine_in_terminal(history.app.run_async)
        future.add_done_callback(done)
1093699
public void clearHistory(int profileId, String clientUUID) {
        PreparedStatement query = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            String sqlQuery = "DELETE FROM " + Constants.DB_TABLE_HISTORY + " ";

            // see if profileId is null or not (-1)
            if (profileId != -1) {
                sqlQuery += "WHERE " + Constants.GENERIC_PROFILE_ID + "=" + profileId;
            }

            // see if clientUUID is null or not
            if (clientUUID != null && clientUUID.compareTo("") != 0) {
                sqlQuery += " AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID + "'";
            }

            sqlQuery += ";";

            logger.info("Query: {}", sqlQuery);
            query = sqlConnection.prepareStatement(sqlQuery);
            query.executeUpdate();
        } catch (Exception e) {
        } finally {
            try {
                if (query != null) {
                    query.close();
                }
            } catch (Exception e) {
            }
        }
    }