configuration-files

Java equivalent to app.config?

六眼飞鱼酱① 提交于 2019-12-02 23:47:28
Is there a Java equivalent to .NET's App.Config? If not is there a standard way to keep you application settings, so that they can be changed after an app has been distributed? For WebApps, web.xml can be used to store application settings. Other than that, you can use the Properties class to read and write properties files. You may also want to look at the Preferences class, which is used to read and write system and user preferences. It's an abstract class, but you can get appropriate objects using the userNodeForPackage(ClassName.class) and systemNodeForPackage(ClassName.class) . To put

How to get Grails application name within Config.groovy?

被刻印的时光 ゝ 提交于 2019-12-02 23:42:16
I want to include the Grails application name in some of my configuration settings in grails-app/Config.groovy . I've tried many ways without success. For example, if I have the following in my Config.groovy , edu.appname1 = "${grailsApplication.metadata.'app.name'}" edu.appname2 = "${application.metadata.'app.name'}" edu.appname3 = "${metadata.'app.name'}" edu.appname4 = "${app.name}" I can run these statements in the Grails console def edu = grailsApplication.config.edu println "${'''${grailsApplication.metadata.'app.name'} -> '''}${edu.appname1}" println "${'''${application.metadata.'app

How do you configure Firefox to allow Javascript to intercept a value pasted from the clipboard?

狂风中的少年 提交于 2019-12-02 23:14:46
I need to filter out certain characters when a user pastes from the clipboard. (I don't actually want to modify what's in the clipboard.) I already have this working in IE. Sigh ... tl;dr: capability.policy items in user.js make it into prefs.js but aren't taking effect. FYI, I can reasonably have all users install user.js . But none of us have admin access to our machines, so that's about all I can do regarding configuration. Thanks for any help! Note: For the purposes of this question, I do not want to "get around" accessing the clipboard -- E.g., I do not want to operate on the value of the

Proper implementation of global configuration

萝らか妹 提交于 2019-12-02 22:40:51
My goal is to have global constants in a C++ game I'm working on (to represent some graphics info and the like). My current implementation is to toss them all in a .h and include them everywhere. This works, except that every time I change a setting, the entire code base must be recompiled. So, my next idea was to toss them in some configuration txt file and parse them in, that way no code is actually changed when settings change. The parser was simple enough, and I could put the values into the constants, but because the parser was a code block, the constants were no longer global. Is there a

How do you prevent the IIS default site web.config file being inherited by virtual directories?

旧巷老猫 提交于 2019-12-02 21:49:38
I have the following code in a web.config file of the default IIS site. <httpModules> <add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/> </httpModules> Then when I setup and browse to a virtual directory I get this error Could not load file or assembly 'Charts' or one of its dependencies. The system cannot find the file specified. The virtual directory is inheriting the modules from the default web.config. How do you stop this inheritance? I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications

Internationalization on CodeIgniter config files?

不问归期 提交于 2019-12-02 21:47:51
问题 I'm trying to do something like: $config['first_link'] = 'lang:pagination_first_link'; $config['prev_link'] = 'lang:pagination_prev_link'; $config['next_link'] = 'lang:pagination_next_link'; $config['last_link'] = 'lang:pagination_last_link'; Is there a simple way to do this ? This configuration is specific to the Pagination config file, but the question is generic. 回答1: You have language folders for that. If you take a look at system/language/english, you can see how CodeIgniter deals with

How to create a custom yaml config file in Symfony

守給你的承諾、 提交于 2019-12-02 20:37:36
What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directory and added the following at the top of the file: config/something.yml: class: sfDefineEnvironmentConfigHandler param: prefix: something_ But if I'm calling sfConfig::get("something_foo"); I keep getting NULL . What did I do wrong? I just want to read values, so no need to

Application configuration files [closed]

北城以北 提交于 2019-12-02 19:58:01
OK, so I don't want to start a holy-war here, but we're in the process of trying to consolidate the way we handle our application configuration files and we're struggling to make a decision on the best approach to take. At the moment, every application we distribute is using it's own ad-hoc configuration files, whether it's property files (ini style), XML or JSON (internal use only at the moment!). Most of our code is Java at the moment, so we've been looking at Apache Commons Config , but we've found it to be quite verbose. We've also looked at XMLBeans , but it seems like a lot of faffing

python single configuration file

♀尐吖头ヾ 提交于 2019-12-02 17:35:21
I am developing a project that requires a single configuration file whose data is used by multiple modules. My question is: what is the common approach to that? should i read the configuration file from each of my modules (files) or is there any other way to do it? I was thinking to have a module named config.py that reads the configuration files and whenever I need a config I do import config and then do something like config.data['teamsdir'] get the 'teamsdir' property (for example). response : opted for the conf.py approach then since it it is modular, flexible and simple I can just put the

iOS Application Configuration File

放肆的年华 提交于 2019-12-02 17:28:44
In a C# application I always used an app.config file to save some data for my application to load when needed (e.g Connection String). What is the best way to save information like this in an iOS application? Rafael Steil You can create a property list file (there is a template for that in XCode, just to to File -> New file and choose there), so you will have something like "settings.plist", or anything like that. You can think of a plist as being a key => value config file, with the difference that you can also hold arrays and dictionaries, besides plain text as value. Use NSBundle to load