application context. What is this?

@feak gives a straight answer about the meaning of ApplicationContext in terms of Spring. In short, it is an object that loads the configuration (usually a XML file annotation based) and then Spring will start managing the beans and its benefits: Beans declared in package Beans declared by annotations Constructor and method autowiring Bean injection … Read more

How to validate structure (or schema) of dictionary in Python?

You may use schema (PyPi Link) schema is a library for validating Python data structures, such as those obtained from config-files, forms, external services or command-line parsing, converted from JSON/YAML (or something else) to Python data-types. from schema import Schema, And, Use, Optional, SchemaError def check(conf_schema, conf): try: conf_schema.validate(conf) return True except SchemaError: return False … Read more

How to use ConfigurationManager

Okay, it took me a while to see this, but there’s no way this compiles: return String.(ConfigurationManager.AppSettings[paramName]); You’re not even calling a method on the String type. Just do this: return ConfigurationManager.AppSettings[paramName]; The AppSettings KeyValuePair already returns a string. If the name doesn’t exist, it will return null. Based on your edit you have not … Read more

Should server/database config files, including passwords, be stored in source control?

There’s no single “silver bullet” answer here and it would all greatly depend on details. First of all, I consider best practice to separate all source code from configuration in separate repository. So, source code remains source code, but it’s installation or deployment (with configuration, passwords, etc) is the whole other thing. This way you’ll … Read more

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