WCF using computer name instead of domain name when viewing MyService.svc?wsdl

WCF 4.0 has solved this issue in some instances with a new config option that use Request Headers: <behaviors> <serviceBehaviors> <behavior name=”AutoVaultUploadBehavior”> <useRequestHeadersForMetadataAddress> <defaultPorts> <add scheme=”https” port=”443″ /> </defaultPorts> </useRequestHeadersForMetadataAddress>

Xcode project how to detect target programmatically or how to use env vars

Never mind… figured out that it is in “Schemes” that you set this. For example if you want TARGET=TEST to be available during Test and TARGET=RUN to show during run, just set that in your Scheme > Environment Variables > Name/Value. Then from your app you can do: [[[NSProcessInfo processInfo] environment] objectForKey:@”TARGET”] Using build settings … Read more

How to add a user to PostgreSQL in Windows?

In pgadmin you can create a new “Login Role” and name it Eric and give it permissions graphically, or from command line you can do something like this psql -U postgres -c “CREATE ROLE Eric LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE;” mydb see http://developer.postgresql.org/pgdocs/postgres/sql-createrole.html for information on the CREATE ROLE options.

Time based triggering policy in log4j2

1 here indicates 1 day and not 1 hour. I have manually tested with below configuration. <RollingFile name=”T” fileName=”/data_test/log/abc.log” filePattern=”/data_test/log/abc-%d{MM-dd-yyyy}-%i.log”> <PatternLayout> <Pattern>%d{ISO8601} %-5p [%t] (%F:%L) – %m%n</Pattern> </PatternLayout> <Policies> <TimeBasedTriggeringPolicy interval=”1″ modulate=”true”/> <SizeBasedTriggeringPolicy size=”100 KB” /> </Policies> </RollingFile> For manual testing, I change the system date and time. First, try with increasing 1 hour. The … Read more

Unable to launch the ASP.NET Development server because port ‘1900’ is in use

Simply end all Webdev.WebServer.exe processes – did the trick for me. Occasionally this ‘unable to launch because port is in use’ error happens when one of the visual studio processes (webdev.webserver.exe) is still running and locked. The webdev.webserver process(s) should end when you close your browser or app but if they dont (for instance my … Read more

How to configure Spring without persistence.xml?

From Spring Guide Accessing Data with JPA @Configuration @EnableJpaRepositories public class Application { @Bean public DataSource dataSource() { return new EmbeddedDatabaseBuilder().setType(H2).build(); } @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter) { LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean(); lef.setDataSource(dataSource); lef.setJpaVendorAdapter(jpaVendorAdapter); lef.setPackagesToScan(“hello”); return lef; } @Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(false); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); return … Read more