Do any pattern exists for renaming live a MongoDB collection?

Do any pattern exists for renaming a MongoDB collection live in production environment? The collection is accessed both for reading and for writing in a non sharded environment. The requirement is to not have downtime. Some different microservices access the collection in different ways. The result must be obtained in a progressive way, releasing updated services independently from each other.

For relational databases several patterns were discovered and documented in the excellent book Refactoring Databases: Evolutionary Database Design by Scott Ambler and Pramod Sadalage and I would have used the Rename Table pattern to implement if the database was relational, that but it seems that with MongoDB this is not possible.

Renaming post formats after Gutenberg

I have renamed my post formats before, but since the Gutenberg update it doesn’t work anymore.

I tried Aaron’s translation-solution from the link below, but WordPress doesn’t use the translations in the back end. Is there a new way to do this? I am not experienced enough to be able to dig this out of WordPress myself.

The link: Is it possible to rename a post format?

This is my attempt:

function rename_post_formats( $  translation, $  text, $  context, $  domain ) {    $  names = array(     'Aside'  => 'Breaking News',     'Status' => 'Notice'   );    if ( $  context == 'Post format' ) {      $  translation = str_replace( array_keys($  names), array_values($  names), $  text );      var_dump( $  translation );   } return $  translation;  } add_filter( 'gettext_with_context', 'rename_post_formats', 10, 4 ); 

When I var_dump $ translation after doing the str_replace, it contains the new names, but WordPress doesn’t use it. Also, weirdly, it is dumped 5 times in a row (don’t know if that helps).

Help would be greatly appreciated!

Prevent renaming Shared Documents in a Teams site

Our users tend to rename the “Shared Documents” library in the SharePoint view of a Teams site. This of course causes Teams to break. Acutally, I am not really sure, how they do it, I don’t see any way to change the name and the url of an existing document library. But, what is more important, I would like to prevent this. How can I forbid users to make changes in a Teams site that would break the application working properly? Including, but probably not limited to change the url of the Shared Documents library and the General folder. Thank you for any advice.

edit: Now I know, they mapping the sites as network share and since “Shared Documents” says nothing, the give the “folder” (that is actually the library) a more meaningful name.

What are the dangers of renaming spells and changing their flavour, without changing mechanics at all?

I’m about to help get a bunch of interested new players into D&D, running a one-shot for them to give them a feel for the game and hopefully a fun first-taste of tabletop roleplaying.

Before starting, I’ve been asking them what kinds of things they want to get out of the game, and what their expectations are. In particular, as I’m going to pre-gen characters to simplify things, I’ve asked what kinds of character they find appealing.

However, the flavour of things that they want to play aren’t necessarily supported by the PHB – but at the same time I’d rather steer clear of homebrew as far as mechanics go. For example, one player who is interested in being “some kind of magic user that exploits darkness-like-effects”.

For an example spell: turn flaming sphere into a sphere of darkness that engulfs those it touches, absorbing the life straight from their skin. But it still does 2d6 fire damage.

I don’t plan to change damage types as this feels like a bigger can of worms. Fire-damage would still apply, but would be described as darkness eating into the target/wrapping round “like flames”. It would also mean that oil and flammable items would be affected in a similar way to fire.

That’s just one example though. Since I’d be doing this with more spells my question isn’t about one specific spell.

My question is: What dangers, if any, are there of renaming existing spells and changing their flavour text while using their existing mechanics?

Renaming column in Content Type

I want to rename a column which is associated to Content Type i used the following to update all the columns which contains the column in the list but forgot to update the column name in the content type and not sure how to approach it

$ SiteURL = “http://pnpdemo” $ OldColumnName =”Target Folder” $ NewColumnName =”New Target Folder”

$ site = Get-SPSite $ SiteURL foreach ($ web in $ site.AllWebs) {

$ ListsToProcess= @()

$ Lists = $ web.Lists

 foreach ($  list in $  lists)  {       foreach ($  column in $  list.Fields)      {           if ($  column.Title -eq $  OldColumnName)          {                Write-Host "Found the Column in list: " $  list.Title " at "$  web.Url                #Send it to an Array                $  ListsToProcess+=$  List          }      }  } 

foreach ($ list in $ ListsToProcess) {

     $  column = $  list.fields | where {$  _.Title -eq $  OldColumnName}        $  column.Title = $  NewColumnName      $  column.Update() 

} $ web.Dispose() } $ site.Dispose()

Renaming multiple files at once, with the same extension

I’m currently in a situation, where I need to rename a bunch of files, inside different folders, with the same extension (SRT).

Currently, my directory “setup” is like this:

This is a folder (2000)    - This.is.a.folder.2000      - This.is.a.folder.2000.wmv      - This.is.a.folder.2000.txt      - This.is.a.folder.2000.srt  This is also a folder (2001)    - This.is.also.a.folder.2001      - This.is.also.a.folder.2001.wmv      - This.is.also.a.folder.2001.txt      - This.is.also.a.folder.2001.srt 

And I need to rename the SRT files to be like so:

This is a folder (2000)    - This.is.a.folder.2000      - This.is.a.folder.2000.wmv      - This.is.a.folder.2000.txt      - This.is.a.folder.2000.en.srt  This is also a folder (2001)    - This.is.also.a.folder.2001      - This.is.also.a.folder.2001.wmv      - This.is.also.a.folder.2001.txt      - This.is.also.a.folder.2001.en.srt 

Is there any way to go about this? I’m running an Ubuntu server, with only a terminal available.

If anyone can help me with this, I would be very grateful :).

Writing a pandas dataframe to a csv file and renaming on a for loop

I have a script that reads SQL db to a pandas data frame which is then concatenated together to form one dataframe on a loop. I need to write this second data frame to a csv file and rename this from a list of ID’s

I am using pd.to_csv to write the file and os.rename to change the name.

for X, df in d.iteritems():     newdf = pd.concat(d)     for X in newdf:                 export_csv = newdf.to_csv (r'/Users/uni/Desktop/corrindex+id/X.csv', index = False, header = None)                 for X in NAMES:                     os.rename ('X.csv',X) 

This is the code that concatenates the data frames together. In the third loop, NAMES = ‘rt35’ but in the future this will be a list of similar names.

I expect to get a file named rt35.csv. However I either get r.csv or X.csv and this error:

OSError: [Errno 2] No such file or directory 

The files are writing correctly, the only issue is the name.

Renaming images in Google Photos

How can I rename an image in Google Photos? From the web browser, I can add a description, but when I download the image, it uses the original file name. I need a real rename which changes the name such that if I download the image it retains the new name on download. I tried changing the name from Google Drive, but it did not propagate to Google Photos. Maybe it will do so eventually if I wait long enough???

I have hundreds of gigabytes of images stored in Google Photos, so downloading everything, changing the names locally, and then uploading isn’t an option. Additionally, it would be ridiculous to just change a few megabytes of actual data.

For the time being, and as a workaround, it appears that I have to disable sync on my Pixel phone until I have had a chance to rename them locally, and then sync in batches. This defeats the main feature of immediate back up of new images I take.

How can I rename images in Google Photos after I have already uploaded them without needing to do an expensive download + re-upload?

Finding and Renaming Mislabeled Duplicates

I inadvertently formatted a Time Machine backup external hard drive. I was able to recover many of the files, but not the names of those files.

All of the recovered files have generic names like “file01010101.doc”, which is not helpful. In order to know which files are duplicates, I need to compare the recovered files the originals I have on my machine, and have them renamed accordingly. Then, any files that still have a generic name must be unique and not a duplicate.

Question: How do I do this automatically? Is there a program, bash script, or Automator action that can do duplicate file finding and renaming? There’s almost 500,000 files, so doing this manually is not practical.