Renaming applications in IIS 7.0

I recently had to do this and I think you are better off using appcmd because ,as you said, we don’t know what other changes may occur behind the scenes Example, appcmd list app APP “Default Web Site/” (applicationPool:DefaultAppPool) APP “Default Web Site/develop” (applicationPool:mypool) APP “Default Web Site/develop/xyz” (applicationPool:mypool) In my case, I did have … Read more

Python: Rename duplicates in list with progressive numbers without sorting list

My solution with map and lambda: print map(lambda x: x[1] + str(mylist[:x[0]].count(x[1]) + 1) if mylist.count(x[1]) > 1 else x[1], enumerate(mylist)) More traditional form newlist = [] for i, v in enumerate(mylist): totalcount = mylist.count(v) count = mylist[:i].count(v) newlist.append(v + str(count + 1) if totalcount > 1 else v) And last one [v + str(mylist[:i].count(v) … Read more

Override a pytest parameterized functions name

You’re looking for the ids argument of pytest.mark.parametrize: list of string ids, or a callable. If strings, each is corresponding to the argvalues so that they are part of the test id. If callable, it should take one argument (a single argvalue) and return a string or return None. Your code would look like @pytest.mark.parametrize( … Read more

How do I move file a to a different partition or device in Node.js?

You need to copy and unlink when moving files across different partitions. Try this, var fs = require(‘fs’); //var util = require(‘util’); var is = fs.createReadStream(‘source_file’); var os = fs.createWriteStream(‘destination_file’); is.pipe(os); is.on(‘end’,function() { fs.unlinkSync(‘source_file’); }); /* node.js 0.6 and earlier you can use util.pump: util.pump(is, os, function() { fs.unlinkSync(‘source_file’); }); */

Rename multiple files in cmd

Make sure that there are more ? than there are characters in the longest name: ren *.txt “???????????????????????????? 1.1.txt” See How does the Windows RENAME command interpret wildcards? for more info. New Solution – 2014/12/01 For those who like regular expressions, there is JREN.BAT – a hybrid JScript/batch command line utility that will run on … Read more

Rename or remove prefix for multiple files to each ones’ number in Windows

A much simpler solution is provided in https://superuser.com/a/871799/497147 I copied it here for easier access. Forget about complicated scripts for this. rename is a very old and never properly completed command. If you do not use it properly, the result might surprise you. For example to remove a prefix abcd from abcd1.txt, abcd2.txt, abcd3.txt etc. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)