Search Results

Search found 15209 results on 609 pages for 'configuration'.

Page 8/609 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Configuration file reading. Best practice

    - by Andrew Florko
    Application stores configuration data in custom section of configuration file. This information is used all over the application. Nowadays I use helper static class to to provide access like this (some code omitted or simplified): [XmlRoot("webSiteSection")] public class WebSiteConfig : IConfigurationSectionHandler { public static WebSiteConfig Current { get { if (_current == null) _current = (WebSiteConfig) ConfigurationManager.GetSection("webSiteSection"); return _current; } } [XmlElement("section1")] public Section1 Section1 { get; set; } [XmlElement("section2")] public Section2 Section2 { get; set; } ... public object Create(object parent, object configContext, XmlNode section) { var serializer = new XmlSerializer(typeof(WebSiteConfig)); return serializer.Deserialize(new XmlNodeReader(section)); } } Then I use it like this <%: WebSiteConfig.Current.Section1.Value1 %> <%: WebSiteConfig.Current.Section1.Value2 %> What do you think of it? I find it usable because it keeps code simple, but also confused as IConfigurationSectionHandler is deprecated since .NET Framework 2.0

    Read the article

  • How to load a configuration file at startup within tomcat

    - by Alex
    I want to be able to load my configuration for the webapp at startup of tomcat (apache commons configuration library) is this a possible way: public class MyAppCfg implements javax.servlet.ServletContextListener { private ServletContext context = null; @Override public void contextInitialized(ServletContextEvent event) { try{ this.context = event.getServletContext(); XMLConfiguration config = new XMLConfiguration("cfg.xml"); config.setReloadingStrategy(new FileChangedReloadingStrategy()); this.context.setAttribute("mycfg", config); } catch (Exception e) { e.printStackTrace(); } } @Override public void contextDestroyed(ServletContextEvent arg0) { this.context = null; } } web.xml <listener> <listener-class>mypackage.MyAppCfg</listener-class> </listener> and later acces them in the webapp via this.cfg = (XMLConfiguration) servletRequest.getAttribute("mycfg");

    Read the article

  • Server-side application configuration security. Best practices

    - by Andrew Florko
    We publish server-side application to our customer workstation and customer's security guys are concerned about configuration connection strings safety. Connection strings are stored as plain text right now, but as configuration file is not in the public/shared folder we supposed that workstation security itself is enough. What are the ways to improve connection strings security further? It is a big step forward to encrypt password and keep a decryption key on the same workstation? What are the steps we can take to keep connection strings (and alike) information more and more securable? Thank you in advance!

    Read the article

  • Git - Committing Machine Specific Configuration Files

    - by Gordon
    A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always accidentally check them back in and break someone else's configuration. A simple solution to this would be to just not check them in to Git, or even to additionally add a .gitignore entry for them. However, I find that it is much more elegant to have some sensible defaults in the file which the developer can modify to suit his needs. Is there an elegant way to make Git play nicely with such files? I would like to be able to modify a machine-specific configuration file and then be able to run "git commit -a" without checking that file in.

    Read the article

  • Best practice for passing configuration to each GUI object

    - by Laimoncijus
    Hi, I am writing an application, where I do have few different windows implemented, where each window is a separate class. Now I need somehow to pass a single configuration object to all of them. My GUI is designed in way, where I have one main window, which may create some child windows of its own, and these child windows can have their own childs (so there is no possibility to create all windows in initialization part and feed the config object to all of them from the very beginning)... What would be best practice for sharing this configuration object between them? Always passing via constructor or maybe making it somewhere as final public static and let each window object to access it when needed? Thanks

    Read the article

  • Configuration of Application (MVC)

    - by Felipe
    Hi all. I have an application in asp.net mvc 2, and in this application, there are some parts that need to obey an configuration, for example. The app has an document management and the number of document (a field of my domain), need to be manual or automatic, and this choise will be consider in configuration. So, is there any pratice to do this? Need I render the number field (with hidden fields) in my View or it's not necessary? ViewData["key"] is recommended to make the form ? Thanks! Cheers

    Read the article

  • NHibernate L2 Cache - fluent nHibernate configuration

    - by AWC
    I've managed to configure the L2 cache for Get\Load in FHN, but it's not working for queries configured using the ICriteria interface - it doesn't cache the results from these queries. Does anyone know why? The configurations are as follows: ICriteria: return unitOfWork .CurrentSession .CreateCriteria(typeof(Country)) .SetCacheable(true); Entity Mapping: public sealed class CountryMap : ClassMap<Country>, IMap { public CountryMap() { Table("Countries"); Not.LazyLoad(); Cache.ReadWrite().IncludeAll(); Id(x => x.Id); Map(x => x.TwoLetter); Map(x => x.ThreeLetter); Map(x => x.Name); } } And the session factory configuration for the database property: return () => MsSqlConfiguration.MsSql2005 .ConnectionString(BuildConnectionString()) .ShowSql() .Cache(c => c.UseQueryCache() .QueryCacheFactory<StandardQueryCacheFactory>() .ProviderClass(configuration.RepositoryCacheType) .UseMinimalPuts()) .FormatSql() .UseReflectionOptimizer(); Cheers AWC

    Read the article

  • Removing a platform from Configuration Manager

    - by demoncodemonkey
    I have a solution containing C# and C++/CLI projects. There are 3 platforms in my solution: Any CPU Win32 Mixed Platforms I never want to "just build the C# ones" or "just build the C++ ones", I always want to build all projects. So the platforms metaphor is meaningless to me, I'll leave it on Mixed Platforms or whatever as long as they all build. Now VS sometimes automatically switches the current platform to Any CPU (I'm not sure when or why). This means that pressing F7 will only try to build the C# projects, which is obviously no good. So I have to switch back to Mixed Platforms and try again. So how to workaround this irritating problem? I have tried 2 ways: In Configuration Manager, remove Any CPU and Win32 platforms. This worked until I added a new project and Visual Studio very kindly added them back in... :/ In Configuration Manager, check all checkboxes for all projects in all configurations in all platforms. This becomes a nightmare to manage with many projects in the solution. Any other ideas?

    Read the article

  • Spring annotation-based container configuration context:include & exclude filters

    - by lisak
    Hey, first off I point to the similar question. I spent more than an hour to set this up, but PathMatchingResourcePatternResolver still scans everything. I have one common.xml (that is imported from specific.xml) and a specific.xml bean definition file. The context is loaded from specific.xml. In common.xml there is this element: <context:component-scan base-package="cz.instance.transl"> <context:exclude-filter type="aspectj" expression="cz.instance.transl.model..* &amp;&amp; cz.instance.transl.service..* &amp;&amp; cz.instance.transl.hooks..*"/> </context:component-scan> Where classes in packages like cz.instance.transl.service.* should not be subject of scanning, but everything else in here cz.instance.transl.* should be scanned through. But PathMatchingResourcePatternResolver marks everything as matching resources. It is the same with regex. BTW: in xml style configuration, one can have many components that share a common.xml beans via "import resource" when loading context. How this is done when Annotation-based container configuration is used ?

    Read the article

  • Getting App.config to be configuration specific in VS2010

    - by MarkPearl
    I recently wanted to have a console application that had configuration specific settings. For instance, if I had two configurations “Debug” and “Release”, depending on the currently selected configuration I wanted it to use a specific configuration file (either debug or config). If you are wanting to do something similar, here is a potential solution that worked for me. Setting up a demo app to illustrate the point First, let’s set up an application that will demonstrate the most basic concept. using System; using System.Configuration; namespace ConsoleSpecificConfiguration { class Program { static void Main(string[] args) { Console.WriteLine("Config"); Console.WriteLine(ConfigurationManager.AppSettings["Example Config"]); Console.ReadLine(); } } }   This does a really simple thing. Display a config when run. To do this, you also need a config file set up. My default looks as follows… <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Example Config" value="Default"/> </appSettings> </configuration>   Your entire solution will look as follows… Running the project you will get the following amazing output…   Let’s now say instead of having one config file we want depending on whether we are running in “Debug” or “Release” for the solution configuration we want different config settings to be propagated across you can do the following… Step 1 – Create alternate config Files First add additional config files to your solution. You should have some form of naming convention for these config files, I have decided to follow a similar convention to the one used for web.config, so in my instance I am going to add a App.Debug.config and a App.Release.config file BUT you can follow any naming convention you want provided you wire up the rest of the approach to use this convention. My files look as follows.. App.Debug.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Example Config" value="Debug"/> </appSettings> </configuration>   App.Release.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Example Config" value="Release"/> </appSettings> </configuration>   Your solution will now look as follows… Step 2 – Create a bat file that will overwrite files The next step is to create a bat file that will overwrite one file with another. If you right click on the solution in the solution explorer there will be a menu option to add new items to the solution. Create a text file called “copyifnewer.bat” which will be our copy script. It’s contents should look as follows… @echo off echo Comparing two files: %1 with %2 if not exist %1 goto File1NotFound if not exist %2 goto File2NotFound fc %1 %2 /A if %ERRORLEVEL%==0 GOTO NoCopy echo Files are not the same. Copying %1 over %2 copy %1 %2 /y & goto END :NoCopy echo Files are the same. Did nothing goto END :File1NotFound echo %1 not found. goto END :File2NotFound copy %1 %2 /y goto END :END echo Done. Your solution should now look as follows…   Step 3 – Customize the Post Build event command line We now need to wire up everything – which we will do using the post build event command line in VS2010. Right click on your project and go to it’s properties We are now going to wire up the script so that when we build our project it will overwrite the default App.config with whatever file we want. The syntax goes as follows… call "$(SolutionDir)copyifnewer.bat" "$(ProjectDir)App.$(ConfigurationName).config" "$(ProjectDir)$(OutDir)\$(TargetFileName).config" Testing it If I now change my project configuration to Release   And then run my application I get the following output… Toggling between Release and Debug mode will show that the config file is changing each time. And that is it!

    Read the article

  • How to edit synaptics configuration? xorg.conf way doesen't work

    - by Aldo DeeJay
    I need to bind the TapButton3 as central mouse button so i do: synclient TapButton3=2 it works great but when i restart or wake up from suspension it forgets the setting. i know that i have to create the xorg.conf as follows Section "InputClass" Identifier "touchpad catchall" Driver "synaptics" MatchIsTouchpad "on" Option "TapButton3" "2" EndSection but this doesen't work. anyone can help me? ...please?

    Read the article

  • Is it appropriate to run a complex enterprise-system configuration and migration project in a similar way to a Scrum development project?

    - by AndyM
    I'm just starting out on the implementation of a large enterprise-wide system, which has complex requirements and many stakeholders. The company has been through high-level evaluation and tender process and determined to purchase a highly configurable "off-the-shelf" product rather than building an entirely bespoke system. The system will replace several existing systems and will require a significant amount of data migration. I'm thinking that the implementation of this system (which is expected to take over 2 years) could be run in a similar way to a Scrum software development project. With the first sprints targeted at building the minimal possible functionality needed (across all functional areas), and then iteratively deepening the level of functionality according the stakeholder feedback. I think this will de-risk the project and help ensure a balance of stakeholder needs within the available time. The user stories are still the same, it's just that to implement them we have work within the constraints of the pre-purchased system. When it comes to 'building stuff', instead of writing custom code the team will be configuring the off-the-shelf package, writing data conversion scripts and the like (and it should be a lot quicker!). Does this sound like a sensible approach? Does the Agile approach makes sense here?

    Read the article

  • rake db:migrate gives a uninitialized class variable @@configuration in Rails error

    - by PK
    uninitialized class variable @@configuration in Rails /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:19:in `configuration' /usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl.rb:24 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' This is the initial part of the enviroment.rb: RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| config.gem "oauth", :version => "0.2.7", :lib => "oauth"

    Read the article

  • Castle Windsor XML configuration for WCF proxy using WCF Integration Facility

    - by andreyg
    Hi everybody! Currently, we use programming registration of WCF proxies in Windsor container using WCF Integration Facility. For example: container.Register( Component.For<CalculatorSoap>() .Named("calculatorSoap") .LifeStyle.Transient .ActAs(new DefaultClientModel { Endpoint = WcfEndpoint.FromConfiguration("CalculatorSoap").LogMessages() } ) ); Is there any way to do the same via Windsor XML configuration file. I can't find any sample of this on google. Thanks in advance

    Read the article

  • How can I swap WCF deserializer from configuration

    - by JohnIdol
    I have a problem with WCF deserialization where the client hangs on the response for more than a minute. I'd like to try to swap different deserializers and see if it affects the behavior. Can I swap in/out DataContract/Xml serializers (are there any others?) from configuration, and if so can I do that with any binding, or is that out of control once the service reference is imported? Any help appreciated!

    Read the article

  • Run Configuration Batch Script

    - by Karl
    For the purpose of a demonstration I'm looking for a way to start an eclipse run configuration from outside using a script (e.g. windows batch script). I have no idea if that's possible or how to do it.. Does anybody have an idea?

    Read the article

  • Javascript, language files, configuration

    - by johnnyArt
    I'm building a form validation script for one of my sites, and I thought I'd make the error messages international, meaning that depending on the users language I'd give such or such response. What would the best approach be, for loading a configuration file inside of my class? Right now I'm using the following structure for a single language: const config = { 'errorName' : 'error message', 'errorName2' : 'error message', 'errorName2' : 'error message' } And calling it like this of course: config['errorName']. But I don't know how to load those variables from a file, let's say 'lang/en.js'

    Read the article

  • Castel Windsor XML configuration for WCF proxy using WCF Integration Facility

    - by andreyg
    Hi everybody! Currently, we use programming registration of WCF proxies in Windsor container using WCF Integration Facility. For example: container.Register( Component.For<CalculatorSoap>() .Named("calculatorSoap") .LifeStyle.Transient .ActAs(new DefaultClientModel { Endpoint = WcfEndpoint.FromConfiguration("CalculatorSoap").LogMessages() } ) ); Is there any way to do the same via Windsor XML configuration file. I can't find any sample of this on google. Thanks in advance

    Read the article

  • How to swap WCF deserializer from configuration

    - by JohnIdol
    I have a problem with WCF deserialization where the client hangs on the response for more than a minute. I'd like to try to swap different deserializers and see if it affects the behavior. Can I swap in/out DataContract/Xml serializers (are there any others?) from configuration, and if so can I do that with any binding? Any help appreciated!

    Read the article

  • How to customize android analog clock widget through configuration screen

    - by michJ
    I'm trying to develop my own analog clock widget on the home screen. It's based on the stock ICS analog clock widget, but when added to the homescreen, my widget opens a configuration screen first. On this screen you can choose the color you want the clock to be (through a colorpicker dialog). You also see a preview of the clock in the chosen color on this screen. (See picture). My problem is changing the color of the widget on the home screen to the chosen color (when you hit the apply button). I have three .png files that I use for the dial, hour hand and minute hand. I color them using this code in my widgetconfig class: Drawable dial = getResources().getDrawable(R.drawable.clockbackground); dial.setColorFilter(color, PorterDuff.Mode.MULTIPLY); //hour Drawable hour = getResources().getDrawable(R.drawable.hourhand); hour.setColorFilter(color, PorterDuff.Mode.MULTIPLY); //minute Drawable min = getResources().getDrawable(R.drawable.minutehand); min.setColorFilter(color, PorterDuff.Mode.MULTIPLY); // clock AnalogClock clockpreview = (AnalogClock) findViewById(R.id.ACconfig); clockpreview.setBackgroundDrawable(dial); This works fine because I can find the AnalogClock since it's in the layout xml file of the configuration screen, which I set in the OnCreate() through setContentView(). The problem is that for the clock widget on my screen I have to use RemoteViews. So I tried setting the new background of the clock widget through RemoteViews. But RemoteViews seems too limited to do this. I need something like setTextViewText() but then for the background of my analog clock widget, like for example: RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.clockwidget); views.setAnalogClockBackgroundDrawable(dial); The clock widget background seems sort of unchangeable. How can I recolor my clockwidget on homescreen in widgetconfig class? There must be a way because it seems so easy to do at first... My project consists of the widget config class and clockwidget class, widgetconfig.xml, clockwidget.xml, and widget_info.xml (for appwidgetprovider).

    Read the article

  • Can I swap WCF deserializer from configuration?

    - by JohnIdol
    I have a problem with WCF deserialization where the client hangs on the response for more than a minute. I'd like to try to swap different deserializers and see if it affects the behavior. Can I swap in/out different serializers (are there any others?) from configuration, and if so can I do that with any binding, or is that out of control once the service reference is imported? Any help appreciated!

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >