Update the hash location, either replacing the current entry, or adding a new one to the browser history.
198543
function(location, fragment, replace) {
      if (replace) {
        var href = location.href.replace(/(javascript:|#).*$/, '');
        location.replace(href + '#' + fragment);
      } else {
        // Some browsers require that `hash` contains a leading #.
        location.hash = '#' + fragment;
      }
    }
12226
def update_history(self, directory):
        """"""
        try:
            directory = osp.abspath(to_text_string(directory))
            if directory in self.history:
                self.histindex = self.history.index(directory)
        except Exception:
            user_directory = get_home_dir()
            self.chdir(directory=user_directory, browsing_history=True)
731170
function onHashChange(sHash){
			var oRoute, iStep, oParsedHash, iNewHashIndex, sNavType;

			//handle the nonbookmarkable hash
			if (currentHash === undefined) {
				//url with hash opened from bookmark
				oParsedHash = parseHashToObject(sHash);

				if (!oParsedHash || !oParsedHash.bBookmarkable) {
					if (jQuery.isFunction(defaultHandler)) {
						defaultHandler(jQuery.sap.history.NavType.Bookmark);
					}
					return;
				}
			}

			if (sHash.length === 0) {
				if (jQuery.isFunction(defaultHandler)) {
					defaultHandler(jQuery.sap.history.NavType.Back);
				}
			} else {
				//application restored from bookmark with non-empty hash, and later navigates back to the first hash token
				//the defaultHandler should be triggered
				iNewHashIndex = hashHistory.indexOf(sHash);
				if (iNewHashIndex === 0) {
					oParsedHash = parseHashToObject(sHash);
					if (!oParsedHash || !oParsedHash.bBookmarkable) {
						if (jQuery.isFunction(defaultHandler)) {
							defaultHandler(jQuery.sap.history.NavType.Back);
						}
						return;
					}
				}

				//need to handle when iNewHashIndex equals -1.
				//This happens when user navigates out the current application, and later navigates back.
				//In this case, the hashHistory is an empty array.


				if (isVirtualHash(sHash)) {
					//this is a virtual history, should do the skipping calculation
					if (isVirtualHash(currentHash)) {
						//go back to the first one that is not virtual
						iStep = calcStepsToRealHistory(sHash, false);
						window.history.go(iStep);
					} else {
						var sameFamilyRegex = new RegExp(escapeRegExp(currentHash + skipSuffix) + "[0-9]*$");
						if (sameFamilyRegex.test(sHash)) {
							//going forward
							//search forward in history for the first non-virtual hash
							//if there is, change to that one window.history.go
							//if not, stay and return false
							iStep = calcStepsToRealHistory(sHash, true);
							if (iStep) {
								window.history.go(iStep);
							} else {
								window.history.back();
							}

						} else {
							//going backward
							//search backward for the first non-virtual hash and there must be one
							iStep = calcStepsToRealHistory(sHash, false);
							window.history.go(iStep);
						}
					}
				} else {
					if (iNewHashIndex === -1) {
						sNavType = jQuery.sap.history.NavType.Unknown;
						hashHistory.push(sHash);
					} else {
						if (hashHistory.indexOf(currentHash, iNewHashIndex + 1) === -1) {
							sNavType = jQuery.sap.history.NavType.Forward;
						} else {
							sNavType = jQuery.sap.history.NavType.Back;
						}
					}


					oParsedHash = parseHashToObject(sHash);
					if (oParsedHash) {
						oRoute = findRouteByIdentifier(oParsedHash.sIdentifier);

						if (oRoute) {
							oRoute.action.apply(null, [oParsedHash.oStateData, sNavType]);
						}
					} else {
						Log.error("hash format error! The current Hash: " + sHash);
					}

				}
			}
		}
1107261
def update(other_hash)
      other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
      self
    end
917489
function (target) {
        var element = this.hashForMethods[target.id]
        if (element) {
            element.paused = false
        }

        var elementUpdate = this.hashForUpdates[target.id]
        //console.log('foo', target.id, elementUpdate)
        if (elementUpdate) {
            elementUpdate.paused = false
        }
    }
737493
function () {
		this._super.onready ();
		this.element.tabIndex = 0;
		this._doctitle ( location.hash );
		this.event.add ( "hashchange", window );
	}
752614
def update(hash = {})
      hash.each do |k,v|
        # The name of the setter for the value of k
        setter = "#{k}="

        # Check if there is a matching setter
        if self.respond_to?(setter)
          # Yes, there is. Call the setter with the value
          self.send(setter, v)
        end
      end

      self
    end
479885
void updateReplace() {

        boolean replace = m_replace.getValue().booleanValue();

        m_replaceResource.setVisible(replace ? SearchType.resourcetype.equals(m_searchType.getValue()) : replace);
        m_replacePattern.setVisible(
            replace
            ? !SearchType.resourcetype.equals(m_searchType.getValue())
                & !SearchType.renameContainer.equals(m_searchType.getValue())
            : replace);

        m_newName.setVisible(replace ? SearchType.renameContainer.equals(m_searchType.getValue()) : replace);
        m_oldName.setVisible(replace ? SearchType.renameContainer.equals(m_searchType.getValue()) : replace);

        m_workProject.setVisible(replace);

        m_search.setCaption(
            replace
            ? CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_REPLACE_0)
            : CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_SEARCH_0));

    }
1282952
def insert(self, key, value):
        ''''''

        # Add to history and catch expectorate
        if len(self.history) == self.maxsize:
            expectorate = self.history[0]
        else:
            expectorate = None

        self.history.append((key, value))

        # Add to the appropriate list of values
        if key in self:
            super().__getitem__(key).append(value)
        else:
            super().__setitem__(key, [value])

        # Clean up old values
        if expectorate is not None:
            old_key, old_value = expectorate
            super().__getitem__(old_key).pop(0)
            if len(super().__getitem__(old_key)) == 0:
                super().__delitem__(old_key)

            return (old_key, old_value)
1291197
def update_keys!(&block)
      @copied_object = copied_object.each_with_object({}) do |pair, memo|
        key = pair.first
        new_key = block.call(key)
        value = pair.last
        if value.is_a?(Footing::Hash)
          memo[new_key] = value.update_keys!(&block)
        elsif value.is_a?(::Array)
          memo[new_key] = value.map do |val|
            if val.is_a?(Footing::Hash)
              val.update_keys!(&block)
            else
              val
            end
          end
        else
          memo[new_key] = value
        end
      end

      self
    end
1204838
function () {
		this._super.onready ();
		var fetch = function () {
			var hash = location.hash;
			if ( hash ) {
				this._fetch ( hash.substring ( 1 ));
			}
		}.bind ( this );
		window.addEventListener ( "hashchange", fetch );
		fetch ();
	}
612185
def update
      @script_listing.user_id = current_user.id
      @script_listing.org_id = current_user.org_id
      if @script_listing.update(script_listing_params)
        redirect_to script_listings_path, notice: 'Listing was successfully updated.'
      else
        render :edit
      end
    end
12624
function(){
    var curHash = $location.hash();
    angular.forEach(hashFragmentKeys,function(hashKey){
      var re = new RegExp('&'+hashKey+'(=[^&]*)?|^'+hashKey+'(=[^&]*)?&?');
      curHash = curHash.replace(re,'');
    });

    $location.hash(curHash);
  }
1317646
function( historyEntry, direction ) {
                    // make sure to create a new object to pass down as the navigate event data
                    event.hashchangeState = $.extend({}, historyEntry);
                    event.hashchangeState.direction = direction;
                }
1280685
def add_locations(hash)
      hash.each do |attribute_name, locations|
        find(attribute_name).add_locations(locations)
      end
    end
507883
def AddHashEntry(self, hash_entry, timestamp):
    """"""

    if timestamp in self._hash_entries:
      message = ("Duplicated hash entry write for path '%s' of type '%s' at "
                 "timestamp '%s'. Old: %s. New: %s.")
      message %= ("/".join(self._components), self._path_type, timestamp,
                  self._hash_entries[timestamp], hash_entry)
      raise db.Error(message)

    if timestamp not in self._path_infos:
      path_info = rdf_objects.PathInfo(
          path_type=self._path_type,
          components=self._components,
          timestamp=timestamp,
          hash_entry=hash_entry)
      self.AddPathInfo(path_info)
    else:
      self._path_infos[timestamp].hash_entry = hash_entry
154561
def add_entry(id, title, updated, link, options={})
      entries << {
        :id => id,
        :title => title,
        :updated => updated,
        :link => link
        }.merge(options)
    end