Is there a cross-platform way of getting information from Python’s OSError?

The errno attribute on the error should be the same on all platforms. You will get WindowsError exceptions on Windows, but since this is a subclass of OSError the same “except OSError:” block will catch it. Windows does have its own error codes, and these are accessible as .winerror, but the .errno attribute should still … Read more

How do I compile a .java with support for older versions of Java?

Yes, you can set the version of compiler at compile time. And compile your java code into old versions of java. From Oracle article : http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javac.html Cross-Compilation Example Here we use javac to compile code that will run on a 1.4 VM. % javac -target 1.4 -bootclasspath jdk1.4.2/lib/classes.zip \ -extdirs “” OldCode.java You might also … Read more

What is the most portable/cross-platform way to represent a newline in go/golang?

I got curious about this so decided to see what exactly is done by fmt.Println. http://golang.org/src/pkg/fmt/print.go If you scroll to the very bottom, you’ll see an if addnewline where \n is always used. I can’t hardly speak for if this is the most “cross-platform” way of doing it, and go was originally tied to linux … Read more

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