Pulling values from a Java Properties file in order?

Extend java.util.Properties, override both put() and keys(): import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Properties; import java.util.HashMap; public class LinkedProperties extends Properties { private final HashSet<Object> keys = new LinkedHashSet<Object>(); public LinkedProperties() { } public Iterable<Object> orderedKeys() { return Collections.list(keys()); } public Enumeration<Object> keys() { return Collections.<Object>enumeration(keys); } public Object put(Object key, Object … Read more

How to solve the error “SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.” in IE

I don’t think it’s a good idea to ask your customers to disable this configuration at all. Remember that enabling and making this change does not only apply to your website but to other websites as well. There’s a huge security reason why it is disabled in Internet and Restricted Sites zones by default and … Read more

How does Log4j2 DefaultRolloverStrategy’s max attribute really work?

The DefaultRolloverStrategy will use the date pattern specified in the filePattern if a TimeBasedTriggeringPolicy is specified. To use the max attribute, specify a %i pattern in the filePattern, and add <SizeBasedTriggeringPolicy size=”20 MB” /> to the rollover policies. (Or some other size of course.) The value for max in <DefaultRolloverStrategy max=”5″/> will then ensure that … Read more

How do I set CultureInfo.CurrentCulture from an App.Config file?

I don’t know a built-in way to set it from App.config, but you could just define a key in your App.config like this <configuration> <appSettings> <add key=”DefaultCulture” value=”pt-BR” /> </appSettings> </configuration> and in your application read that value and set the culture CultureInfo culture = new CultureInfo(ConfigurationManager.AppSettings[“DefaultCulture”]); Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; Also, as … Read more

@Import vs @ContextConfiguration in Spring

@Import and @ContextConfiguration are for different use cases and cannot be used interchangeability. The @Import is only useful for importing other @Configuration files and is only useful (and afaik) and functional on @Configuration classes. When putting the @Import on a test class it will be no good as it won’t be processed. @Configuration @Import(PersistenceConfig.class) public … Read more

What is the purpose of the Assemblies node in Web.Config?

It may or may not be safely removed. The Assemblies node is for configuration-based reference addition. It’s used by ASP.NET websites that deploy uncompiled .cs code files to their website, rather than (as sensible people do) compiled assemblies. If you are deploying code-behind files to your website rather than assemblies, then keep it in. If … Read more

Enabling Intellisense for Custom Sections in .config Files

As the other answers say, you need to provide an XML Schema document for your custom configuration section. There’s no need to add the .xsd schema file to some global directory; you can reference it directly from your custom section in the App.config file: <configuration> <!– make the custom section known to .NET’s configuration manager … Read more

Getting an Environment Variable in Terraform configuration?

I would try something more like this, which seems closer to the documentation. variable “UN” { type = string } variable “PW” { type = string } resource “google_container_cluster” “primary” { name = “marcellus-wallace” zone = “us-central1-a” initial_node_count = 3 master_auth { username = var.UN password = var.PW } node_config { oauth_scopes = [ “https://www.googleapis.com/auth/compute”, … Read more