<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NewInstance</title>
	<atom:link href="http://en.newinstance.it/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.newinstance.it</link>
	<description>Welcome to the official blog of Luigi R. Viggiano. Beware of imitations :)</description>
	<lastBuildDate>Thu, 05 Jan 2017 09:49:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.2</generator>
	<item>
		<title>Yosemite network problems</title>
		<link>http://en.newinstance.it/2014/11/14/yosemite-network-problems/</link>
		<comments>http://en.newinstance.it/2014/11/14/yosemite-network-problems/#comments</comments>
		<pubDate>Fri, 14 Nov 2014 08:57:12 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[discoveryd]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[shared]]></category>
		<category><![CDATA[time machine]]></category>
		<category><![CDATA[yosemite]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1544</guid>
		<description><![CDATA[I&#8217;ve successfully updated two macbooks to Yosemite, and I&#8217;m quite happy so far. The only problem I got, is that one of the two (an old late 2008 macbook) stopped seeing other devices on the network. Even from the Airport utility, it continues to look around without seeing the Time Machine connected to the network. [&#8230;]<div id="crp_related"> </div>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve successfully updated two macbooks to Yosemite, and I&#8217;m quite happy so far.</p>
<p>The only problem I got, is that one of the two (an old late 2008 macbook) stopped seeing other devices on the network. Even from the Airport utility, it continues to look around without seeing the Time Machine connected to the network.</p>
<p>So I found this article: <a href="http://osxdaily.com/2014/10/25/fix-wi-fi-problems-os-x-yosemite/">Fix Wi-Fi Problems in OS X Yosemite</a></p>
<pre>
luigi@hal9000:~$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
luigi@hal9000:~$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
</pre>
<p>Now everything works fine.</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2014/11/14/yosemite-network-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ignoring versioned files with GIT</title>
		<link>http://en.newinstance.it/2013/12/23/ignoring-versioned-files-with-git/</link>
		<comments>http://en.newinstance.it/2013/12/23/ignoring-versioned-files-with-git/#comments</comments>
		<pubDate>Mon, 23 Dec 2013 10:01:28 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[issues]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[source-code]]></category>
		<category><![CDATA[source-code management]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[versioning]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1484</guid>
		<description><![CDATA[Suppose you work in a team. You download the project sources and you need to change some configurations according to your working environment, like the tcp port on which to run the webserver or the path where to store the log files. If you commit those files, after your local set up, this would impact [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>Suppose you work in a team. You download the project sources and you need to change some configurations according to your working environment, like the tcp port on which to run the webserver or the path where to store the log files. If you commit those files, after your local set up, this would impact the other members of your team when they update.<br />
You cannot simply add them to <tt>.gitignore</tt> since those files need to be versioned. But you want just to avoid committing your local configuration to your repository.<br />
So here we have a problem&#8230;</p>
<p>As far as I know, GIT is the only scm able to handle the issue. This is done by running the command:</p>
<pre>
$ git update-index --assume-unchanged path/to/file.txt
</pre>
<p>Once marking a file as such, git will completely ignore any changes on that file; they will not show up when running <tt>git status</tt> or <tt>git diff</tt>, nor will they ever be committed.</p>
<p>To make git track the file again, simply run </p>
<pre>
$ git update-index --no-assume-unchanged path/to/file.txt
</pre>
<p>Credits to <a href="https://help.github.com/articles/ignoring-files">GitHub Help</a> pages for this awesome trick.</p>
<p>To cancel the effect of the <tt>--assume-unchanged</tt> run</p>
<pre>
$ git update-index --really-refresh
</pre>
<p>which does a real refresh ignoring the <tt>--assume-unchanged</tt> entries.</p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2013/12/23/ignoring-versioned-files-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OWNER 1.0.3 what&#8217;s new. Part 2.</title>
		<link>http://en.newinstance.it/2013/05/29/owner-1-0-3-whats-new-part-2/</link>
		<comments>http://en.newinstance.it/2013/05/29/owner-1-0-3-whats-new-part-2/#comments</comments>
		<pubDate>Wed, 29 May 2013 13:33:16 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OWNER API]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[annotations]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[owner api]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[propertyeditor]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1420</guid>
		<description><![CDATA[For the ones who don&#8217;t know what OWNER library is, you can read my previous article here: Introducing OWNER, a tiny framework for Java Properties files. It has been a long time since I posted the Part 1 of this article, and version 1.0.3 was just released. Now I should probably write about version 1.0.4 [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>For the ones who don&#8217;t know what <a href="http://owner.aeonbits.org">OWNER library</a> is, you can read my previous article here: <a href="http://en.newinstance.it/2012/12/27/introducing-owner-a-tiny-framework-for-java-properties-files/" title="Introducing OWNER, a tiny framework for Java Properties files.">Introducing OWNER, a tiny framework for Java Properties files</a>.</p>
<p>It has been a long time since I posted the <a href="http://en.newinstance.it/2013/02/04/owner-1-0-3-whats-new-part-1-variable-expansion/">Part 1</a> of this article, and version 1.0.3 was just released. Now I should probably write about version 1.0.4 which is going to have some neat new features, and it will be released soon; but first I need to complete the overview of 1.0.3, and I will also mention new stuff coming in 1.0.4.</p>
<p>In February I wrote about variable expansion. Here I want to briefly introduce some other things that can be useful:</p>
<ul>
<li>Advanced type conversion</li>
<li>LoadPolicies to load your property files using different strategies</li>
<li>Wrapping your java.util.Properties instances (and java.util.Maps too&#8230;)</li>
<li>Passing parameters to properties (and the wonder of @DefaultValue)</li>
</ul>
<h4>Advanced type conversion</h4>
<p>In last post I showed that user can specify some basic Java types as return type for your <em>Properties Mapping Interface</em>, so this is what I am talking about:</p>
<pre class="brush:java">
public interface ServerConfig extends Config {
    Integer port();
    String hostname();
    @DefaultValue("42")
    int maxThreads();
    File logFile();
}

...
// then you can do
public static void main(String[] args) {
    ServerConfig cfg = ConfigFactory.create(ServerConfig.class);
    System.out.println("Server " + cfg.hostname() + ":" + cfg.port() + " will run " + cfg.maxThreads());
}
</pre>
<p>So if you have a file called ServerConfig.properties in the same package of the above class looking like the following one:</p>
<pre class="brush:java">
port=80
hostname=foobar.com
maxThreads=100
logFile=/var/log/myapp.log
</pre>
<p>The OWNER library will map the interface methods to the properties associated, making all the work to convert the String value to int, Integer, java.util.String or any other java primitive type, enums, wrapper classes. Plus some additional Java types are supported, like java.io.File, java.net.URL, java.net.URI, java.lang.Class etc. This is fully customizable, and fully documented <a href="http://owner.aeonbits.org">here</a>. But this is not new.</p>
<p>The new thing in version 1.0.3, is that you can map your property values to your own business objects. So, for instance, if you have class com.acme.wonderfulapp.User, you could define a <i>properties mapping interface</i> like this:</p>
<pre class="brush:java">
public interface MyAppConfig { 
    //... other properties
    @Key("admin.user") // this associates the key for the property
    User adminUser();
}
</pre>
<p>The associated file MyAppConfig.properties should define the above properties like:</p>
<pre class="brush:java">
# MyAppConfig.properties
admin.user=admin 
</pre>
<p>To allow the OWNER library to convert the property <tt>admin.user=admin</tt> to a com.acme.wonderfulapp.User there are many options:</p>
<ul>
<li> You can declare a public Constructor taking java.lang.String or java.lang.Object:
<pre class="brush:java">
public class User {
    //...

    public User(String username) {
        this.username = username;
    }

    // or 
    public User(Object username) {
        this.username = username;
    }
}
</pre>
</li>
<li> You can declare a public static method <tt>valueOf(String)</tt>:
<pre class="brush:java">
public class User {
    //...
    public static User valueOf(String username) {
        User user = new User();
        user.setUsername(username);
        return user;
    }
}
</pre>
</li>
<li> You can define and register a <tt><a href="http://docs.oracle.com/javase/7/docs/api/java/beans/PropertyEditor.html">PropertyEditor</a></tt>
<pre class="brush:java">
public interface MyAppConfig extends Config {
    @DefaultValue("admin")
    User user();
}

public class UserPropertyEditor extends PropertyEditorSupport {
    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        User user = new User();
        user.setUsername(text);
        setValue(user);
    }
}

public static void main(String[] args) {
    // register the propertyEditor (consult PropertyEditorManager javadocs)
    PropertyEditorManager.registerEditor(User.class, UserPropertyEditor.class);
    MyAppConfig cfg = ConfigFactory.create(MyAppConfig.class);
    System.out.println("admin username is: " + cfg.user().getUsername());
}
</pre>
<p>PropertyEditorManager resolves the editor using some naming convention, so if I rename the class <tt>UserPropertyEditor</tt> into <tt>UserEditor</tt> then there is no need to invoke the method <tt>PropertyEditorManager.registerEditor()</tt>: PropertyEditorManager tries to resolve an editor appending <tt>'-Editor'</tt> to your class name. The editor resolution is a little bit more complex than that; please consult <tt><a href="http://docs.oracle.com/javase/7/docs/api/java/beans/PropertyEditorManager.html">PropertyEditorManager javadoc</a></tt>.
        </li>
</ul>
<p>In the above examples I just showed simple cases, but having the ability specify the logic to convert a java property value into a domain object can be quite handy and powerful I think.<br />
The full list of supported automatic conversion is available on the <a href="http://owner.aeonbits.org/#type-conversion">documentation website (see paragraph &#8220;Type Conversion&#8221;)</a>.</p>
<div style="background-color: yellow; padding: 5px; border: 1px solid darkgray">
<div style="text-align: center; font-weight: bold">WARNING: SPOILER ALERT!</div>
<p>With version 1.0.4 the OWNER library also supports arrays and Collections of all the already supported types. This topic will be covered in the next post, when version 1.0.4 will be officially released. So you could do:</p>
<pre class="brush:java">
public interface MyAppConfig extends Config {
    @DefaultValue("admin,root")
    List&lt;User&gt; users(); // collections of user's domain classes
    @DefaultValue("8080,8090")
    int[] ports(); // also arrays and primitive are supported!
}

public static void main(String[] args) {
    PropertyEditorManager.registerEditor(User.class, UserPropertyEditor.class);

    MyAppConfig cfg = ConfigFactory.create(MyAppConfig.class);
    List&lt;User&gt; users = cfg.users();
    assertEquals("admin", users.get(0).getUsername());
    assertEquals("root", users.get(1).getUsername());
}
</pre>
<p>Thanks goes to <a href="http://ffbit.com">Dmytro Chyzhykov</a> for the awesome code he contributed.</p>
<p>But&#8230; I&#8217;ll tell you more after the 1.0.4 release.
</p></div>
<h4>LoadPolicies to load your property files using different strategies</h4>
<p>By default you don&#8217;t specify any source, OWNER API tries to load the properties from a file called like your class: if my class is called com.acme.MyAppConfig, then by default OWNER will try to load com.acme.MyAppConfig.properties from the classpath.</p>
<p>Of course this is not enough, and since the first release, OWNER is able to load your property files in a flexible way. You can specify the annotation <tt>@Source</tt> with several locations, in form of URLs, from where the properties must be loaded. </p>
<pre class="brush:java">
@Sources({ "file:~/.myapp.config", "file:/etc/myapp.config", "classpath:foo/bar/baz.properties" })
public interface ServerConfig extends Config {
    public String myProperty();
    ...
</pre>
<p>This means that OWNER will fist try to load the file &#8220;.myapp.config&#8221; located in my home directory (the &#8216;~&#8217; is resolved as the user home), then if that file does not exists the file &#8220;/etc/myapp.conf&#8221; will be loaded, and as last resort the file &#8220;foo/bar/baz.properties&#8221; will be loaded from the class path. And, as if this was not enough, you can also specify a default value for every property with the annotation <tt>@DefaultValue</tt>.<br />
All this is nice, but <strong>NOT NEW</strong>, since version 1.0.3 adds even more.</p>
<p>In fact, with version 1.0.3 you have two different &#8220;load policies&#8221;. The default one, is the one exposed above. And we call this behavior <tt>LoadType.FIRST</tt>, since the first available resource specified by the <tt>@Source</tt> annotation is loaded and the remaining are ignored.<br />
The new additional load policy is called <tt>LoadType.MERGE</tt>, and here is an example:</p>
<pre class="brush:java">
@LoadPolicy(LoadType.MERGE)
@Sources({ "file:~/.myapp.config", "file:/etc/myapp.config", "classpath:foo/bar/baz.properties" })
public interface ServerConfig extends Config {
    public String myProperty();
    ...
</pre>
<p>This means that, when I call the method <tt>ServerConfig.myProperty()</tt> <strong>ALL</strong> the sources will be considered in order. If myProperty is specified in &#8220;file:/etc/myapp.config&#8221; will be loaded from there, unless it is redefined in &#8220;file:~/.myapp.config&#8221;. So basically we have a kind of &#8220;fallback&#8221; mechanism which allows the user to have a main configuration with lower priority (i.e. system level) and overriding configurations with higher priorities (i.e. user level).</p>
<h4>Wrapping your java.util.Properties instances (and java.util.Maps too&#8230;)</h4>
<p>If you have existing instances of Properties (or Maps), for example you have a legacy application that loads the property in some particular way, or just instantiates those properties programmatically, you can &#8220;wrap&#8221; those instances with OWNER.<br />
I called this mechanism &#8220;importing properties&#8221; since it is an *addition* to loading the properties from external resources, and you can use this feature in combination of it.<br />
For instance you can wrap <tt>System.getProperties()</tt> or <tt>System.getenv()</tt> doing something like this:</p>
<pre class="brush:java">

// wrapping System.getenv() 

interface EnvProperties extends Config {
    @Key("HOME")
    String home();

    @Key("USER")
    String user();
}

public static void main(String[] args) {
    SystemEnvProperties cfg = ConfigFactory.create(SystemEnvProperties.class, System.getenv());
    assertEquals(System.getenv().get("HOME"), cfg.home());
    assertEquals(System.getenv().get("USER"), cfg.user());
}

// wrapping System.getProperties()

interface SystemEnvProperties extends Config {
    @Key("file.separator")
    String fileSeparator();

    @Key("java.home")
    String javaHome();
}

public static void main(String[] args) {
    SystemEnvProperties cfg = ConfigFactory.create(SystemEnvProperties.class, System.getProperties());
    assertEquals(File.separator, cfg.fileSeparator());
    assertEquals(System.getProperty("java.home"), cfg.javaHome());
}

// you can also wrap them together in a single interface:

interface SystemEnvProperties extends Config {
    @Key("file.separator")
    String fileSeparator();

    @Key("java.home")
    String javaHome();

    @Key("HOME")
    String home();

    @Key("USER")
    String user();
}

public static void main(String[] args) {
    SystemEnvProperties cfg = ConfigFactory.create(SystemEnvProperties.class, System.getProperties(), System.getenv());
    assertEquals(File.separator, cfg.fileSeparator());
    assertEquals(System.getProperty("java.home"), cfg.javaHome());
    assertEquals(System.getenv().get("HOME"), cfg.home());
    assertEquals(System.getenv().get("USER"), cfg.user());
}
</pre>
<p>In the same way, you can wrap any instance of Properties &#8211; and any subclass of java.util.Map &#8211; you already have in your project, in a convenient JavaBean-like interface (if you like JavaBeans), with the advantage of having the type conversion for free.</p>
<div style="background-color: yellow; padding: 5px; border: 1px solid darkgray">
<div style="text-align: center; font-weight: bold">WARNING</div>
<p>Notice that the wrapped object becomes unmodifiable (since it is internally copied), so if you modify the original objects, the change will not be reflected. The objects instantiated by OWNER, should be considered <strong>immutable</strong> (well, I am planning to implement the &#8220;hot reloading&#8221; soon, maybe already in 1.0.4, and being thread safe is a requirement).
</div>
<h4>Passing parameters to properties (and the wonder of @DefaultValue)</h4>
<p>This feature is not really new and is more related to internationalization than on configuration. In any case, in Java interface method can accept parameters and I thought it may be useful to parametrize a property value. And it was easy and elegant to implement, so I did it.</p>
<pre class="brush:java">
interface Sample extends Config {
    @DefaultValue("Hello Mr. %s!")
    String helloMr(String name);
}
public static void main(String[] args) {
    Sample sample = ConfigFactory.create(Sample.class);
    // this will print "Hello Mr. Luigi!"
    System.out.println(sample.helloMr("Luigi")); 
}
</pre>
<p>This is not new in 1.0.3 but I feel like this is an unknown feature, and&#8230; in the above example I also show the usage of the <tt>@DefaultValue</tt> annotation. Sometime you just want to define some default values for your configuration, plus specifying a source from where to load the overriding values defined by the user. This is one of the things I like more about this library: it saves me to write properties file until they are really needed. Or if you want, you can write an example, put it on the classpath and let the user to override it placing the property in a conventional location.<br />
The parameters, are just a plus and an excuse to talk again about <tt>@DefaultValue</tt>.</p>
<div style="background-color: yellow; padding: 5px; border: 1px solid darkgray">
<div style="text-align: center; font-weight: bold">WARNING: SPOILER ALERT!</div>
<p>Some people don&#8217;t need this parameter formatting feature, or the variable expansion that has been introduced in the <a href="http://en.newinstance.it/2013/02/04/owner-1-0-3-whats-new-part-1-variable-expansion/">previous episode</a>. For example, your application may already implement variable expansion in a very similar way, and having an unwanted feature may lead to conflict with legacy features if you are trying to introduce OWNER in your project. For this reason, version 1.0.4 will have an annotation <tt>@DisableFeature</tt> which will allow the user to disable the variable expansion or the parameter formatting on class level and/or on method level.
</div>
<h4>Conclusions</h4>
<p>This is just a quick tour on the new things regarding the OWNER library. In 1.0.3 there were also some minor bugfixes and some code cleanup.<br />
What we are trying to do with OWNER library, is to add beautiful features while keeping the code compact, elegant, documented and thoroughly tested. So far so good, I suppose. And more things are bubbling in the pan*.</p>
<p><em>*: &#8220;what&#8217;s bubbling in the pan?&#8221; is the italian literal translation of &#8220;Cosa bolle in pentola?&#8221;, which corresponds to &#8220;What&#8217;s cooking?&#8221;</em></p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2013/05/29/owner-1-0-3-whats-new-part-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Owner 1.0.3 what&#8217;s new? Part 1: variable expansion</title>
		<link>http://en.newinstance.it/2013/02/04/owner-1-0-3-whats-new-part-1-variable-expansion/</link>
		<comments>http://en.newinstance.it/2013/02/04/owner-1-0-3-whats-new-part-1-variable-expansion/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 16:43:04 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OWNER API]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[owner api]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1400</guid>
		<description><![CDATA[In the last blog post I introduced what is the OWNER API and how to use it. Basically it is tiny library that helps reducing the Java code to read the configuration for your application from Java Properties files. You can find full documentation here. Version 1.0.0 was having the very basic features, and now I&#8217;m [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>In the <a href="http://en.newinstance.it/2012/12/27/introducing-owner-a-tiny-framework-for-java-properties-files/">last blog post</a> I introduced what is the OWNER API and how to use it.<br />
Basically it is tiny library that helps reducing the Java code to read the configuration for your application from Java Properties files. You can find full documentation <a href="http://owner.aeonbits.org">here</a>. Version 1.0.0 was having the very basic features, and now I&#8217;m adding new things that may return useful without compromising its simplicity and compactness.</p>
<p>Yesterday I have released version 1.0.3 which includes some new features that I want to introduce in some short blog posts.<br />
On this weekend I set up the <a href="https://aeonbits.ci.cloudbees.com/">continuous integration on CloudBees</a> and I noticed that compiling with JDK 6 there was a compilation error, since I was using JDK 7, so I decided that the fix was worthing another release, so that if somebody is using JDK 6 won&#8217;t have any problem.</p>
<p>So, what&#8217;s new then?</p>
<p>First of all, the OWNER library<strong> is now available on <a href="http://search.maven.org/#search%7Cga%7C1%7C1%3A%22bd2837ae8f1ad922be576e671633959ea13ead1e%22">Maven Central Repository</a></strong>, and this will ease the job of people willing to try it, since now it only requires <a href="http://owner.newinstance.it/maven-site/dependency-info.html">few lines</a> to configure your project to use it, and I tried to improve the documentation. Unfortunately, publishing the library on Maven Central Repository required me to buy an internet domain name and use it for the groupId of the library. This may have broken the backward compatibility if someone started to use this library. I apologize for that.</p>
<p>The first thing I want to point out, is something I always missed in Java Properties files.<strong> A &#8220;variable expansion&#8221; mechanism.</strong><br />
For example, imagine your application having a configuration file like this:</p>
<pre>server.host=myhost.com
service.url=http://${server.host}/some/endpoint
application.path=${HOME}/myapp
application.data=${application.path}/data
application.logs=${application.path}/logs</pre>
<p>With plain Java properties file, the job to replace the variables is left to you. With Owner API, you can create a Java interface to map the above configuration and have all the variables resolved:</p>
<pre class="brush:java">public interface MyAppConfig extends Config {
    @Key("server.host")
    String host();

    @Key("service.url")
    URL serviceURL();

    @Key("application.data")
    File appData();

    @Key("application.logs")
    File appLogs();
}

// then use it with:
MyAppConfig cfg = ConfigFactory.create(MyAppConfig.class, System.getenv());</pre>
<p>The <tt>System.getenv()</tt> is used to resolve the <tt>${HOME}</tt> system environment variable. In the same way you can pass other properties files too, like System properties or any other class implementing <tt>java.util.Map</tt>, see <a href="http://owner.newinstance.it/maven-site/apidocs/org/aeonbits/owner/ConfigFactory.html#create(java.lang.Class, java.util.Map...)">ConfigFactory.create()</a>. I called this technique &#8220;importing properties&#8221;, since you specify some <tt>Properties</tt> or <tt>Map</tt>s during the creation of the Config object.</p>
<p>More details can be found on the README file on github: <a href="https://github.com/lviggiano/owner#variables-expansion">variables expansion</a> and <a href="https://github.com/lviggiano/owner#importing-properties">importing properties</a>.</p>
<p>I&#8217;ll write more about what&#8217;s new in the next blog post.</p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2013/02/04/owner-1-0-3-whats-new-part-1-variable-expansion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing OWNER, a tiny framework for Java Properties files.</title>
		<link>http://en.newinstance.it/2012/12/27/introducing-owner-a-tiny-framework-for-java-properties-files/</link>
		<comments>http://en.newinstance.it/2012/12/27/introducing-owner-a-tiny-framework-for-java-properties-files/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 23:51:54 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OWNER API]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[owner api]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1384</guid>
		<description><![CDATA[I never liked to create &#8220;wrapper&#8221; classes for properties files. Do you know&#8230; those classes like: public class MyAppConfig { private static Properties p = ...; public static String serverName() { return p.getProperty("server.name"); } public static int serverPort() { return Integer.parseInt(p.getProperty("server.port")); } .... } There&#8217;s nothing really bad about those classes. Only that they don&#8217;t [&#8230;]<div id="crp_related"> </div>]]></description>
				<content:encoded><![CDATA[<p>I never liked to create &#8220;wrapper&#8221; classes for properties files. Do you know&#8230; those classes like:</p>
<pre class="brush:java">
public class MyAppConfig {
    private static Properties p = ...;

    public static String serverName() {
        return p.getProperty("server.name");
    }

    public static int serverPort() {
        return Integer.parseInt(p.getProperty("server.port"));
    }

    ....
}
</pre>
<p>There&#8217;s nothing really bad about those classes. Only that they don&#8217;t do actually anything useful; plus, you need to keep things in sync with the properties file associated.</p>
<p>So, I always preferred to directly use Properties.getProperty() and pass a config properties to objects:</p>
<pre class="brush:java">
   
public class MyBusinessClass {
    private final Properties conf;
    public MyBusinessClass(..., Properties conf) {
        this.conf = conf;
    }    

    public void doSomething() {
        String serverName = conf.getProperty("server.name");
        int serverPort = Integer.parseInt(conf.getProperty("server.port"));
    }
}
</pre>
<p>99% of the times, you need a configuration setting in a single point. So that&#8217;s good enough, and I don&#8217;t have to write (and keep in sync) a class that I can spare.</p>
<p>But&#8230; what about this?</p>
<pre class="brush:java">
public interface MyAppConfig extends Config {

    @DefaultValue("foobar.com")
    @Key("server.name");
    String serverName();

    @DefaultValue("80");
    @Key("server.port");
    int serverPort();
    ...
}
</pre>
<p>Add to this, a smart -annotation based- configuration loading:</p>
<pre class="brush:java">
@Sources({"file:~/.myapp.config", "file:/etc/myapp.config", "classpath:foo/bar/baz.properties"})
public interface MyAppConfig extends Config {
...
</pre>
<p>And a simple instantiation:</p>
<pre class="brush:java">
    MyAppConfig conf = ConfigFactory.create(MyAppConfig.class);
</pre>
<p>And you have <a href="http://lviggiano.github.com/owner">OWNER</a>. A little configuration framework based on Java properties. </p>
<p>BSD license.<br />
Credits to Google GWT, that does similar things with <a href="https://developers.google.com/web-toolkit/doc/latest/DevGuideI18nConstants">i18n</a>.</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2012/12/27/introducing-owner-a-tiny-framework-for-java-properties-files/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ssh &#8220;Write failed: Broken pipe&#8221;</title>
		<link>http://en.newinstance.it/2012/11/17/ssh-write-failed-broken-pipe/</link>
		<comments>http://en.newinstance.it/2012/11/17/ssh-write-failed-broken-pipe/#comments</comments>
		<pubDate>Sat, 17 Nov 2012 15:30:25 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[broken pipe]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[write failed]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1362</guid>
		<description><![CDATA[I started to get this error &#8220;Write failed: Broken pipe&#8221; when I was leaving the terminal alone. Since plumbers are still expensive, despite the crisis, I decided to fix the pipe by myself. Very easy, just add the following line to /etc/ssh/sshd_config: ClientAliveInterval 60 This will send a &#8220;keep-alive&#8221; packet from the server to the [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://en.newinstance.it/wp-content/uploads/2012/11/plumber.jpeg"><img class="wp-image-1372 aligncenter" title="plumber" src="http://en.newinstance.it/wp-content/uploads/2012/11/plumber.jpeg" alt="" width="165" height="170" /></a></p>
<p>I started to get this error &#8220;Write failed: Broken pipe&#8221; when I was leaving the terminal alone.<br />
Since plumbers are still expensive, despite the crisis, I decided to fix the pipe by myself.<br />
Very easy, just add the following line to <tt>/etc/ssh/sshd_config</tt>:</p>
<pre>ClientAliveInterval 60</pre>
<p>This will send a &#8220;keep-alive&#8221; packet from the server to the terminal client every 60 seconds so that the connection doesn&#8217;t get dropped.</p>
<p>If you can&#8217;t fix it on the server, for example if you don&#8217;t have administrative rights, you can fix your client to send the &#8220;keep-alive&#8221; packet to the server every 60 seconds, adding this line to <tt>~/.ssh/config</tt></p>
<pre>ServerAliveInterval 60</pre>
<p>It&#8217;s also possible to specify the ServerAliveInterval at the ssh command line:</p>
<pre>$ ssh -o ServerAliveInterval=60 user@sshserver</pre>
<p>More info about <tt>ClientAliveInterval</tt> and <tt>ServerAliveInterval</tt> can be found typing at the command line:</p>
<pre>$ man 5 sshd_config
$ man 5 ssh_config
$ man ssh</pre>
<p>Another reference <a href="http://unix.stackexchange.com/questions/2010/what-does-the-broken-pipe-message-mean-in-an-ssh-session">here</a>.</p>
<p>Your pipes should be safe now, and the plumbers out of business.</p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2012/11/17/ssh-write-failed-broken-pipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>-bash: __git_ps1: command not found</title>
		<link>http://en.newinstance.it/2012/09/22/bash-__git_ps1-command-not-found/</link>
		<comments>http://en.newinstance.it/2012/09/22/bash-__git_ps1-command-not-found/#comments</comments>
		<pubDate>Sat, 22 Sep 2012 15:51:27 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[completion]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[ps1]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1355</guid>
		<description><![CDATA[How to fix the error "-bash: __git_ps1: command not found" after git-core updates.<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>Today I updated mac ports and a new error started to show up at the command line saying that the __git_ps1 command is not found.<br />
This is because I added the <a href="/2010/05/23/git-autocompletion-and-enhanced-bash-prompt/">git branch in my bash prompt</a> long time back and in last update of <a href="http://www.macports.org/ports.php?by=name&amp;substr=git-core">git-core</a> port they moved the __git_ps1 bash functions to a separate script.</p>
<p>To fix it, you just need to include following lines in your .profile (or .bashrc):</p>
<pre>
if [ -f /opt/local/share/doc/git-core/contrib/completion/git-prompt.sh ]; then
    . /opt/local/share/doc/git-core/contrib/completion/git-prompt.sh
fi
</pre>
<p>It worked for me.</p>
<p>Depending on your git installation, this file may be located elsewhere; <tt>find</tt> command should help in this case.</p>
<p><strong>Update 30-03-2013:</strong></p>
<p>They changed the location of those files again. Super!</p>
<p>now they are here:</p>
<pre>/opt/local/share/git-core/contrib/completion/git-completion.bash
/opt/local//share/git-core/contrib/completion/git-prompt.sh</pre>
<p>just include them.<br />
Hope they won&#8217;t change the paths again soon :)</p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2012/09/22/bash-__git_ps1-command-not-found/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Coreserviced and pentabletdriver taking over the cpu</title>
		<link>http://en.newinstance.it/2012/07/29/coreserviced-and-pentabletdriver-taking-over-the-cpu/</link>
		<comments>http://en.newinstance.it/2012/07/29/coreserviced-and-pentabletdriver-taking-over-the-cpu/#comments</comments>
		<pubDate>Sun, 29 Jul 2012 10:51:05 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[coreserviced]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[istat]]></category>
		<category><![CDATA[MacBook]]></category>
		<category><![CDATA[mountain lion]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[pentabletdriver]]></category>
		<category><![CDATA[reboot]]></category>
		<category><![CDATA[slowdown]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1348</guid>
		<description><![CDATA[It&#8217;s a couple of days I&#8217;m experiencing my macbook pro being more unstable (than usual). This morning I noticed that the cpu temperature was around 80˚C (using iStat Menus) and I notice that the process coreserviced was taking 80% CPU, and after that there was pentabletdriver with another 20%. I thought that it was a [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s a couple of days I&#8217;m experiencing my macbook pro being more unstable (than usual). This morning I noticed that the cpu temperature was around 80˚C (using <a href="http://bjango.com/mac/istatmenus/">iStat Menus</a>) and I notice that the process coreserviced was taking 80% CPU, and after that there was pentabletdriver with another 20%. I thought that it was a funny coincidence that this started to happen right after the release of Mountain Lion, so I thought that this may be the chance to upgrade, even though I can&#8217;t find a single feature in Mountain Lion that I really need.<br />
First, I tried the oldest and most effective strategy to solve computer problems, the reboot, but it didn&#8217;t help.<br />
So, I googled around and I found many people complaining the same behavior, but nothing to solve the problem in my case.<br />
At the end I did this: from spotlight I opened the Activity Monitor and I forced-quit the coreserviced and the pentabletdriver, and immediately the cpu returned idle, but after that the menu bar disappeared so I thought it would be a good idea to shutdown the laptop and reboot (CTRL+Eject button). After the reboot, things went fine, but I had already purchased Mountain Lion, so&#8230; good for you Apple, you got my 15 euros.</p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2012/07/29/coreserviced-and-pentabletdriver-taking-over-the-cpu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to switch the primary display on OS X</title>
		<link>http://en.newinstance.it/2012/07/09/how-to-switch-the-primary-display-on-os-x/</link>
		<comments>http://en.newinstance.it/2012/07/09/how-to-switch-the-primary-display-on-os-x/#comments</comments>
		<pubDate>Mon, 09 Jul 2012 13:25:37 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[apple magic trackpad]]></category>
		<category><![CDATA[apple wireless keyboard]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[external display]]></category>
		<category><![CDATA[external monitor]]></category>
		<category><![CDATA[hdmi]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[mini displayport]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[multimon]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[primary]]></category>
		<category><![CDATA[secondary]]></category>
		<category><![CDATA[VH242H]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1314</guid>
		<description><![CDATA[I purchased an awesome 24&#8243; LCD Monitor by Asus, I didn&#8217;t spend much (except for the Apple Mini DisplayPort to HDMI cable). The problem with OS X, is that once you have such a wonderful display you want to use it fully, and the Apple operating system works against you. In fact, by default the [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>I purchased an awesome <a href="http://www.asus.it/Display/LCD_Monitors/VH242H/">24&#8243; LCD Monitor by Asus</a>, I didn&#8217;t spend much (except for the Apple Mini DisplayPort to HDMI cable). The problem with OS X, is that once you have such a wonderful display you want to use it fully, and the Apple operating system works against you. In fact, by default the monitor enters as &#8220;secondary monitor&#8221; so you need to drag applications into it, and you don&#8217;t have the dock and the menubar there. This would be fine, if only the way to switch the primary monitor was easy to find.<br />
I wanted to use the big monitor as primary monitor, and I couldn&#8217;t find how. I looked around on internet without any luck. I purchased an application, <a href="http://itunes.apple.com/us/app/multimon/id522324709?mt=12">Multimon</a>, from the App Store, but it wasn&#8217;t much of an help; $10 wasted.</p>
<p>At the end I found how to use the external monitor as Primary Display. Here it is how:</p>
<ol>
<li>Open &#8216;System Preferences&#8217;. I do that from spotlight (cmd+space then type &#8216;system preferences&#8217;)</li>
<li>Choose Displays, and select the Tab &#8216;Arrangement&#8217;, you&#8217;ll see something like this: <br/><br />
<a href="http://en.newinstance.it/wp-content/uploads/2012/07/Screen-Shot-2012-07-09-at-3.03.28-PM.png"><img src="http://en.newinstance.it/wp-content/uploads/2012/07/Screen-Shot-2012-07-09-at-3.03.28-PM.png" alt="" title="Screen Shot 2012-07-09 at 3.03.28 PM" width="782" height="605" class="alignnone size-full wp-image-1315" /></a>
</li>
<li>You see that the menu bar is set on the little display (the one of the MacBook). The menu bar also identifies the &#8216;Primary Display&#8217;, which also gets the Dock. All you need to do, to switch the primary display is to drag the menu bar on the other display. It is also written in the dialog, but who see that? After dragging the menu bar, the representation becomes like this:<br />
<a href="http://en.newinstance.it/wp-content/uploads/2012/07/Screen-Shot-2012-07-09-at-3.03.40-PM.png"><img src="http://en.newinstance.it/wp-content/uploads/2012/07/Screen-Shot-2012-07-09-at-3.03.40-PM.png" alt="" title="Screen Shot 2012-07-09 at 3.03.40 PM" width="782" height="605" class="alignnone size-full wp-image-1316" /></a><br/><br />
Now the primary monitor is the external one.
</li>
</ol>
<p>When the external monitor gets disconnected, the MacBook display returns to be the primary one. If you have much stuff on the desktop, it gets a little bit messed up, but you can rearrange that automatically, right-clicking on the desktop and doing a Clean-Up By Kind or by Name.</p>
<p>Notice that if you have a MacBook earlier than 2010, like me, the Mini DisplayPort doesn&#8217;t transport the audio signal, which has been added only later; so your external display will be mute.</p>
<p>Last advice: once you have a big external monitor, you&#8217;ll probably want to buy a <a href="http://www.apple.com/keyboard/">Apple Wireless Keyboard</a> and the <a href="http://www.apple.com/magictrackpad/">Magic Trackpad</a>. Both strongly recommended. (For the Apple guys: for this recommendation you owe me some gift!)</p>
<p>This would be the final result <sup><a href="#post-1314-notes">[1]</a></sup>:<br />
<a href="http://en.newinstance.it/wp-content/uploads/2012/07/2012-06-30-18.43.35.jpg"><img src="http://en.newinstance.it/wp-content/uploads/2012/07/2012-06-30-18.43.35-1024x768.jpg" alt="" title="2012-06-30 18.43.35" width="500" height="340" class="alignnone size-large wp-image-1327" /></a></p>
<h4 id="post-1314-notes">Notes:</h4>
<ol>
<li>Beer not included.</li>
</ol>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2012/07/09/how-to-switch-the-primary-display-on-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disable DashBoard in Lion</title>
		<link>http://en.newinstance.it/2012/07/09/disable-dashboard-in-lion/</link>
		<comments>http://en.newinstance.it/2012/07/09/disable-dashboard-in-lion/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 22:33:00 +0000</pubDate>
		<dc:creator><![CDATA[Luigi]]></dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lifehacks]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://en.newinstance.it/?p=1304</guid>
		<description><![CDATA[I always found Dashboard pretty useless, and I just notice it exists when by mistake I press some key which switches the desktop to it. So, here is how to get rid of it; I write this post mainly for future memory for myself. From this article: $ defaults write com.apple.dashboard mcx-disabled -boolean YES $ [&#8230;]<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></description>
				<content:encoded><![CDATA[<p>I always found Dashboard pretty useless, and I just notice it exists when by mistake I press some key which switches the desktop to it. So, here is how to get rid of it; I write this post mainly for future memory for myself.</p>
<p>From <a href="http://www.psyion.net/tutorials/3751">this</a> article:</p>
<pre>
$ defaults write com.apple.dashboard mcx-disabled -boolean YES
$ killall Dock
</pre>
<p>to re-enable it:</p>
<pre>
$ defaults write com.apple.dashboard mcx-disabled -boolean NO
</pre>
<p>Less is more.</p>
<div class="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://en.newinstance.it/2014/11/14/yosemite-network-problems/"     class="crp_title">Yosemite network problems</a></li></ul><div class="crp_clear"></div></div>]]></content:encoded>
			<wfw:commentRss>http://en.newinstance.it/2012/07/09/disable-dashboard-in-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
