configuration-files

Adding and reading from a Config file

喜你入骨 提交于 2019-12-17 15:15:42
问题 I have created a C# console based project . In that project i have some variables like companyName , companyType which are Strings. companyName="someCompanyName"; companyType="someCompanyType"; I need to create a config file and read values from it, and then initialize the variables companyName , companyType in the code. How can i create a config file (or equivalent) ? How can i read from the config file ? 回答1: Add an Application Configuration File item to your project (right click project >

What's in an Eclipse .classpath/.project file?

↘锁芯ラ 提交于 2019-12-17 02:52:48
问题 We recently had an issue with an Eclipse project for one of our team members. Tomcat was not deploying JARs of the application. We eventually noticed the .classpath Eclipse file was not the same as for the team members where the project was OK. We replaced the .classpath file with one from a project that was OK and the Tomcat deploy was complete. Just out of curiosity and to know at what to look in the future if something is wrong, what is inside the .classpath and .project files. What can I

How to implement a ConfigurationSection with a ConfigurationElementCollection

主宰稳场 提交于 2019-12-17 02:06:21
问题 I am trying to implement a custom configuration section in a project and I keep running up against exceptions that I do not understand. I am hoping someone can fill in the blanks here. I have App.config that looks like this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ServicesSection" type="RT.Core.Config.ServicesConfigurationSectionHandler, RT.Core"/> </configSections> <ServicesSection type="RT.Core.Config.ServicesSection, RT.Core"> <Services>

passenger phusion spawning error with rails app

拥有回忆 提交于 2019-12-14 02:27:48
问题 I'm running a rails 4 app on apache/passenger/ubuntu. The app runs fine when I comment out the config_serve.static.assets line in config/environments/production.rb, like this: # Disable Rails's static asset server (Apache or NGINX will already do this). # config.serve_static_assets = false Although it works, commenting out this line seems to be a bad idea, as I've read that the default value of the config variable is true, and it's supposed to be set to false when you're running an app behind

How to split a nginx virtual host (config) file into small ones using shell

孤街醉人 提交于 2019-12-14 02:24:26
问题 I have a nginx server and it has around 30+ virtual host block in a single file. All the virtual host block go like that: server { #concrete configuration items server_name myserver.hostname.com; #concrete configuration items #and so on.... } My question is how can I split every server block into a single file named by server_name value? for example the above server block save to a file named myserver.hostname.com.conf I would like to use shell code to complete this task. By the way, I not

Open a Configuration Profile through app

ε祈祈猫儿з 提交于 2019-12-14 02:15:00
问题 I have a .mobileconfig file in one URL. I am sending the Http post from xcode(When a button is clicked), the http post contains the .mobileconfig url. Can i download that file when the button is clicked ? 回答1: When it comes to serving up this file. It needs to be served up with a MIME Content-Type of application/x-apple-aspen-config . You may be able to do this by adding a line to your server's configuration or .htaccess file in the folder with: <IfModule mod_mime.c> AddType application/x

Mixing declarative and imperative JCache configurations

∥☆過路亽.° 提交于 2019-12-14 02:12:22
问题 I'm trying to setup (J)caches in a mix of declarative and imperative configuration, as the JCache standard doesn't provide a means to limit the max size a cache can occupy. I want to do it as much "provider independent" as possible, so I have the flexibility to change provider in the future. Currently I have the limitation of using Java 7, so Caffeine is discarded, I believe. I keep a list of the caches and the duration (TTL) for their entries in my application.yaml, which I get with a

ConfigurationManager.AppSettings.Settings.Add() appends value on each run

旧巷老猫 提交于 2019-12-13 18:12:57
问题 I have the following piece of code. Every time, I run the C# project the values for the app settings key gets appended. var configSettings = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); configSettings.AppSettings.Settings.Add("Key", "Value"); configSettings.Save(ConfigurationSaveMode.Full, true); ConfigurationManager.RefreshSection("appSettings"); 1st run: Key: Value 2nd run: Key, Value, Value Why are the values getting appended? I need it to start on a clean plate

list is coming as blank in python

拈花ヽ惹草 提交于 2019-12-13 18:06:55
问题 I am trying to use "directory path" and "prefirx_pattern" from config file. I get correct results in vdir2 and vprefix2 variable but list local_file_list is still empty. result vdir2 is"/home/ab_meta/abfiles/" vprefix2 is "rp_pck." [] code def get_files(self): try: print "vdir2 is" + os.environ['dir_path'] print "vprefix2 is "+ os.environ['prefix_pattern'] local_file_list = filter(os.path.isfile, glob.glob(os.environ['dir_path'] + os.environ['prefix_pattern'] + "*")) print local_file_list

Reading variables from text file

﹥>﹥吖頭↗ 提交于 2019-12-13 16:25:58
问题 I have a problem in c++, and I hope that some expert here could help me. the problem is, there is a .txt file, that has some information. I want to write a program that uses this information. the .txt file will be like this: variable 1: 711 variable 2: [8 5 6 11] variable 3: xyz zyx yyy the program should read the values from the file and then use them, any idea how to do it ?!! / * UPDATE * / what should be done is to read from the text file the numerical values, only the numerical values of