Installing a configuration profile on iPhone – programmatically

1) Install a local server like RoutingHTTPServer 2) Configure the custom header : [httpServer setDefaultHeader:@”Content-Type” value:@”application/x-apple-aspen-config”]; 3) Configure the local root path for the mobileconfig file (Documents): [httpServer setDocumentRoot:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]]; 4) In order to allow time for the web server to send the file, add this : Appdelegate.h UIBackgroundTaskIdentifier bgTask; Appdelegate.m – (void)applicationDidEnterBackground:(UIApplication … Read more

Which design patterns can be applied to the configuration settings problem?

I prefer to create an interface for setting query, loading, and saving. By using dependency injection, I can inject this into each component that requires it. This allows flexibility in terms of replacing the configuration strategy, and gives a common base for everything to work from. I prefer this to a single, global “settings loader” … Read more

Which is the best way to allow configuration options be overridden at the command line in Python?

I just discovered you can do this with argparse.ArgumentParser.parse_known_args(). Start by using parse_known_args() to parse a configuration file from the commandline, then read it with ConfigParser and set the defaults, and then parse the rest of the options with parse_args(). This will allow you to have a default value, override that with a configuration file … Read more

At what point does a config file become a programming language?

Very interesting questions! I tend to limit my config files to a very simple “key=value” format, because I fully agree with you that config files can very quickly become full-blown programs. For example, anyone who has ever tried to “configure” OpenSER knows the feeling you are talking about: it’s not configuration, it’s (painful) programming. When … Read more

Why does Visual Studio tell me that the AddJsonFile() method is not defined?

You need to include the Microsoft.Extensions.Configuration.Json NuGet package if you want to call the .AddJsonFile() method. See: https://github.com/aspnet/Configuration/tree/dev/src/Microsoft.Framework.ConfigurationModel.Json For further reading, here’s a nice tutorial: ASP.NET vNext Moving Parts: IConfiguration.

Preserve case in ConfigParser?

The documentation is confusing. What they mean is this: import ConfigParser, os def get_config(): config = ConfigParser.ConfigParser() config.optionxform=str try: config.read(os.path.expanduser(‘~/.myrc’)) return config except Exception, e: log.error(e) c = get_config() print c.options(‘rules’) I.e. override optionxform, instead of calling it; overriding can be done in a subclass or in the instance. When overriding, set it to a … Read more

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