Reading a .pdb file

If you mean PDB as in a “program database” that the debugger uses: PDB files contain data about a file such as an EXE or DLL that is used to aid in debugging. There are public interfaces that allow you to extract data from the file. See examples here: https://learn.microsoft.com/en-us/archive/blogs/jmstall/sample-code-for-pdb-2-xml-tool (Moved from http://blogs.msdn.com/jmstall/archive/2005/08/25/pdb2xml.aspx) http://www.codeproject.com/KB/bugs/PdbParser.aspx If … Read more

Log4Net config in external file does not work

Do you have the following attribute in your AssemblyInfo.cs file: [assembly: log4net.Config.XmlConfigurator(ConfigFile = “Log4Net.config”, Watch = true)] and code like this at the start of each class that requires logging functionality: private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); I have a blog post containing this and other info here.

How to check if a file exists in Go?

To check if a file doesn’t exist, equivalent to Python’s if not os.path.exists(filename): if _, err := os.Stat(“/path/to/whatever”); errors.Is(err, os.ErrNotExist) { // path/to/whatever does not exist } To check if a file exists, equivalent to Python’s if os.path.exists(filename): Edited: per recent comments if _, err := os.Stat(“/path/to/whatever”); err == nil { // path/to/whatever exists } … Read more

Force download of ‘data:text/plain’ URL

As of now, it has been made possible to use <a download> in Chrome. Using dispatchEvent, you can download any string as file (even with a custom filename) whenever you want. Here’s a utility function to use it: var downloadFile = function(filename, content) { var blob = new Blob([content]); var evt = document.createEvent(“HTMLEvents”); evt.initEvent(“click”); $(“<a>”, … Read more

tech