Tuesday, November 10, 2015

Flip your Laptop display upside down

You can flip your computer or laptop display upside down by using the shortcut keys

CNTRL+ALT+ UP or DOWN ARROW keys

Your can flip side ways by
CNTRL+ALT+LEFT ARROW
or
CNTRL+ALT+RIGHT ARROW

Sunday, June 21, 2015

Spring - Get the values of property files using @value anotation

In the file x.properties
xx.test.flag.list=X,Y,Z

In the spring configuration file:-

<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:properties/x.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>

And in the java class file using @Value anotation.

@Value("#{'${xx.test.flag.list}'.split(',')}")
private List<String> flagsList;

Monday, January 5, 2015

UnknownHostException in mac osx

Issue:

java.net.UnknownHostException: abc-026bf227b: abc-026bf227b: nodename nor servname provided, or not known at java.net.InetAddress.getLocalHost(InetAddress.java:1473)

Fix:

Fixed by simple command in vi editor
  echo "127.0.0.1 $HOSTNAME" | sudo tee -a /etc/hosts

This makes and entry in /etc/hosts
127.0.0.1 abc-026bf227b