<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-11755573</atom:id><lastBuildDate>Thu, 19 Dec 2024 03:20:36 +0000</lastBuildDate><category>groovy</category><category>filosofia</category><category>griffon</category><category>grails</category><category>list</category><category>log4j</category><category>snippet</category><category>sql</category><category>crisis</category><category>eclipse</category><category>howto</category><category>inject</category><category>java</category><category>mysql</category><category>properties</category><category>replace</category><category>ubuntu</category><category>update</category><category>version</category><category>vida</category><category>windows</category><category>NtoM</category><category>String</category><category>add</category><category>appender</category><category>async</category><category>basket</category><category>binary</category><category>boda</category><category>bootstrap</category><category>canto video</category><category>case</category><category>cheatsheet</category><category>classcircularity</category><category>classes</category><category>code war</category><category>code.org</category><category>config</category><category>containsAny</category><category>corralated</category><category>curiosidad</category><category>curly brackets</category><category>customdateeditor</category><category>datepicker</category><category>debug</category><category>diego</category><category>domains</category><category>dot-operator</category><category>down</category><category>dummy</category><category>dynamic</category><category>eclipse-support</category><category>ecuacion internet</category><category>elasticSearch</category><category>esfuerzo</category><category>españa</category><category>example</category><category>external</category><category>fields</category><category>flow</category><category>gist</category><category>git</category><category>gorm</category><category>gstring</category><category>hasMany</category><category>informatica huelga</category><category>informática</category><category>inheritance</category><category>install</category><category>javascript</category><category>jformattedtextfield</category><category>kill</category><category>lesion</category><category>linux</category><category>log4j1.x</category><category>map</category><category>memory</category><category>muchachada</category><category>mvc</category><category>numbers</category><category>numeros</category><category>object</category><category>operators</category><category>patterns</category><category>peliculas</category><category>performance</category><category>permsize</category><category>piratas video</category><category>plugin</category><category>política</category><category>print</category><category>production</category><category>programador</category><category>prototype</category><category>ps</category><category>random</category><category>reflection</category><category>regexp</category><category>relato louis barton</category><category>reuse</category><category>sed</category><category>service</category><category>software</category><category>spain</category><category>spring</category><category>sts</category><category>task</category><category>test</category><category>testing</category><category>textfield</category><category>tomcat</category><category>trabajo</category><category>tutorial</category><category>up</category><category>update-alternatives</category><category>update-java-alternatives</category><category>wii geek bateria</category><title>ivo43</title><description>Un pequeño rincón donde escribir tonterias y cosas serias</description><link>http://ivo43.blogspot.com/</link><managingEditor>noreply@blogger.com (Ivan Arrizabalaga)</managingEditor><generator>Blogger</generator><openSearch:totalResults>82</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-5394454762995732018</guid><pubDate>Thu, 05 Mar 2015 14:53:00 +0000</pubDate><atom:updated>2015-03-05T15:53:00.920+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">appender</category><category domain="http://www.blogger.com/atom/ns#">async</category><category domain="http://www.blogger.com/atom/ns#">log4j</category><category domain="http://www.blogger.com/atom/ns#">log4j1.x</category><category domain="http://www.blogger.com/atom/ns#">performance</category><title>Async loggin with log4j 1.x</title><description>If you are reading this surely you have found out that using AsyncAppender its not clearly documented and most of your google results lead you to some log4j 2.X.&lt;br /&gt;
&lt;br /&gt;
Ok, in that case this is the right post for you.&lt;br /&gt;
&lt;br /&gt;
Lets take an ordinary (synchronous) file logger from Log4j 1.x ( tested with 1.2.17) and wrap it up with a &#39;cool&#39; AsyncAppender. :D.&lt;br /&gt;
&lt;br /&gt;
Considering that you have&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;import org.slf4j.Logger
...
static Logger log = LoggerFactory.getLogger(&quot;MyLogger&quot;);
&lt;/pre&gt;
&lt;br /&gt;
You turn your internal sync appender into an async with:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;static {
  AsyncAppenderBuilder.wrapAsyncAppender(log, &quot;MyAppndrName&quot;)
}
&lt;/pre&gt;
&lt;br /&gt;
Then use just like a regular logger&lt;br /&gt;
&lt;br /&gt;
The helping class looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/93ab4bc76f140ea1bafa.js&quot;&gt;&lt;/script&gt;

Hope it helps!&lt;br /&gt;
Iván.&lt;br /&gt;
&lt;br /&gt;</description><link>http://ivo43.blogspot.com/2015/03/async-loggin-with-log4j-1x.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-6455559552753349935</guid><pubDate>Thu, 12 Feb 2015 11:55:00 +0000</pubDate><atom:updated>2015-02-12T12:55:36.151+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">external</category><category domain="http://www.blogger.com/atom/ns#">grails</category><category domain="http://www.blogger.com/atom/ns#">log4j</category><category domain="http://www.blogger.com/atom/ns#">production</category><category domain="http://www.blogger.com/atom/ns#">properties</category><title>Grails in prod with an external log4j properties</title><description>Maybe you have tried to config your Grails app so you can:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Use the default logging configuration inside Config.groovy for test or dev.&lt;/li&gt;
&lt;li&gt;Use an external log4j.properties file in production.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
It&#39;s quite frustating and it is not so well documented.&lt;br /&gt;
After some digging I came up with a quite elegant solution:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Config.groovy:&lt;/b&gt;&lt;br /&gt;
----------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;import grails.util.Environment

if(Environment.current!=Environment.PRODUCTION){
  // log4j configuration
  log4j = {
    ...
  }
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;resources.groovy:&lt;/b&gt;&lt;br /&gt;
----------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;import grails.util.Environment

if(Environment.current==Environment.PRODUCTION){
  log4jConfigurer(org.springframework.beans.factory.config.MethodInvokingFactoryBean) {
    targetClass = &quot;org.springframework.util.Log4jConfigurer&quot;
    targetMethod = &quot;initLogging&quot;
    arguments = [&quot;classpath:resources/log4j.properties&quot;]
  }
} 

&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;log4j.properties (src/resources/log4j.properties):&lt;/b&gt;&lt;br /&gt;
----------------------------&lt;br /&gt;
&lt;pre&gt;  //whatever make sense to you
&lt;/pre&gt;
&lt;br /&gt;
Please remember NOT to forget your imports or otherwise it wont work.&lt;br /&gt;
&lt;br /&gt;
Hope it helps!&lt;br /&gt;
&lt;br /&gt;
PD: Grails 3.0 is about to see the light and ...well who kows!. This solution is right for Grails 2.x family.</description><link>http://ivo43.blogspot.com/2015/02/grails-in-prod-with-external-log4j.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-432715728638442986</guid><pubDate>Wed, 26 Nov 2014 15:17:00 +0000</pubDate><atom:updated>2014-11-26T16:17:07.209+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">classes</category><category domain="http://www.blogger.com/atom/ns#">inheritance</category><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">patterns</category><category domain="http://www.blogger.com/atom/ns#">prototype</category><title>Javascript: Haciendo herencia a través del prototype</title><description>Como en js no hay clases reales cuando se quiere obtener un funcionamiento de delegación similar hay que acudir a patrones más o menos liosos para ello.&lt;br /&gt;
&lt;br /&gt;
La forma más efectiva de hacerlo (en términos de memoría) es haciendo uso de los prototypes de las funciones tal y como sigue:&lt;br /&gt;
&lt;br /&gt;

&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/cc75a869108f906e24f2.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
PD: Sacado del curso de &lt;b&gt;Udacity-Object Oriented Javascript&lt;/b&gt;  (&lt;a href=&quot;https://www.udacity.com/course/ud015&quot;&gt;https://www.udacity.com/course/ud015&lt;/a&gt;), si puedes hazlo.</description><link>http://ivo43.blogspot.com/2014/11/javascript-haciendo-herencia-traves-del.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-3822520378831034706</guid><pubDate>Fri, 26 Sep 2014 10:42:00 +0000</pubDate><atom:updated>2014-09-26T12:42:28.229+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">case</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">random</category><category domain="http://www.blogger.com/atom/ns#">sql</category><category domain="http://www.blogger.com/atom/ns#">update</category><title>MYSQL: Updating column with a random codified value</title><description>&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/04cfd497ce7e87c1a938.js&quot;&gt;&lt;/script&gt;</description><link>http://ivo43.blogspot.com/2014/09/mysql-updating-column-with-random.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-1167386422548474700</guid><pubDate>Mon, 19 May 2014 11:31:00 +0000</pubDate><atom:updated>2014-05-19T13:31:04.326+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">binary</category><category domain="http://www.blogger.com/atom/ns#">domains</category><category domain="http://www.blogger.com/atom/ns#">grails</category><category domain="http://www.blogger.com/atom/ns#">plugin</category><category domain="http://www.blogger.com/atom/ns#">reuse</category><title>Grails, reusing domains with a binary plugin</title><description>How should I do in order to reuse my domains?&lt;br /&gt;
Use your own domain&#39;s plugin, this is how.&lt;br /&gt;
&lt;br /&gt;
Just create your plugin:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
grails create-plugin book-remote&lt;br /&gt;...{work as usual with your domains}...&lt;/blockquote&gt;
&lt;br /&gt;
Change your groupId/version and set binary as default type of packaging:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;BookRemoteGrailsPlugin.groovy&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String groupId = &#39;com.nortia.book&#39;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String version = &#39;0.1&#39;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String packaging = &#39;binary&#39;&lt;/blockquote&gt;
&lt;br /&gt;
Install into local maven repo (or wherever you want to):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
grails &amp;nbsp;maven install --binary&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, you have include your plugin as a dependency for your grails app:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;BuildConfig.groovy&lt;/b&gt;:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; dependencies {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//Since it is &amp;nbsp;binary plugin is goes here instead of in the &#39;plugins&#39; section&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;compile &#39;com.nortia.book:book-remote:0.1&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#39;s it! :D&lt;br /&gt;
PD: There is no need for the plugin to be &#39;binary&#39; unless you&#39;re planning to use those domains in another groovy (no grails) project (which was my case).</description><link>http://ivo43.blogspot.com/2014/05/grails-reusing-domains-with-binary.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-2316110565041163394</guid><pubDate>Wed, 14 May 2014 15:55:00 +0000</pubDate><atom:updated>2014-08-27T12:20:37.746+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">gorm</category><category domain="http://www.blogger.com/atom/ns#">grails</category><category domain="http://www.blogger.com/atom/ns#">griffon</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><title>Integrando Gorm en Griffon</title><description>Con los últimos anuncios de Graeme Rocher sobre la integración de Gorm en cualquier script Groovy:(ver&amp;nbsp;&lt;a href=&quot;https://gist.github.com/graemerocher/c25ec929d9bcd1adcbea&quot;&gt;https://gist.github.com/graemerocher/c25ec929d9bcd1adcbea&lt;/a&gt;):&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/graemerocher/c25ec929d9bcd1adcbea.js&quot;&gt;&lt;/script&gt;

Lo que pedía el cuerpo era hacer un intento para incluir Gorm en un ejemplo sencillo de Griffon.&lt;br /&gt;
El código completo esta en el siguiente repo (&lt;a href=&quot;https://github.com/ivanarrizabalaga/BookGorm&quot;&gt;https://github.com/ivanarrizabalaga/BookGorm&lt;/a&gt;), y las partes relevantes son:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;BuildConfig.groovy:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;box-sizing: border-box; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; line-height: 18px; text-color: white !important;&quot;&gt;&lt;div class=&quot;line&quot; id=&quot;LC160&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;repositories&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC161&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;griffonHome&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC165&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenLocal&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC166&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenCentral&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC167&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenRepo&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;http://snapshots.repository.codehaus.org&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC168&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenRepo&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;http://repository.codehaus.org&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC169&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenRepo&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;http://download.java.net/maven/2/&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC170&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenRepo&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;http://repository.jboss.com/maven2/&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC171&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenRepo&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;http://repo.spring.io/milestone&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC172&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;mavenRepo&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;http://repo.spring.io/release&quot;&lt;/span&gt;        &lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC176&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC177&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;dependencies&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC181&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;runtime&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;org.grails:grails-datastore-gorm-hibernate4:3.0.0.RELEASE&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC182&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;runtime&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;org.grails:grails-spring:2.3.6&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC183&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;runtime&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;com.h2database:h2:1.3.164&quot;&lt;/span&gt;        &lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC184&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;compile&lt;/span&gt; &lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;org.springframework:spring-expression:3.2.4.RELEASE&quot;&lt;/span&gt;        &lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC185&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Initialize.groovy:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;box-sizing: border-box; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; line-height: 18px;&quot;&gt;&lt;div class=&quot;line&quot; id=&quot;LC25&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #999988; font-style: italic;&quot;&gt;//TODO Should be a Spring bean&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC26&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: #990000; font-weight: bold;&quot;&gt;HibernateDatastoreSpringInitializer&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;bookgorm&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;).&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC27&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;configureForDataSource&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;DriverManagerDataSource&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC28&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;Driver&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC29&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&#39;sa&#39;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC30&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC31&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;src/main/bookgorm/Book.groovy:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;box-sizing: border-box; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; line-height: 18px;&quot;&gt;&lt;div class=&quot;line&quot; id=&quot;LC1&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;kn&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;bookgorm&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC2&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;kn&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot; style=&quot;box-sizing: border-box; color: #555555;&quot;&gt;grails.persistence.Entity
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;nn&quot; style=&quot;box-sizing: border-box; color: #555555;&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;nn&quot; style=&quot;box-sizing: border-box; color: #555555;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;nn&quot; style=&quot;box-sizing: border-box; color: #555555;&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;nn&quot; style=&quot;box-sizing: border-box; color: #555555;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC4&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;nd&quot; style=&quot;box-sizing: border-box;&quot;&gt;@Entity&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC5&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;kd&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;box-sizing: border-box; color: #445588; font-weight: bold;&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC6&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;  String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;title&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC7&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;  String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;author&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC9&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kd&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;constraints&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC10&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;nl&quot; style=&quot;box-sizing: border-box;&quot;&gt;blank:&lt;/span&gt;&lt;span class=&quot;kc&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC11&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;author&lt;/span&gt; &lt;span class=&quot;nl&quot; style=&quot;box-sizing: border-box;&quot;&gt;blank:&lt;/span&gt;&lt;span class=&quot;kc&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC12&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;b&gt;}&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC14&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;BookController.groovy:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;box-sizing: border-box; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; line-height: 18px;&quot;&gt;&lt;div class=&quot;line&quot; id=&quot;LC12&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #445588; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;box-sizing: border-box; color: #990000; font-weight: bold;&quot;&gt;loadData&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(){&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC13&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;List&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;books&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC14&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;edt&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC15&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;books&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;addAll&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;books&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC16&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC17&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC18&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC19&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC20&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #445588; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;addBook&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;evt&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kc&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC21&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot; style=&quot;box-sizing: border-box;&quot;&gt;title:&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;titleField&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nl&quot; style=&quot;box-sizing: border-box;&quot;&gt;author:&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;authorField&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC22&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC23&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;edt&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC24&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;books&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC25&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;titleField&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC26&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;authorField&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC27&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC28&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC29&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC30&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #445588; font-weight: bold;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;clearAll&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;evt&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kc&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC31&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;executeUpdate&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;box-sizing: border-box; color: #dd1144;&quot;&gt;&quot;delete Book&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;)&lt;/span&gt;    &lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC32&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;edt&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC33&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box;&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;books&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box; color: teal;&quot;&gt;clear&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC34&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line&quot; id=&quot;LC35&quot; style=&quot;box-sizing: border-box; height: 18px; padding-left: 10px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; font-weight: bold;&quot;&gt;}&lt;/span&gt;    &lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
Mola, no?&lt;br /&gt;
¡A cuidarse!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description><link>http://ivo43.blogspot.com/2014/05/integrando-gorm-en-griffon.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-7955056177351137013</guid><pubDate>Sat, 26 Apr 2014 07:19:00 +0000</pubDate><atom:updated>2014-04-26T09:19:44.240+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cheatsheet</category><category domain="http://www.blogger.com/atom/ns#">git</category><title>Mi &#39;chuleta&#39; de Git</title><description>Llevo meses usando una especie de servilleta vieja donde apunto los comandos básicos de Git que siempre se me olvidan.&lt;br /&gt;
&lt;br /&gt;
Hoy tenía que recoger la habitación y aunque no descarto que la hoja en cuestión acabe teniendo valor histórico creo que es momento de volcarlo a un mini-post que me sirva como &#39;cheatsheet&#39; personal.&lt;br /&gt;
&lt;br /&gt;
Hay 1000 recursos por ahi fuera mucho más estructurados y más completos, esto es simplemente mi versión ultrasimplificada&lt;br /&gt;
&lt;br /&gt;
Los comandos hacen referencia a un hipotético escenario donde se trabaja sobre 3 entornos (desarrollo, staging, produccion), desplegando la aplicación sobre Heroku.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/11313887.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;</description><link>http://ivo43.blogspot.com/2014/04/mi-chuleta-de-git.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-706165530666205601</guid><pubDate>Tue, 22 Apr 2014 09:22:00 +0000</pubDate><atom:updated>2014-04-22T11:22:34.257+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">map</category><category domain="http://www.blogger.com/atom/ns#">object</category><category domain="http://www.blogger.com/atom/ns#">snippet</category><title>Convirtiendo Groovy objects en Maps</title><description>En groovy convertir las propiedades de un objecto en un Map es una labor practicamente inmediata:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/11171419.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
Nota: Si el objecto no es un objeto simple sino que esta compuesto de otros objetos complejos estos campos serán mapeados igualmente pero tal cual son, sin transformarse en Maps.</description><link>http://ivo43.blogspot.com/2014/04/convirtiendo-groovy-objects-en-maps.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-6411401811171599295</guid><pubDate>Thu, 20 Mar 2014 15:15:00 +0000</pubDate><atom:updated>2014-03-20T16:15:03.202+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">corralated</category><category domain="http://www.blogger.com/atom/ns#">example</category><category domain="http://www.blogger.com/atom/ns#">sql</category><category domain="http://www.blogger.com/atom/ns#">update</category><title>SQL Corralated Update</title><description>O como hacer un update en una tabla según una condicion que involucre a una segunda tabla.

Por ejemplo si tenemos:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;tablaPadre (id, tablaHija_id)
tablaHija(id,tablaPadre_id)&lt;/pre&gt;
&lt;br /&gt;
Y resulta q por un error de carga o algo similar la columna tablaPadre_id no esta bien cargada, podemos actualizar esa tablaHija según los datos de la tablaPadre usando la siguiente query:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;UPDATE tablaHija th
SET tablaPadre_id = (
   SELECT t.id
   FROM tablaPadre tp
   WHERE tp.tablaHija_id = th.id)
WHERE EXISTS (
   SELECT 1
   FROM tablaPadre tp
   WHERE tp.tablaHija_id = th.id);&lt;/pre&gt;
&lt;br /&gt;
De esta forma los valores de la columna de la tablaPadre se usarán para dar valor a la columna vacia de la tablaHija.&lt;br /&gt;
&lt;br /&gt;
Ale, chao!</description><link>http://ivo43.blogspot.com/2014/03/sql-corralated-update.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-403044915215400584</guid><pubDate>Wed, 12 Mar 2014 15:51:00 +0000</pubDate><atom:updated>2014-03-12T16:51:44.766+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">replace</category><category domain="http://www.blogger.com/atom/ns#">sed</category><title>Replace en fichero tocho con &#39;sed&#39;</title><description>Si alguna vez te has visto obligado a hacer un &#39;Replace All&#39; en un fichero de texto grande (&amp;gt; 500MB) sabras que la experiencia es casi religiosa.&lt;br /&gt;
&lt;br /&gt;
El editor de turno se queda colgado al abrir y al reemplazar y no queda dios ni semidios del que no te hayas acordado.&lt;br /&gt;
&lt;br /&gt;
La solucion pasa por usar el comando &lt;strong&gt;sed&lt;/strong&gt; de linux:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sed -i.bak &#39;s/datamart_desa/datamart/&#39; fich.sql&lt;/pre&gt;
&lt;br /&gt;
En este ejemplo se reemplaza la cadena &quot;&lt;strong&gt;datamart_desa&lt;/strong&gt;&quot; por &quot;&lt;strong&gt;datamart&lt;/strong&gt;&quot; en el fichero &#39;&lt;strong&gt;fich.sql&lt;/strong&gt;&#39; generando (por si acaso) un backup con el nombre &#39;&lt;strong&gt;fich.sql.bak&lt;/strong&gt;&#39;.&lt;br /&gt;
&lt;br /&gt;
En un ejemplo concreto con un fichero de 870MB tarda unos 10sec., ¡una maravilla oiga!&lt;br /&gt;
&lt;br /&gt;
De nada, :D</description><link>http://ivo43.blogspot.com/2014/03/replace-en-fichero-tocho-con-sed.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-1039154426562698284</guid><pubDate>Fri, 21 Feb 2014 11:04:00 +0000</pubDate><atom:updated>2014-02-21T12:04:44.065+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">kill</category><category domain="http://www.blogger.com/atom/ns#">list</category><category domain="http://www.blogger.com/atom/ns#">ps</category><category domain="http://www.blogger.com/atom/ns#">task</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Windows: Kill / ps equivalentes</title><description>Como se puede listar las tareas/procesos de windows desde línea de comandos?
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;tasklist&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
Como se puede matar un proceso a partir de su id?
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Taskkill /PID 756 /F&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;span style=&quot;line-height: 1.5;&quot;&gt;De nada! :D.&lt;/span&gt;</description><link>http://ivo43.blogspot.com/2014/02/windows-kill-ps-equivalentes.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-1224115904714768253</guid><pubDate>Thu, 06 Feb 2014 12:05:00 +0000</pubDate><atom:updated>2014-02-06T13:05:58.936+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">fields</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">print</category><category domain="http://www.blogger.com/atom/ns#">properties</category><category domain="http://www.blogger.com/atom/ns#">reflection</category><category domain="http://www.blogger.com/atom/ns#">test</category><title>Groovy: Imprimiendo las properties de un objeto </title><description>A veces, en especial mientras ejecutas tests, necesitas sacar la información de tus objetos de dominio.&lt;br /&gt;
&lt;br /&gt;
Empiezas con un println sencillo y al rato tu código apesta porque tienes println infumables que además habrá que revisar el día que cambias la definición de tus clases.&lt;br /&gt;
&lt;br /&gt;
Así que para ahorrarme estos disgustos he acabado haciendo una clase muy sencilla que directamente te permite sacar la información de cualquier dominio (o listas de dominios) de forma genérica.&lt;br /&gt;
&lt;br /&gt;
El código mezclando groovy con la api de reflection de java queda como sigue:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/8842787.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
Si vas por partes verás que es muy sencillo, el único detalle más complicado tiene que ver con los campos heredados ya que hay que escalar en la jerarquía para poder listarlos.&lt;br /&gt;
&lt;br /&gt;
Ale, espero que le sirve a alguien!&lt;br /&gt;
Iván.</description><link>http://ivo43.blogspot.com/2014/02/groovy-imprimiendo-las-properties-de-un.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-9071550164509427881</guid><pubDate>Fri, 24 Jan 2014 12:50:00 +0000</pubDate><atom:updated>2014-01-24T13:50:20.163+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">curly brackets</category><category domain="http://www.blogger.com/atom/ns#">gist</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">regexp</category><title>Groovy regexp: Capturing inside curly brackets</title><description>Right to the snippet, :D


&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/8596583.js&quot;&gt;&lt;/script&gt;</description><link>http://ivo43.blogspot.com/2014/01/groovy-regexp-capturing-inside-curly.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-4269117778490824968</guid><pubDate>Sun, 29 Dec 2013 08:00:00 +0000</pubDate><atom:updated>2014-09-26T12:38:41.791+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">update-java-alternatives</category><category domain="http://www.blogger.com/atom/ns#">version</category><title>Ubuntu 12.04: switch java version</title><description>En ocasiones necesitas poder cambiar fácilmente la versión actual de tu jdk para probar bajo diferentes JVMs.&lt;br /&gt;
&lt;br /&gt;
Si solamente quieres actualizar la versión la mejor opción es usar un repo que te sirve las versiones más habituales (open, oracle, 6 y 7) y en este caso sólo tendrás que hacer lo siguiente:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; sudo add-apt-repository ppa:webupd8team/java
 sudo apt-get update
 sudo apt-get install oracle-java7-installer&lt;/pre&gt;
&lt;br /&gt;
Una vez descargadas/instaladas las versiones que necesites, en ubuntu sólo tendrás que usar:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;update-java-alternatives&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
Si por el contrario tienes/quieres descargar las jvms a mano, basta con descomprimirlas en la ruta&lt;strong&gt; /usr/lib/jvm&lt;/strong&gt; y a partir de ahi la historia es la misma tanto si vienes del repo como si has hecho la descarga manualmente.&lt;br /&gt;
&lt;br /&gt;
Las versiones disponibles por defecto salen de los ficheros .XX.jinfo que están en la carpeta /usr/lib/jvm donde se debe descomprimir las diferentes maquinas virtuales que se quiera que esten disponibles.&lt;br /&gt;
&lt;br /&gt;
El fichero .java-7-oracle.jinfo (por ejemplo) estará si haces la instalación con el repo, en caso contrario tienes que hacerlo tu mismo (busca por internet para saber que tienes que poner).&lt;br /&gt;
&lt;br /&gt;
Ahora puedes ver las alternativas que estan &quot;declaradas&quot;:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; sudo update-java-alternatives -l&lt;/pre&gt;
&lt;pre&gt; java-1.6.0-openjdk-i386 1061 /usr/lib/jvm/java-1.6.0-openjdk-i386
 java-7-oracle 1062 /usr/lib/jvm/java-7-oracle
 jdk1.6.0_45 1062 /usr/lib/jvm/jdk1.6.0_45&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
Y cambiar tanto java, javac, como toda su utileria a la opción deseada haciendo:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sudo update-java-alternatives -s jdk1.6.0_45&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
Normalmente con esto es suficiente y puedes comprobarlo haciendo:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; java -version
 java version &quot;1.6.0_45&quot;
 Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
 Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)&lt;/pre&gt;
&lt;br /&gt;
No obstante es posible que al intentar ejecutar la actualización de las variables que salgan un porron de mensajes como este:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; update-alternatives: error: alternative /usr/lib/jvm/jdk1.6.0_45/jre/bin/java for java not registered, not setting.&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
En este caso no tienes más opción que registrar las alternativas manualmente (lo mejor es hacer un pequeño script incluyendo todos los errores iguales):
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sudo update-alternatives --install &quot;/usr/bin/java&quot; &quot;java&quot; &quot;/usr/lib/jvm/jdk1.6.0_45/jre/bin/java&quot; 1 --force&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
Tienes que tener en cuenta que el funcionamiento de las &quot;alternatives&quot; se basa en crear enlaces simbólicos (accesos directos) siguiendo el siguiente patrón:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;/usr/bin/java -&amp;gt; 
/etc/alternatives/java -&amp;gt; 
/usr/lib/jvm/jdk1.6.0_45/jre/bin/java&lt;/pre&gt;
&lt;br /&gt;
Una vez arreglados esos problemas si vuelves a hacer el update-java-alternatives debería ir todo bien y la versión estaría perfectamente cambiada.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;NOTA:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
En algunos casos más allá de incluir los ejecutables en el /usr/bin hace falta declarar un &lt;strong&gt;JAVA_HOME.&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Esto no lo has hecho con todo lo anterior así que si lo necesitas debes editarlo en /etc/environment:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;JAVA_HOME=&quot;/usr/lib/jvm/jdk1.6.0_45&quot;&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
Para que este cambio surga efecto debes hacer logout como mínimo.</description><link>http://ivo43.blogspot.com/2013/12/ubuntu-1204-switch-java-version.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-949071842635424079</guid><pubDate>Fri, 20 Dec 2013 09:09:00 +0000</pubDate><atom:updated>2013-12-20T10:09:04.016+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">griffon</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">jformattedtextfield</category><category domain="http://www.blogger.com/atom/ns#">numbers</category><category domain="http://www.blogger.com/atom/ns#">numeros</category><category domain="http://www.blogger.com/atom/ns#">textfield</category><title>Griffon: Números y campos de texto</title><description>Cuando en vez un input normal se quiere garantizar que la entrada cumple un formato o tipo de valor específico hace falta irse a su hermano &#39;raro&#39; el&amp;nbsp;JFormattedTextField.&lt;br /&gt;
&lt;br /&gt;
Para conseguir que funcione bien en Griffon lo primero es entender correctamente como funciona en Java, así que tal vez debas echar un ojo a este enlace:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://docs.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html&quot; style=&quot;line-height: 1.5;&quot;&gt;http://docs.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Aunque siendo realista, es posible que no te apetezca leer tanto así que te pongo un ejemplo básico y listo, :D.&lt;br /&gt;
&lt;br /&gt;
En este ejemplo vamos a ver como se hace el binding de valores de un formattedTextField:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;

&lt;a href=&quot;http://wiki.nortia-in.com/wp-content/uploads/2013/12/formattedText_example.png&quot;&gt;&lt;img alt=&quot;Griffon JFormattedTextField sample&quot; class=&quot;aligncenter size-medium wp-image-669&quot; height=&quot;229&quot; src=&quot;http://wiki.nortia-in.com/wp-content/uploads/2013/12/formattedText_example-300x229.png&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;Model&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/8052216.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;strong&gt;View&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/8052237.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
A partir de ahi cualquier necesidad diferente pasará casi siempre por jugar con el NumberFormat para crear la máscara adecuada y demás historias.&lt;br /&gt;
&lt;br /&gt;
Ale, que la fuerza te acompañe!</description><link>http://ivo43.blogspot.com/2013/12/griffon-numeros-y-campos-de-texto.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-6052388101478580075</guid><pubDate>Sat, 14 Dec 2013 14:29:00 +0000</pubDate><atom:updated>2013-12-14T15:29:09.360+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">code war</category><category domain="http://www.blogger.com/atom/ns#">code.org</category><category domain="http://www.blogger.com/atom/ns#">programador</category><category domain="http://www.blogger.com/atom/ns#">spain</category><title>Code war</title><description>En la historía de la humanidad siempre ha habido guerras, seguramente este en nuestra genética, no sabemos estarnos quietecitos.&lt;br /&gt;
&lt;br /&gt;
Al principio algunos luchaban por su libertad:&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/lEOOZDbMrgE&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
más adelante muchos lucharon contra muchos:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://commons.wikimedia.org/wiki/File%3AI_want_you_for_U.S._Army_3b48465u_original.jpg&quot; title=&quot;By James Montgomery Flagg [Public domain or Public domain], via Wikimedia Commons&quot;&gt;&lt;img alt=&quot;I want you for U.S. Army 3b48465u original&quot; src=&quot;//upload.wikimedia.org/wikipedia/commons/thumb/7/7e/I_want_you_for_U.S._Army_3b48465u_original.jpg/256px-I_want_you_for_U.S._Army_3b48465u_original.jpg&quot; width=&quot;256&quot; /&gt;&lt;/a&gt;

&lt;br /&gt;
&lt;br /&gt;
y así hasta nuestros días.&lt;br /&gt;
&lt;br /&gt;
El caso es que poco a poco intentamos ser más civilizados (aunque honestamente no lo conseguimos demasiado) así que para la próxima guerra ya se están reclutando los nuevos soldados y muchas de las balas serán sockets, callbacks y raspberrys.&lt;br /&gt;
&lt;br /&gt;
¿Quée?&lt;br /&gt;
Pues eso, en los próximos años se librarán muchas batallas, algunas tendrán pocos muertos pero muchas victimas (económica o socialmente hablando) y cada frente se está preparando para ello.&lt;br /&gt;
&lt;br /&gt;
En Corea, China, Japón y similar, los niños son presionados por sus padres y profesores para ser la mejor versión de si mismos intelectualmente hablando y en vez de futbolistas muchos de esos pezqueñines sueñan con hacer saltar la banca.&lt;br /&gt;
&lt;br /&gt;
En vista de esto US ya se ha puesto manos a la obra y no quiere quedar atrás de ningún modo, haciendo un llamamiento a la juventud a que se aliste al frente y haga fuertes sus trincheras:&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/6XvmhE1J9PY&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
Mola, ¿no?&lt;br /&gt;
Pues figurate si te lo pide Shakira, Asthon Kutcher o similar:&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/FC5FbmsH4fw&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
Y es que encima, estos frentes de nueva creación no entienden de nacionalidades, si quieres te puedes unir al frente de &lt;i&gt;Coders Lapones&lt;/i&gt;, eso depende ti y tu habilidad.&lt;br /&gt;
&lt;br /&gt;
El caso es que está oportunidad no ya puede dejar pasar España y ya se han puesto manos a la obra toda la piara de asesores de nuestros mandatarios para contrarrestar estas iniciativas y mover a nuestros jóvenes al futuro:&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/4tZQtU8QiiY&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
Podemos estar tranquilos, nos van a dar tal paliza que no nos dolerá.&lt;br /&gt;
&lt;br /&gt;</description><link>http://ivo43.blogspot.com/2013/12/code-war.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-5934062932016092518</guid><pubDate>Thu, 12 Dec 2013 16:43:00 +0000</pubDate><atom:updated>2013-12-12T17:44:00.973+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">griffon</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">install</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">update-alternatives</category><category domain="http://www.blogger.com/atom/ns#">version</category><title>Griffon: Varias versiones en Ubuntu</title><description>Es posible que quieras mantener varias versiones de Griffon disponibles en tu Ubuntu y te habrás preguntado como se puede hacer eso.&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
La opción más &#39;pro&#39; sería basarse en el uso de &#39;update-alternatives&#39; pero como buscamos algo realmente sencillo vamos a tirar de enlaces simbolicos.&lt;br /&gt;
&lt;br /&gt;
Al tema:&lt;br /&gt;
&lt;br /&gt;
Descomprimir el tar/zip en la carpeta &lt;strong&gt;/usr/share&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Irse a la carpeta de comunes:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;cd /usr/share&lt;/pre&gt;
&lt;br /&gt;
Asegurarse que la carpeta y sus archivos tienen el mismo user/group que el resto de &#39;ejecutables&#39;:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;sudo chown -R root:root griffon-1.2.0&lt;/pre&gt;
&lt;br /&gt;
Actualizar/Crear (si es la primera vez) el enlace simbolico a la version que queramos:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;ln -sfn griffon-1.2.0 griffon&lt;/pre&gt;
&lt;br /&gt;
Actualizar/Crear 3 enlaces simbólicos a los scripts principales de Griffon desde el bin para que este accesible en el path:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; /usr/bin/griffon -&amp;gt; /usr/share/griffon/bin/griffon 
 /usr/bin/griffon-debug -&amp;gt; /usr/share/griffon/bin/griffon-debug
 /usr/bin/griffonsh -&amp;gt; /usr/share/griffon/bin/griffonsh&lt;/pre&gt;
&lt;br /&gt;
Para comprobar que esta todo correcto podemos hacer desde cualquier carpeta:
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt; griffon -version 
------------------------------------------------------------
 Griffon 1.2.0
------------------------------------------------------------&lt;/pre&gt;
&lt;br /&gt;
y debería salir la versión a la que estemos apuntando.&lt;br /&gt;
&lt;br /&gt;
Como última nota recordar que siempre que hay un &#39;ejecutable&#39; en el path podemos recordar de donde sale haciendo:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; which griffon
 --&amp;gt;/usr/bin/griffon&lt;/pre&gt;
</description><link>http://ivo43.blogspot.com/2013/12/es-posible-que-quieras-mantener-varias.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-962242122614960464</guid><pubDate>Mon, 02 Dec 2013 10:41:00 +0000</pubDate><atom:updated>2013-12-02T11:41:00.829+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">containsAny</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">inject</category><category domain="http://www.blogger.com/atom/ns#">list</category><category domain="http://www.blogger.com/atom/ns#">snippet</category><category domain="http://www.blogger.com/atom/ns#">String</category><title>Groovy: String.containsAny </title><description>A veces es necesario comprobar que una cadena no contiene ninguno de los términos &quot;prohibidos&quot; de una lista.&lt;br /&gt;
&lt;br /&gt;
En este caso lo fácil es hacer un pequeña función con un bucle y a correr, pero como esto es Groovy y somos más guays queremos hacer que la clase String tenga un método que nos resuelva la papeleta para no ir llenando nuestro código con funciones de este estilo o en el menos malo de los casos creando una clase helper con un método estático o alguna cosa así.&lt;br /&gt;
&lt;br /&gt;
Así que al lio:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/7525771.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
El truco aqui esta en usar la inyección de métodos del &lt;b&gt;metaClass &lt;/b&gt;por un lado y sobre todo sacar provecho de la función &lt;b&gt;inject &lt;/b&gt;que está disponible para listas.&lt;br /&gt;
&lt;br /&gt;
Esta función lo que hace es ejecutar un closure sobre cada elemento de la lista arrastrando el valor de la ejecución en cada elemento hacia el siguiente.&lt;br /&gt;
&lt;br /&gt;
Mola verdad? :D</description><link>http://ivo43.blogspot.com/2013/12/groovy-stringcontainsany.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-3004995552191203573</guid><pubDate>Wed, 27 Nov 2013 17:00:00 +0000</pubDate><atom:updated>2013-11-27T18:00:30.228+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">add</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">list</category><category domain="http://www.blogger.com/atom/ns#">operators</category><title>Groovy: Añadir elementos a una lista (cuidadin!!)</title><description>Aunque parezca mentira (&quot;me pongo colorada...&quot;), no en serio, aunque no te lo creas añadir un elemento a una lista de groovy puede resultar peligroso.&lt;br /&gt;
&lt;br /&gt;
Las siguientes instrucciones no hacen lo mismo siempre:&lt;br /&gt;
&lt;pre&gt;output+=item
output.add(item)

&lt;/pre&gt;
&lt;br /&gt;
Si el elemento es una lista la primera operacion implica añadir los elementos de la lista y la segunda inserta en la lista destino un objeto de tipo lista.&lt;br /&gt;
&lt;br /&gt;
Si no te lo crees chequea esto:&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/7678235.js&quot;&gt;&lt;/script&gt;

Ale, a seguir grooveando con cuidado!</description><link>http://ivo43.blogspot.com/2013/11/groovy-anadir-elementos-una-lista.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-5710770786583992202</guid><pubDate>Mon, 18 Nov 2013 10:33:00 +0000</pubDate><atom:updated>2013-11-18T11:33:35.815+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">down</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">list</category><category domain="http://www.blogger.com/atom/ns#">snippet</category><category domain="http://www.blogger.com/atom/ns#">up</category><title>Groovy: Mover seleccion de elementos arriba y abajo</title><description>A veces a partir de una lista de elementos se pide poder &quot;subir&quot; o &quot;bajar&quot; una subselección de tu lista.&lt;br /&gt;
&lt;br /&gt;
Es una operación que se puede hacer de muchas formas, pero en groovy se puede jugar un poco con el lenguaje para que sea más chulo el código y sobretodo para poder usar lo mismo en ambas direcciones.&lt;br /&gt;
&lt;br /&gt;
Ale, ahi va...&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/7353040.js&quot;&gt;&lt;/script&gt;</description><link>http://ivo43.blogspot.com/2013/11/groovy-mover-seleccion-de-elementos.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-5690443374872812317</guid><pubDate>Sat, 02 Nov 2013 11:03:00 +0000</pubDate><atom:updated>2013-11-02T12:03:25.149+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">replace</category><category domain="http://www.blogger.com/atom/ns#">sql</category><title>MySQL: Update a pattern in database</title><description>Sometimes you need to change an specific string not only in one column but in each and every column all along your database.

If you are in this circumstance this little snippet might help you:


&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/7247799.js&quot;&gt;&lt;/script&gt;


It simple creates a bunch of updates by scanning all string columns (var, varchar) all through the database.

Hope it helps!</description><link>http://ivo43.blogspot.com/2013/11/mysql-update-pattern-in-database.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-7596195723943219372</guid><pubDate>Wed, 09 Oct 2013 10:58:00 +0000</pubDate><atom:updated>2013-10-09T13:49:32.155+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">dot-operator</category><category domain="http://www.blogger.com/atom/ns#">dynamic</category><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">gstring</category><category domain="http://www.blogger.com/atom/ns#">inject</category><title>Groovy: Dynamic access to nested properties via GString</title><description>In groovy you can easily access properties by using GString which a really cool feature.
&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/6899893.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
However this trick doesnt work when nested &#39;.&#39; are inside de expression.&lt;br /&gt;
&lt;br /&gt;
In this case you can do the following:
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ivanarrizabalaga/6899973.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
That&#39;s all!</description><link>http://ivo43.blogspot.com/2013/10/groovy-dynamic-access-to-nested.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-4990250860355381904</guid><pubDate>Fri, 27 Sep 2013 12:42:00 +0000</pubDate><atom:updated>2013-09-27T14:43:05.612+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">groovy</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">spring</category><category domain="http://www.blogger.com/atom/ns#">testing</category><title>Groovy, spring, transactional y un pequeño apunte</title><description>Spring hace aveces magia negra, lo cual está muy bien salvo cuando no funciona y tienes que pararte a mirar que coño de hechizos está usando, :D.&lt;br /&gt;
&lt;br /&gt;
El caso es que si tienes problemas con la gestión de transacciones delegadas a las anotaciones de Spring es probable que quieras hacer un test unitario para ver si las conexiones se cierran o no.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Como configurar el test de groovy para que ejecute la política de transacciones que quieras?&lt;/strong&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;br /&gt;
&lt;pre&gt;@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = [&quot;classpath:/beans/misBeans1.xml&quot;,&quot;classpath:/beans/misBeans2.xml&quot;])
@TransactionConfiguration(transactionManager=&quot;transactionManager&quot;, defaultRollback=false)
class SpringConnectionsTest{

 static final Logger log=Logger.getLogger(SpringConnectionsTest.class)

 @Autowired
 ApplicationContext context;&lt;/pre&gt;
&lt;pre&gt;@Before
void setTup(){
....
}&lt;/pre&gt;
&lt;pre&gt;@Test
void testSomething(){
...
}&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Así que basicamente se trata de quitar la herencia al GroovyTestCase que tendría por defecto al ser un test de groovy.&lt;/li&gt;
&lt;li&gt;Indicar los ficheros de beans que se quieren cargar.&lt;/li&gt;
&lt;li&gt;Inyectar el bean (en el ejemplo cogemos el contexto podría ser cualquier bean) con @Autowired.&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;Como podemos ver que métodos se registran para el control de transacciones?&lt;/strong&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;br /&gt;
&lt;pre&gt;log4j.logger.org.springframework.transaction=DEBUG&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;strong&gt;Cómo podemos ver cuándo se pilla una conexion nueva o se reutiliza una?&lt;/strong&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;br /&gt;
&lt;pre&gt;log4j.logger.org.springframework.jdbc.datasource.DataSourceUtils=DEBUG&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;strong&gt;Mi método no lo engancha, ¿qué pasa?&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Podrían ser 1000 cosas, pero recuerda que el &lt;em&gt;transactionManager&amp;nbsp;&lt;/em&gt;solo funciona con métodos públicos.

&amp;nbsp;

</description><link>http://ivo43.blogspot.com/2013/09/groovy-spring-transactional-y-un.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-1678923422782919323</guid><pubDate>Tue, 18 Jun 2013 12:26:00 +0000</pubDate><atom:updated>2013-06-18T14:26:04.992+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">config</category><category domain="http://www.blogger.com/atom/ns#">memory</category><category domain="http://www.blogger.com/atom/ns#">permsize</category><category domain="http://www.blogger.com/atom/ns#">service</category><category domain="http://www.blogger.com/atom/ns#">tomcat</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Configurar memoria Tomcat como &#39;windows service&#39;</title><description>Cuando manejamos un Tomcat instalado en un servidor Linux personalizar las opciones de memoria (heap mínima, máxima, permsize, ..) se reduce a meter las variables o bien en las variables de entorno (JAVA_OPTS, CATALINA,OPTS) o bien a modificar el script de arranque directamente.&lt;br /&gt;
&lt;br /&gt;
Sin embargo cuando el servidor es un Windows y el Tomcat está instalado como servicio la cosa difiere un poco de lo habitual, y la verdad, cuesta un poco encontrarlo.&lt;br /&gt;
&lt;br /&gt;
En este caso en la carpeta
&lt;br /&gt;
&lt;pre&gt;TOMCAT_HOME\bin&lt;/pre&gt;
&lt;br /&gt;hay un ejecutable&amp;nbsp;&lt;strong&gt;Tomcat6w.exe&lt;/strong&gt; que permite lanzar una herramienta para arrancar/parar/reiniciar el servidor y a su vez cambiar la configuración de paramétros del servicio.&lt;br /&gt;
&lt;br /&gt;
Si la arrancamos tiene una pestaña donde se puede configurar todo lo referente a la memoría y resto de parámetros, una imagen vale más que 1000 palabras:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;

&lt;a href=&quot;http://wiki.nortia-in.com/wp-content/uploads/2013/06/tomcat6w.jpg&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-483&quot; height=&quot;397&quot; src=&quot;http://wiki.nortia-in.com/wp-content/uploads/2013/06/tomcat6w.jpg&quot; title=&quot;tomcat6w&quot; width=&quot;417&quot; /&gt;&lt;/a&gt;

</description><link>http://ivo43.blogspot.com/2013/06/configurar-memoria-tomcat-como-windows.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-11755573.post-9034670912524660881</guid><pubDate>Fri, 15 Mar 2013 09:27:00 +0000</pubDate><atom:updated>2013-03-15T10:27:27.844+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">flow</category><category domain="http://www.blogger.com/atom/ns#">griffon</category><category domain="http://www.blogger.com/atom/ns#">mvc</category><title>Griffon: flujo creacion mvc</title><description>Cuando se crea un MVC a través de una de las variantes de:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;def mvc=buildMVCGroup([arg1:value1,arg2:..],&quot;pintador&quot;)&lt;/pre&gt;
&lt;br /&gt;
es fundamental entender el proceso interno que lleva a la correcta construcción del MVC.

El proceso se ejecuta en 3 fases y en cada de ellas se sigue por defecto el orden lógico (modelo, vista y finalmente controlador *), la secuencia es como sigue:&lt;br /&gt;
&amp;nbsp;

&lt;a href=&quot;http://wiki.nortia-in.com/wp-content/uploads/2012/05/flujo_mvc_init.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-111&quot; height=&quot;135&quot; src=&quot;http://wiki.nortia-in.com/wp-content/uploads/2012/05/flujo_mvc_init.png&quot; title=&quot;flujo_mvc_init&quot; width=&quot;551&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
La primera fase invoca al constructor de cada una de las partes, por ejemplo:
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt;PintadorController(){
 ...
 }&lt;/pre&gt;
&lt;br /&gt;
La segunda fase invoca a los setters de los objetos según los parámetros que se hayan pasado al invocar el buildMVCGroup, por ejemplo:
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt;class PintadorModel{
 def arg1
 ...
 void setArg1(def cosa){
 this.arg1=cosa
 }&lt;/pre&gt;
&lt;br /&gt;
Es importante subrayar que sólo se invoca al setter si los nombres entre el argumento y la propiedad coinciden.

Finalmente se hace el paso de &#39;&lt;em&gt;postproducción&lt;/em&gt;&#39;, llamandose al &lt;strong&gt;mvcGroupInit&lt;/strong&gt; de cada artefacto.
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt;void mvcGroupInit(Map args) {
 ...
 }&lt;/pre&gt;
&lt;br /&gt;
Un truco importante aqui es que el pintado de la pantalla (es decir la ejecución del script &lt;strong&gt;PintadorView.groovy&lt;/strong&gt; en nuestro ejemplo) se realiza en esta última etapa&amp;nbsp;después&amp;nbsp;del mvcGroupInit del modelo (&lt;strong&gt;PintadorModel.groovy&lt;/strong&gt;) lo cual permite hacer uso de bucles limpios en el propio script si fuera necesario algún tipo de calculo añadido sobre el modelo antes de mostrarlo:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;//File: PintadorModel.groovy
 class PintadorModel{
 def arg1
 def objetos
 void mvcGroupInit(Map args){
 objetos=server.getObjetos(arg1)
 }
 }
 ...&lt;/pre&gt;
&lt;pre&gt;//File: PintadorView.groovy
 ...
 vbox(){
 model.objetos.each{
 label $it
 }
 }&lt;/pre&gt;
&lt;br /&gt;
Listo! A partir de ahora hacer mvcs no debería tener ningún secreto.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;*Nota:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
En realidad este orden es así por defecto dado que en la declaración del mvc en el fichero Application.groovy se sigue ese orden, si el orden fuera:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;mvcGroups {
&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt; &#39;pintador&#39; { &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt; 
   model = &#39;com.mycompany.PintadorModel&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt;   controller = &#39;com.mycompany.PintadorController&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt;   view = &#39;com.mycompany.PintadorView&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt; 
 }&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt; 
 ....&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt; 
}&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
el orden de invocación de los artefactos sería ese para cada una de las tres etapas.</description><link>http://ivo43.blogspot.com/2013/03/griffon-flujo-creacion-mvc.html</link><author>noreply@blogger.com (Ivan Arrizabalaga)</author><thr:total>0</thr:total></item></channel></rss>