Re-order columns of table in Oracle

Since the release of Oracle 12c it is now easier to rearrange columns logically. Oracle 12c added support for making columns invisible and that feature can be used to rearrange columns logically. Quote from the documentation on invisible columns: When you make an invisible column visible, the column is included in the table’s column order … Read more

Json.net rename properties

I would suggest reconstructing your JSON with renamed properties. I don’t think you should worry about speed penalties as it’s usually not an issue. Here’s how you can do it. public static JToken Rename(JToken json, Dictionary<string, string> map) { return Rename(json, name => map.ContainsKey(name) ? map[name] : name); } public static JToken Rename(JToken json, Func<string, … Read more

Batch rename sequential files by padding with zeroes

Python import os path=”/path/to/files/” for filename in os.listdir(path): prefix, num = filename[:-4].split(‘_’) num = num.zfill(4) new_filename = prefix + “_” + num + “.png” os.rename(os.path.join(path, filename), os.path.join(path, new_filename)) you could compile a list of valid filenames assuming that all files that start with “output_” and end with “.png” are valid files: l = [(x, “output” … Read more

using header() to rewrite filename in URL for dynamic pdf

Try: header(‘Content-Disposition: attachment; filename=”July Report.pdf”‘); or header(‘Content-Disposition: inline; filename=”July Report.pdf”‘); Another option would be to use the $_SERVER[‘PATH_INFO’] to pass your “July Report.pdf” – an example link might be: <a href=”https://stackoverflow.com/questions/2015985/report_pdf.php/July%20Report.pdf?month=07″> That file should default to saving as “July Report.pdf” – and should behave exactly like your old php script did, just change the code … Read more

Renaming a directory in C# [closed]

There is no difference between moving and renaming; you should simply call Directory.Move. In general, if you’re only doing a single operation, you should use the static methods in the File and Directory classes instead of creating FileInfo and DirectoryInfo objects. For more advice when working with files and directories, see here.