tag:blogger.com,1999:blog-55274978376023695092024-02-25T00:16:06.435-08:00¡¡¡Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.comBlogger42125tag:blogger.com,1999:blog-5527497837602369509.post-80480686045211242202016-04-05T22:41:00.000-07:002016-04-05T22:41:07.420-07:00Application Loader - Please sign in with an app specific password. You can craeate one at appleid.apple.com.Application Loader started showing the following message:Please sign in with an app specific password. You can craeate one at appleid.apple.com.<br />
<br />
You have to go on this page to solve the issue (follow the steps there): <a href="https://support.apple.com/en-us/HT204397">https://support.apple.com/en-us/HT204397</a><br />
<br />
Then you need to log out from Application Loader and sign in again with your email and the newly generated password.<br />
<br />
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<br />
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<br />
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img alt="Buy TextLab" src="http://textlab-app.com/assets/img/app-store.svg" />
</a>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-18917701008021097962015-11-12T11:46:00.001-08:002015-11-12T13:07:10.802-08:00Performance of Java 8 lambdas and anonymous inner classesThere is a <a href="http://www.oracle.com/technetwork/java/jvmls2013kuksen-2014088.pdf">study with 55 slides</a> by Oracle showing the performance difference between lambda and anonymous inner classes. <br />
<br />
The most important is this slide showing that lambda is slow during warm up and as fast as anonymous classes after <a href="http://docs.oracle.com/cd/E15289_01/doc.40/e15058/underst_jit.htm">JIT</a> optimizes the performance.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbsGTrdwARLhBfkRPuVaFnQVAHINWIpkNuJZvYiZXlD31jOTo4fVVtodlTTST2zUb88XA6WL4aydgrL_ANWy06Q_k2pHNxW3aUEt3TazvPfouNcgTTjp3M4nNEaUP8ptxjsM2xfioM-hcZ/s1600/Screen+Shot+2015-11-12+at+11.26.01+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="475" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbsGTrdwARLhBfkRPuVaFnQVAHINWIpkNuJZvYiZXlD31jOTo4fVVtodlTTST2zUb88XA6WL4aydgrL_ANWy06Q_k2pHNxW3aUEt3TazvPfouNcgTTjp3M4nNEaUP8ptxjsM2xfioM-hcZ/s640/Screen+Shot+2015-11-12+at+11.26.01+AM.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It does NOT mean we should avoid using lambdas. Because they have quite few proposals and ideas for performance improvements (if you want to know what, see the <a href="http://www.oracle.com/technetwork/java/jvmls2013kuksen-2014088.pdf">study</a>) and mainly because lambas are <a href="http://www.infoq.com/articles/Java-8-Lambdas-A-Peek-Under-the-Hood">different</a> to anonymous inner classes. So, it just means we need to wait after JVM gets optimized. And who knows, maybe lambdas are going to be faster than anonymous inner classes.</div>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-18259859341373351012015-10-21T22:58:00.001-07:002015-12-05T21:59:05.450-08:00Java 8 update 60 is causing "Apps that use non-public APIs will be rejected"When you try to publish your JavaFX application into Mac App store with Java 1.8.0_60, you are going to get the following rejection.<br />
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/10b0149416244a66bb06.js"></script>The issue is that Your.app/Contents/PlugIns/Java.runtime/Contents/Home/jre/lib/libjfxwebkit.dylib libray <b>is importing this library libicucore.A.dylib</b>. And this issue is caused (probably) by this issue: <a href="https://bugs.openjdk.java.net/browse/JDK-8098296">Update to Newer Version of WebKit</a>.<br />
<br />
You can verify the issue by running otool for Java 1.8.0_51, 1.8.0_60 and 1.8.0_65. You will find that Java is importing that library since minor version 60.<br />
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/04d90ba520d2ffda463f.js"></script>
<br />
There are 3 possible solutions.<br />
<ol>
<li>Remove libjfxwebkit.dylib from your application </li>
<li>If you need that library, downgrade to Java 1.8.0_51</li>
<li>Wait after <a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8138650">Packager cannot bundle Mac App Store Apps because JavaFX WebKit uses apple private APIs</a> is resolved</li>
</ol>
<div>
------------------------------</div>
<div>
Update 1:</div>
<div>
I just got info by Martijn Verburg that these this is issue will be fixed: </div>
<div>
<div>
<ul>
<li><a href="https://bugs.openjdk.java.net/browse/JDK-8138650">https://bugs.openjdk.java.net/browse/JDK-8138650</a> - fixed for <a href="https://jdk8.java.net/download.html">8u72</a> (b05 still contains reference to that private API)</li>
<li><a href="https://bugs.openjdk.java.net/browse/JDK-8138652">https://bugs.openjdk.java.net/browse/JDK-8138652</a> - permanent fix for 9 (replace private libs with public ones)</li>
</ul>
<div>
------------------------------</div>
<div>
Update 2: </div>
</div>
</div>
<div>
I have got this info from <a href="https://www.mail-archive.com/awt-dev@openjdk.java.net/msg10220.html">mail group</a>: </div>
<blockquote class="tr_bq">
The javapackager fix for JDK 8u72 does exactly this when generating .pkg files. So in short, libjfxwebkit.dylib is unchanged for 8u72, but will be excluded when generating an app for the Apple app store.</blockquote>
So, the solution is to remove libjfxwebkit.dylib from your .app (in case you package the Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-82472135149221954822015-10-21T22:11:00.003-07:002016-03-27T22:35:51.726-07:00Password and U option must have a non-empty value<div style="box-sizing: content-box; color: #282828; font-family: Helvetica, Arial, Verdana, sans-serif; font-size: 14px; margin-bottom: 1px; padding: 0px;">
You need to update <span style="background-color: white; color: #282828; font-family: "helvetica" , "arial" , "verdana" , sans-serif;">xCode to 7.1 version</span> when Application Loader throws these errors:</div>
<div style="box-sizing: content-box; color: #282828; font-family: Helvetica, Arial, Verdana, sans-serif; font-size: 14px; margin-bottom: 1px; padding: 0px;">
</div>
<ul>
<li>"The u option must have a non-empty value"</li>
<li>"The password option must have a non-empty value"<span style="color: #282828; font-family: "helvetica" , "arial" , "verdana" , sans-serif; font-size: 14px;"> </span></li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG0utCNRrRJjKuv4iY97WiT97_fthZIjWtRUN1UVQAvI7ezyKGJL-lcPKyo6i2DicKJp7-nYNeDENHXuuLoiCXA44-H0VMZYgVm1pUmzXUabMkDQlXh_GwP8vGuOGPE5jnikTZs_-Q9Oov/s1600/Screen+Shot+2015-10-21+at+9.04.07+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="420" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG0utCNRrRJjKuv4iY97WiT97_fthZIjWtRUN1UVQAvI7ezyKGJL-lcPKyo6i2DicKJp7-nYNeDENHXuuLoiCXA44-H0VMZYgVm1pUmzXUabMkDQlXh_GwP8vGuOGPE5jnikTZs_-Q9Oov/s640/Screen+Shot+2015-10-21+at+9.04.07+PM.png" width="640" /></a></div>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com1tag:blogger.com,1999:blog-5527497837602369509.post-25143256353039105632014-06-24T14:23:00.002-07:002016-03-27T22:35:39.586-07:00How to install Spark on Mac OS X<br />
<ol>
<li>Download <a href="http://spark.apache.org/downloads.html">http://spark.apache.org/downloads.html</a> </li>
<li>Download <a href="http://www.scala-lang.org/download">http://www.scala-lang.org/download</a> (find the version number in README inside spark archive). </li>
<li>Extract and add on path<br /><span style="font-family: "courier new" , "courier" , monospace;">export SCALA_HOME=/Users/ondrej/scala-2.10.4 <br />export PATH=$PATH:$SCALA_HOME/bin</span></li>
<li>Go to Spark root directory and run in command line: <span style="font-family: "courier new" , "courier" , monospace;">sbt/sbt clean assembly</span></li>
<li>Then start up Spark, also from Spark root folder: <span style="font-family: "courier new" , "courier" , monospace;">./bin/spark-shell</span></li>
</ol>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<br />
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<br />
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img alt="Buy TextLab" src="http://textlab-app.com/assets/img/app-store.svg" />
</a>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-74405203068155537562014-03-05T01:37:00.001-08:002016-03-27T22:36:18.981-07:00Commands to install and configure ElasticSearch on Ubuntu<script src="https://gist.github.com/ondrej-kvasnovsky/9363975.js"></script>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com2tag:blogger.com,1999:blog-5527497837602369509.post-41597228956787952202014-01-23T00:52:00.001-08:002014-01-23T00:52:22.329-08:00How to run custom Grails testsThanks <a class="g-profile" href="https://twitter.com/rudovsky" target="_blank">Jan Rudovský</a> for help with this. The code works with Grails 2.3.x. Use <a href="http://ldaley.com/post/615966534/custom-grails-test">Custom Grails Tests</a> for older versions.<br />
<br />
The code below shows how to run your custom tests in functional test environment (so the application is running). For the integration tests you will need to use <span style="font-family: Courier New, Courier, monospace;">IntegrationTestPhaseConfigurer</span> instead of <span style="font-family: Courier New, Courier, monospace;">FunctionalTestPhaseConfigurer</span>.<br />
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/8575135.js"></script>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-26022593318337578282014-01-10T00:15:00.000-08:002014-01-10T00:15:50.165-08:00Who is using Vaadin plugin for Grails<div class="separator" style="clear: both; text-align: justify;">
We are curious who is using the plugin for integration of Vaadin into a Grails application. We could get little info based on 'likes' displayed on <a href="http://grails.org/plugins/vaadin">grails.org/plugins/vaadin</a>, but that is not reliable.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp3h0y45DhkdssJpTWyC1IlaOz3BItthx5Svviac2Bg7y-BjrH8HIdPNAZRAumiia9onyfwa9-P2D7zdksYVqNBG9tCQzW1DdoJS0vbCLZuMou7rEfnSHfDYWnptHp_y8iNBuf1bj6hu5S/s1600/Screen+Shot+2014-01-10+at+8.45.43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp3h0y45DhkdssJpTWyC1IlaOz3BItthx5Svviac2Bg7y-BjrH8HIdPNAZRAumiia9onyfwa9-P2D7zdksYVqNBG9tCQzW1DdoJS0vbCLZuMou7rEfnSHfDYWnptHp_y8iNBuf1bj6hu5S/s1600/Screen+Shot+2014-01-10+at+8.45.43.png" height="163" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
Then we have made <a href="http://vaadinongrails.com/">vaadinongrails.com</a> page, to provide basic info about the plugin and give a few link to continue with. This page gives us better overview who is interested in the plugin. <a href="http://www.linkedin.com/pub/drahom%C3%ADr-mach/79/ba8/43b">Drahomir Mach</a> did the editorial work, many thanks for that.</div>
<div style="text-align: justify;">
The number of visitors has increased in 2013 probably due to 'Grails integration' chapter that we have included in <a href="http://www.packtpub.com/creating-rich-internet-applications-in-vaadin-7/book">Vaadin 7 Cookbook</a>.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtGqH5pEcsFYvUmBaggXXQOf9-8Yg0KS9YGbVuOw5Xg0tXShYgkcsmTMrSkEwDpIHCXSWvw54rkK5P6jg5MsIdY2vSjPftjVMfYDvxJNbgFfwAP9jv2yel-bfGddtB1cePzkh_5z7Xkuxw/s1600/vaadin-map-2013.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtGqH5pEcsFYvUmBaggXXQOf9-8Yg0KS9YGbVuOw5Xg0tXShYgkcsmTMrSkEwDpIHCXSWvw54rkK5P6jg5MsIdY2vSjPftjVMfYDvxJNbgFfwAP9jv2yel-bfGddtB1cePzkh_5z7Xkuxw/s1600/vaadin-map-2013.png" height="400" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
These people has helped with the plugin and they deserve our thanks. These guys helped with improvements and keeping the plugin updated: <a href="https://github.com/antoniocaiazzo">Antonio Caiazzo</a>, <a href="https://github.com/Okram1">Okram1</a>, <a href="https://github.com/christoph-frick">Christoph Frick</a> and <a href="https://github.com/ClemensSchneider">Clemens Schneider</a>. Plus other guys who asked question on <a href="http://stackoverflow.com/questions/tagged/grails+vaadin">stackoverflow</a>, the plugin was improved just because of questions.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Finally, a call for "action" :) </div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">If you are using the plugin, we would be happy if you let us know what you are building or what you would like to improve in the plugin? </span></div>
<div style="text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: justify;">
<br /></div>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-5279088911057762072013-10-28T14:03:00.001-07:002016-03-27T22:36:36.727-07:00How to configure JDBC river for ElasticSearch<div style="text-align: justify;">
<div style="text-align: center;">
<i>Updated for new version of ElasticSearch 1.0.0.</i></div>
<br />
<a href="https://github.com/jprante/elasticsearch-river-jdbc" target="_blank">JDBC river</a> makes possible to load data from e.g. MySql database to <a href="http://www.elasticsearch.org/" target="_blank">ElasticSearch</a> and provide data much faster. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Before we start, have a look at the set of <a href="https://github.com/jprante/elasticsearch-river-jdbc/wiki/JDBC-River-parameters" target="_blank">jdbc-river parameters</a>. Then you need to pick-up a <a href="https://github.com/jprante/elasticsearch-river-jdbc/wiki/Strategies" target="_blank">strategy</a> how to poll data from JDBC. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<script src="https://gist.github.com/ondrej-kvasnovsky/7204476.js"></script>
<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com6tag:blogger.com,1999:blog-5527497837602369509.post-83681975770090686952013-10-28T13:29:00.001-07:002016-03-27T22:37:28.140-07:00How to install ElasticSearch as a service on CentOSThe following steps were tested for ElasticSearch 0.90.5 on CentOS 6.4.<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/7154890.js"></script>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com1tag:blogger.com,1999:blog-5527497837602369509.post-15113171489950826082013-08-15T01:37:00.000-07:002013-10-28T14:07:52.494-07:00Grails and Logback: Provide default logback configuration for development environmentThe main motivation is to have a custom logger setup, which every developer can easily adjust. Also, we don't want to put logback config, which is meant for developers only, on the class path.<br />
<br />
We can place logback.xml into the root folder of our project and then pass it when running up the application<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">grails -Dlogback.configurationFile=logback.xml run-app</span></blockquote>
The biggest disadvantage is: it is annoying to always include additional properties in the command line and it also means you need to tell that to the new developers. Also, it is not following Grails principle "convention over configuration".<br />
<br />
We need to provide the default configuration for the development mode if logback.configurationFile property is not set.<br />
<br />
So we <a href="http://grails.org/doc/latest/guide/commandLine.html#events" target="_blank">hook after compilation event</a> as follows. Create or open scripts/_Events.groovy file in your project folder.<br />
<br />
Here is the content of _Events.groovy file.<br />
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/6239237.js"></script>
In this example logback-config-dev.xml is ment to be stored in the project root folder.Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-58429445697113890792013-07-30T07:18:00.000-07:002013-07-30T07:18:32.527-07:00Meteor: How to send email from client<br />
<ol>
<li>Make sure you have got <span style="font-family: Courier New, Courier, monospace;">email</span> package in <span style="font-family: Courier New, Courier, monospace;">projectfolder/.meteor/packages</span> file.
<script src="https://gist.github.com/ondrej-kvasnovsky/6113201.js?file=packages"></script>
<br /></li>
<li>Create server side code in order to send email (Email.send can be called only on server side). That code you can call from client later on.
<script src="https://gist.github.com/ondrej-kvasnovsky/6113201.js?file=server.js"></script>
<br /></li>
<li>Make a template that show a link that invokes client side JavaScript that sends the email.
<script src="https://gist.github.com/ondrej-kvasnovsky/6113201.js?file=welcomePage.html"></script>
<br /></li>
<li>Make the call from the client in order to send an email.
<script src="https://gist.github.com/ondrej-kvasnovsky/6113201.js?file=client.js"></script>
<br /></li>
<li><br /></li>
</ol>
<br />
<br />Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com1tag:blogger.com,1999:blog-5527497837602369509.post-53530364002925857612013-07-21T04:59:00.000-07:002016-03-27T22:37:33.928-07:00Meteor: How to login with Email, GitHub, Twitter, Google and Facebook account and add credentials to an existing user accountWhen an user has already an account in the Meteor application, we don't want to create another user in MongoDB when he tries to login with other OAuth service. Rather we connect the accounts and add a new login service to the existing user's services collection.<br />
<br />
This code doesn't work for Twitter, because Twitter does not return email in the user data. Therefore, there is no way how to to connect Twitter account by email. I propose to exclude Twitter from your application until it is solved by Meteor (<a href="http://docs.meteor.com/#meteor_loginwithexternalservice" target="_blank">requestPermissions</a>).<br />
<br />
Also Github can have an account without email. So when user tries to login with GitHub without email, a new account is created.<br />
<br />
Just create a new file <span style="font-family: Courier New, Courier, monospace;">oauth.js</span> in <span style="font-family: Courier New, Courier, monospace;">server</span> folder and copy paste the code below.<br />
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/6048353.js"></script>
Thanks to Gadi Cohen <a href="https://groups.google.com/forum/#!msg/meteor-talk/GedMfxVdohQ/3ed2ViwqJuMJ" target="_blank">post</a>.
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com4tag:blogger.com,1999:blog-5527497837602369509.post-26127804491016759732013-07-21T03:55:00.000-07:002013-07-21T03:56:20.742-07:00Meteor: Login with Github on HerokuIt is a bit tricky to setup Meteor application to login with external service on Heroku (if you want to use your own domain). You need to do the following:<br />
<br />
<ol>
<li>While creating an application on Github, you have to use the same pattern for URLs. If you choose to use www prefix, use it everywhere.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilU1oovRKgoCwpWPB4HCMXjgnyHYaQuDMDWRubuDYwpXW4T9CKdsZoKBIo45dJfJ2qs9kwEUoY4VSMDRisGtJ0Ra497UzkCdJmyynzHujQT92ihNjiliA1r5v1zIk-gJrGJ2HV5zTPr5Lm/s1600/Screen+Shot+2013-07-21+at+12.49.09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilU1oovRKgoCwpWPB4HCMXjgnyHYaQuDMDWRubuDYwpXW4T9CKdsZoKBIo45dJfJ2qs9kwEUoY4VSMDRisGtJ0Ra497UzkCdJmyynzHujQT92ihNjiliA1r5v1zIk-gJrGJ2HV5zTPr5Lm/s1600/Screen+Shot+2013-07-21+at+12.49.09.png" /></a></li>
<li>Then go to the console and set ROOT_URL (heroku config:add ROOT_URL=http://www.templhub.com). You need to have it EXACTLY the same as in GitHub application configuration.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPJffEAyQo4FWewQo9JnlI45YcSLipl1fq9TA2lbxikNhYYI-744KL72_OdARIqOFqplLiyFT0r_uxMi2aYbMoyHj4cAs5AuUCy8jd_6lTYysV00F6Ai6QGdARyfwjxEWebjhNgdI_83Kc/s1600/Screen+Shot+2013-07-21+at+12.48.12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPJffEAyQo4FWewQo9JnlI45YcSLipl1fq9TA2lbxikNhYYI-744KL72_OdARIqOFqplLiyFT0r_uxMi2aYbMoyHj4cAs5AuUCy8jd_6lTYysV00F6Ai6QGdARyfwjxEWebjhNgdI_83Kc/s1600/Screen+Shot+2013-07-21+at+12.48.12.png" /></a></li>
</ol>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-85001564964378238162013-06-03T13:32:00.001-07:002013-06-06T00:05:54.906-07:00Twitter buttons in MeteorThe following steps show how to add Twitter button into a <a href="http://meteor.com/" target="_blank">Meteor</a> application.<br />
<ol>
<li>Add the link which represents Twitter button into the template:</li>
<script src="https://gist.github.com/ondrej-kvasnovsky/5701094.js?file=welcomePage.html"></script>
<li>Place the JavaScript provided by Twitter to the .js file for the template:</li>
<script src="https://gist.github.com/ondrej-kvasnovsky/5701094.js?file=welcomePage.js"></script>
</ol>
<div>
I took this code from <a href="http://templhub.com/">http://templhub.com</a> application.</div>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-20301845457525117302013-06-03T13:21:00.000-07:002016-03-27T22:37:38.643-07:00Vaadin 7 and Grails: How to compile widget setI have promised to publish a tutorial showing how to compile the widget set inside Grails project with Vaadin 7. Here you are.<br />
<br />
<ol>
<li>Create a new widget set definition file <span style="font-family: Courier New, Courier, monospace;">AppWidgetSet.gwt.xml</span> in the <span style="font-family: Courier New, Courier, monospace;">grails-app/vaadin</span> directory.<br /><span style="font-family: Courier New, Courier, monospace;"><script src="https://gist.github.com/ondrej-kvasnovsky/5701008.js?file=AppWidgetSet.gwt.xml"></script></span></li>
<li>Open <span style="font-family: Courier New, Courier, monospace;">VaadinConfig.groovy</span> that is inside the <span style="font-family: Courier New, Courier, monospace;">grails-app/conf</span> folder and add there a note about the new widgetset file.<br /><span style="font-family: Courier New, Courier, monospace;">widgetset = "app.AppWidgetSet"</span></li>
<li>Create a folder <span style="font-family: Courier New, Courier, monospace;">libs-widgetset</span> (for example inside the project root folder) for libraries that are needed during the widget set compilation. Download all-in-one archive of Vaadin 7 from <a href="https://vaadin.com/download" target="_blank">https://vaadin.com/download</a> and move all the <span style="font-family: Courier New, Courier, monospace;">.jar</span> files from the archive into <span style="font-family: Courier New, Courier, monospace;">libs-widgetset</span> folder. Do not forgot to move also <span style="font-family: Courier New, Courier, monospace;">.jar</span> files from <span style="font-family: Courier New, Courier, monospace;">lib</span> folder from the archive.</li>
<li>Create <span style="font-family: Courier New, Courier, monospace;">build.xml</span> file with the following content.<br /><script src="https://gist.github.com/ondrej-kvasnovsky/5701008.js?file=build.xml"></script></li>
<li>Open the console inside the project root and run the <span style="font-family: Courier New, Courier, monospace;">ant</span> command. The widget set compilation will start. Before you run the ant command, remove all the content of <span style="font-family: Courier New, Courier, monospace;">vaadin-grails-addon/web-app/VAADIN</span> folder. </li>
</ol>
This is a short version of tutorial "Adding Vaadin Add-on into Grails project" taken from the <a href="http://www.packtpub.com/creating-rich-internet-applications-in-vaadin-7/book" target="_blank">Vaadin 7 Cookbook</a>.
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com2tag:blogger.com,1999:blog-5527497837602369509.post-15203308245049282632013-05-26T05:21:00.003-07:002016-03-27T22:37:47.001-07:00How to deploy Meteor on Heroku with external MongoDB<br />
<blockquote class="tr_bq">
<span style="color: red;">This blog post is obsolete, use instead: </span><a href="http://justmeteor.com/blog/deploy-to-production-on-heroku/">http://justmeteor.com/blog/deploy-to-production-on-heroku</a></blockquote>
<br />
The case is following, you have made a <a href="http://meteor.com/" target="_blank">Meteor</a> application and you want to deploy it on <a href="http://heroku.com/" target="_blank">heroku.com</a>. Also, you want to use external MongoDB database provided by <a href="http://mongolab.com/" target="_blank">mongolab.com</a>.<br />
<div>
<ol>
<li>Register at <a href="https://id.heroku.com/login" target="_blank">https://id.heroku.com/login</a> </li>
<li>Install Heroku Toolbelt from <a href="https://toolbelt.heroku.com/" target="_blank">https://toolbelt.heroku.com</a></li>
<li>Register at <a href="https://mongolab.com/signup" target="_blank">https://mongolab.com/signup</a> and create new MongoDB database (they give 500MB for free)</li>
<li>Open the root folder of you Meteor project in console (you need a Git repository in order to deploy applications to Heroku, just set up one or use the one provided by Heroku, it becomes accesible after you create new application)</li>
<li>Login to the Heroku from the command line: <span style="font-family: "courier new" , "courier" , monospace;">$ heroku login</span></li>
<li><span style="font-family: inherit;">Create new Heroku application: </span><br /><span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: white; color: #333333; font-size: 14px; line-height: 20px;">$ heroku create <appname> --stack cedar --buildpack </span></span><span style="color: #3b73af; font-family: "courier new" , "courier" , monospace;"><span style="font-size: 14px; line-height: 20px;">https://github.com/oortcloud/heroku-buildpack-meteorite</span></span></li>
<li><span style="font-family: inherit;">Setup other than default MongoDB for your Meteor application (you can get all the details for constructing the MONGO_URL from yours Mongolab account): </span><br /><span style="background-color: white; color: #333333; font-size: 14px; line-height: 20px;"><span style="font-family: "courier new" , "courier" , monospace;">$ heroku config:set MONGO_URL=mongodb://<username>:<password>@ds027308.mongolab.com:27308/<dbname></span></span></li>
<li><span style="font-family: inherit;">Set the root URL</span><br /><span style="background-color: white; color: #333333; font-size: 14px; line-height: 20px;"><span style="font-family: "courier new" , "courier" , monospace;">$ heroku config:set ROOT_URL=http://<appname>.herokuapp.com</span></span></li>
<li><span style="font-family: inherit;">Or this, in case you have got a domain</span><br /><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">heroku config:add ROOT_URL=<span style="background-color: white; color: #333333; font-size: 14px; line-height: 20px;">http://</span>yourdomain.com</span></li>
<li><span style="font-family: inherit;">Add the Heroku </span><a href="https://help.github.com/articles/adding-a-remote" style="font-family: inherit;" target="_blank">Git repository as another remote</a><span style="font-family: inherit;"> to your git repository and push the code to that remote. The application will be automatically deployed and becomes accesible on <appname>.herokuapp.com </span><br /><span style="background-color: white; color: #333333;"><span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: 14px; line-height: 20px;">$ git remote add heroku git@heroku.com:<appname>.git</span><br /><span style="font-size: 14px; line-height: 20px;">$ git push heroku master</span></span></span></li>
</ol>
</div>
<div>
When you make changes to your code, just run <span style="font-family: "courier new" , "courier" , monospace;">git push heroku master</span> again and all the commit from your <span style="font-family: "courier new" , "courier" , monospace;">origin/master</span> will be released.<br />
<br />
In case you want to see the response times for this setup, you can try it out on <a href="http://failtracker.com/" target="_blank">http://failtracker.com</a> or <a href="http://templhub.com/" target="_blank">http://templhub.com</a> </div>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com19tag:blogger.com,1999:blog-5527497837602369509.post-40585799341143487752013-05-21T10:40:00.000-07:002016-03-27T22:37:51.898-07:00Meteor with Google AnalyticsTrying to get Google Analytics working with Meteor framework is so much fun. It took me quite some after I got this wonderful view:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2JhVfCgCc2Irqqx_bOYvFYqDO6EO7JwDgtqFe0x9vdFRtbGdj6h7tmBI1E_UA-FrwX-i3OhpztA3sslEW_Z0qUywzxzUxhL5amvOcy7uuX_8z1FSlUcOxRdrKsTQD77S818-TctVy6Hdf/s1600/ga_meteor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="277" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2JhVfCgCc2Irqqx_bOYvFYqDO6EO7JwDgtqFe0x9vdFRtbGdj6h7tmBI1E_UA-FrwX-i3OhpztA3sslEW_Z0qUywzxzUxhL5amvOcy7uuX_8z1FSlUcOxRdrKsTQD77S818-TctVy6Hdf/s400/ga_meteor.png" width="400" /></a></div>
<br />
How to get there: that is the question which is answered in the following <a href="https://gist.github.com/ondrej-kvasnovsky/5621607">gist</a>.<br />
<br />
Create new template, so we can hook to <span style="font-family: Courier New, Courier, monospace;">Template.googleAnalytics.rendered</span> function. So, when <span style="font-family: Courier New, Courier, monospace;">googleAnalytics</span> template is rendered, we can call Google Analytics service.
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/5621607.js?file=googleAnalytics.html"></script>
Insert the template into the HTML page that should be reported to Google Analytics.
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/5621607.js?file=index.html"></script>
Implement the call to Google Analytics service as follows (just replace <span style="font-family: Courier New, Courier, monospace;">'UA-111111-1'</span> with your token).
<br />
<script src="https://gist.github.com/ondrej-kvasnovsky/5621607.js?file=googleAnalytics.js"></script>
Thanks to these <a href="https://github.com/possibilities/meteor-ga">two</a> <a href="http://hackerpreneurialism.com/post/38115369392/google-analytics-with-meteor-js">sources</a>.
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-31168924707639457342013-05-09T13:33:00.001-07:002013-06-06T00:07:50.957-07:00Vaadin 7 CookbookFew things I would like to share about <a href="http://www.amazon.com/dp/1849518807/?tag=packtpubli-20">Vaadin 7 Cookbook</a>.<br />
<blockquote class="tr_bq">
We started writing the book since Vaadin 7 alfa versions - which was hard because we needed to made a lot of changes before releasing the book. But, it gave us a lot of knowledge about Vaadin 7 and we could put it into that book. And that makes the book amazing for those who are starting with Vaadin 7. </blockquote>
<blockquote class="tr_bq">
One of the first feedback, was <i>"If I would be a beginner with Vaadin, this is the kind of book I’d like to study - a lot of examples that do a single thing, and everything regarding to that one thing is well explained. ... that’s how I learn new things, not by reading theoretical ramblings regarding things and stuff."</i> - <a href="https://vaadin.com/blog/-/blogs/new-book-vaadin-7-cookbook?_33_redirect=https%3A%2F%2Fvaadin.com%2Fblog%3Fp_p_id%3D33%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_pos%3D1%26p_p_col_count%3D2">vaadin blog</a> </blockquote>
<blockquote class="tr_bq">
Luckily, I could participate a project where we used Vaadin 7 with Grails, which was amazing experience. Many notes are included in the book. </blockquote>
<blockquote class="tr_bq">
Jaroslav Holan accepted my offer to be co-author, thanks to him the book is more rich for recipes that I would hardly include. Thank you for that, <a href="https://twitter.com/JaroslavHolan">Jaroslav</a>. </blockquote>
<i>Looking forward to hear you reflections. </i>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-84695569435045411872012-12-27T14:27:00.003-08:002016-03-27T22:37:59.831-07:00Lazy loaded table in Vaadin 7<div style="text-align: justify;">
There are few options how to make lazy loaded table. When I say lazy loaded table then I mean a table that fetches data lazily from database.</div>
<ol><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_B6SjnCNs-FPEh3LYFaFKN6ry7lSZavE5NSsnqmuaLXA6VEugkONVMfHfRq_-MKIllDI6ZJu6LbaQDzj-i9zDNynkZHjTo-vTyF4xJ6xaHw8A6ZQ-UagnJBeVQooeQO3CaZuuiQGUBlZ-/s1600/Screen+Shot+2012-12-27+at+11.38.34.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a>
<li>Use <b>standard Vaadin table</b> with scroll bar. <br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_B6SjnCNs-FPEh3LYFaFKN6ry7lSZavE5NSsnqmuaLXA6VEugkONVMfHfRq_-MKIllDI6ZJu6LbaQDzj-i9zDNynkZHjTo-vTyF4xJ6xaHw8A6ZQ-UagnJBeVQooeQO3CaZuuiQGUBlZ-/s1600/Screen+Shot+2012-12-27+at+11.38.34.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="103" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_B6SjnCNs-FPEh3LYFaFKN6ry7lSZavE5NSsnqmuaLXA6VEugkONVMfHfRq_-MKIllDI6ZJu6LbaQDzj-i9zDNynkZHjTo-vTyF4xJ6xaHw8A6ZQ-UagnJBeVQooeQO3CaZuuiQGUBlZ-/s400/Screen+Shot+2012-12-27+at+11.38.34.png" width="400" /></a><br /><br /><div style="text-align: justify;">
Client (running in browser) loads items lazily from server (and that is awesome). But there is unfortunately no "lazy container" in Vaadin core and therefore we need to use an add-on. We can use <a href="https://vaadin.com/add-ons/jpacontainer">JPAContainer</a> for $299 USD "only". Or <a href="https://vaadin.com/directory#addon/lazy-query-container">LazyQueryContainer</a> for free. I tried LazyQueryContainer and worked well but I noticed that design of that add-on is a bit heavy. Therefore I have decided to build a new <a href="https://github.com/ondrej-kvasnovsky/lazy-container">LazyContainer</a>.</div>
<br /><div style="text-align: justify;">
Vaadin scrollable table needs to call COUNT of the selected items from a database table when rendering table and also when scrolling. There are also <a href="http://dev.vaadin.com/ticket/10473">not efficient calls</a> of <a href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.beta11/docs/api/com/vaadin/data/Container.Indexed.html#getItemIds(int, int)">getItemIds</a> method from container in standard Vaadin table. It is easy to explain. When we scroll in the table then client requests data from the server. Server calls the container method getItemIds(startIndex, numberOfIds) where startIndex and numberOfIds have usually this kind of values. </div>
<br /><span style="font-family: Courier New, Courier, monospace;">startIndex: 0, numberOfIds: 15 <br />startIndex: 0, numberOfIds: 55<br />startIndex: 10, numberOfIds: 72<br />startIndex: 33, numberOfIds: 98</span><br />...<br /><br /><div style="text-align: justify;">
Then we make SQL or some other kind of query to database that looks like this <i>select * from orders limit 0 offset 15; </i><br />
It is nice that the data is lazy loaded and therefore we don't fetch N thousands of items from database but it is wasting resources on the server. I tried to play with cache rates but I couldn't tune it to this kind of result. </div>
<br /><span style="font-family: Courier New, Courier, monospace;">startIndex: 0, numberOfIds: 50<br />startIndex: 50, numberOfIds: 50<br />startIndex: 100, numberOfIds: 50<br />startIndex: 150, numberOfIds: 50</span></li>
<li><div style="text-align: justify;">
We need to use <a href="https://vaadin.com/directory#addon/pagedtable">PagedTable</a> add on in order to get that kind of strict fetching data from database. But there are few problems with PagedTable. First it doesn't have good architecture and it not easy to use when we need to do localization or customization of navigation items plus there are some defects. I have fixed some of the defects, converted it to Maven project and made customization of the navigation components easier. It is accesible from <a href="https://github.com/ondrej-kvasnovsky/PagedTable">forked PagedTable</a>. </div>
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_BU5S6gczmge7_H3H_rrdtrXRGhX_xcYRPwPhColg3uFHD8Jquc3GLRoo0kry01oy6CD9DCz5NRDrPtY_H3zTcXmN6grZBtzPWVXuG-vvelYw2AuquUoOOT_ZSgCnUUHSLu7jNAtkpMhL/s1600/687474703a2f2f71696969702e6f72672f6769746875622f50616765645461626c652f70616765647461626c652d6578616d706c652e706e67.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_BU5S6gczmge7_H3H_rrdtrXRGhX_xcYRPwPhColg3uFHD8Jquc3GLRoo0kry01oy6CD9DCz5NRDrPtY_H3zTcXmN6grZBtzPWVXuG-vvelYw2AuquUoOOT_ZSgCnUUHSLu7jNAtkpMhL/s320/687474703a2f2f71696969702e6f72672f6769746875622f50616765645461626c652f70616765647461626c652d6578616d706c652e706e67.png" width="320" /></a><br /><br /><div style="text-align: justify;">
When we use <a href="https://github.com/ondrej-kvasnovsky/PagedTable">PagedTable</a> together with <a href="https://github.com/ondrej-kvasnovsky/lazy-container">LazyContainer</a> then we get quite efficient lazy loaded table. How the code of that kind of table could look like? </div>
<br />Here is the example <a href="https://github.com/ondrej-kvasnovsky/lazy-loaded-paged-table">https://github.com/ondrej-kvasnovsky/lazy-loaded-paged-table</a></li>
</ol>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com2tag:blogger.com,1999:blog-5527497837602369509.post-14128293993665216252012-11-21T02:14:00.002-08:002016-03-27T22:38:05.262-07:00Hello world in Grails and Vaadin<div>
Download and install <a href="http://www.springsource.org/sts">Eclipse STS</a> and install the extensions. </div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2sN-7Ch_gUWO8_QhGx7DmyJQIZkC635ENANeiIK63bdru1SWALSDr_dnN5Ee6CdPHS1N2epias2fvdfThWq-No3ZMVrOYvJTx6V3QZOwNVwStXRXqseXMwMlnwZnJw2Or63BKHuJt5Gi9/s1600/vaadin-grails-part-1-eclipse-plugins.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2sN-7Ch_gUWO8_QhGx7DmyJQIZkC635ENANeiIK63bdru1SWALSDr_dnN5Ee6CdPHS1N2epias2fvdfThWq-No3ZMVrOYvJTx6V3QZOwNVwStXRXqseXMwMlnwZnJw2Or63BKHuJt5Gi9/s320/vaadin-grails-part-1-eclipse-plugins.PNG" width="320" /></a></div>
<div>
<br /></div>
<ol>
<li>Create new Grails project<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrt6eLXKvT7-yLPnIbTvQivoDlIyLn9COaMxuMMNsi7kvrQcgA_XTMzGNtqeLx7GXbEiNyjzXwp2MkDnWXIC2CgCQPik6ieXN2nKXvbg4UUhsMY-gyCZtRBIkdHMQdaNK3l2MmfVK-Wdyr/s1600/Screen+Shot+2012-11-21+at+10.14.44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrt6eLXKvT7-yLPnIbTvQivoDlIyLn9COaMxuMMNsi7kvrQcgA_XTMzGNtqeLx7GXbEiNyjzXwp2MkDnWXIC2CgCQPik6ieXN2nKXvbg4UUhsMY-gyCZtRBIkdHMQdaNK3l2MmfVK-Wdyr/s320/Screen+Shot+2012-11-21+at+10.14.44.png" width="320" /></a>
</li>
<li>Fill in the name of the new project<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxCL9P_XmqRlWZkQdePd7oPQjl1jwf-9vsmb3PuCUGnVvb37NnP-t5ZTWIPMUbxC8XoC1_6qQMbq-6qkCqQwDYvvGEG5RBkoQSKzeJBgAaTXRnLqvtBXj2meZRnv1KG-RmsfXxS_ppnONF/s1600/Screen+Shot+2012-11-21+at+10.15.20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxCL9P_XmqRlWZkQdePd7oPQjl1jwf-9vsmb3PuCUGnVvb37NnP-t5ZTWIPMUbxC8XoC1_6qQMbq-6qkCqQwDYvvGEG5RBkoQSKzeJBgAaTXRnLqvtBXj2meZRnv1KG-RmsfXxS_ppnONF/s320/Screen+Shot+2012-11-21+at+10.15.20.png" width="275" /></a></li>
<li>Try to run the application. The plain Grails application (without Vaadin) should start straight away without any additional configuration.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjayWJ6biYO5D2YHtU3ma7sjl60jlxh10Tp5Lr0AnfITbdl01PfKj2bF4dMKJpKFcjvVvGGFlVfcPC-5ORyYwjWEbB_0y1AleAiwPk6B9UhYMGD_xNSQJ1to3O1bBDcNrN4IcP-isWC_YlP/s1600/Screen+Shot+2012-11-21+at+10.16.12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="118" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjayWJ6biYO5D2YHtU3ma7sjl60jlxh10Tp5Lr0AnfITbdl01PfKj2bF4dMKJpKFcjvVvGGFlVfcPC-5ORyYwjWEbB_0y1AleAiwPk6B9UhYMGD_xNSQJ1to3O1bBDcNrN4IcP-isWC_YlP/s320/Screen+Shot+2012-11-21+at+10.16.12.png" width="320" /></a></li>
<li>This is how the started application should look like. <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzLz_Vb5b_Be3mQ95RX_NlU0S8QA5sV0NFM0WDRXHfY2nfCNZ77xEE6l5SXMJKafmy2jncqpmqGuz8uOVh9r0BTwTT-awhSaYiwfPvIZY_uTyrf8TT4LpDJ6rcJVkF_PSukke5BkqYlqyN/s1600/Screen+Shot+2012-11-21+at+10.18.42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzLz_Vb5b_Be3mQ95RX_NlU0S8QA5sV0NFM0WDRXHfY2nfCNZ77xEE6l5SXMJKafmy2jncqpmqGuz8uOVh9r0BTwTT-awhSaYiwfPvIZY_uTyrf8TT4LpDJ6rcJVkF_PSukke5BkqYlqyN/s320/Screen+Shot+2012-11-21+at+10.18.42.png" width="320" /></a></li>
<li>Install Vaadin plugin. This command will install the latest version of the plugin.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhljPCua6a9yOUu6tTjFObp_qd8eGoQROKYFIYRWWRxmyGI8hbC0p7AUdM3XrUj88GtD-dwDFs7IZmyST6R6jggXO5YdlYdt14-btiZ1-0KPJjjY1BLdBFMCLOV_Nf9n7fR8FKie7aXrAc4/s1600/Screen+Shot+2012-11-21+at+10.19.28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="111" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhljPCua6a9yOUu6tTjFObp_qd8eGoQROKYFIYRWWRxmyGI8hbC0p7AUdM3XrUj88GtD-dwDFs7IZmyST6R6jggXO5YdlYdt14-btiZ1-0KPJjjY1BLdBFMCLOV_Nf9n7fR8FKie7aXrAc4/s320/Screen+Shot+2012-11-21+at+10.19.28.png" width="320" /></a></li>
<li>Try to run the application (on this screen I have added option where I run the application on different port... it might be handy for you).<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbNCh8IGwVoh8gpNCO5s7-HWKe5Q_Kbmi2Yrh20iTPl3OZgjsalJ75AMSpCVUx4rZIQh342ie1-KdI0NcJlLBxDgZPv4sLvNEoa1Kc7EYFEM1rGRKuwtVe3q03iWYSyf7bA0Y05jE5D04r/s1600/Screen+Shot+2012-11-21+at+10.19.50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="48" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbNCh8IGwVoh8gpNCO5s7-HWKe5Q_Kbmi2Yrh20iTPl3OZgjsalJ75AMSpCVUx4rZIQh342ie1-KdI0NcJlLBxDgZPv4sLvNEoa1Kc7EYFEM1rGRKuwtVe3q03iWYSyf7bA0Y05jE5D04r/s320/Screen+Shot+2012-11-21+at+10.19.50.png" width="320" /></a></li>
<li>Add Vaadin folder into the source folder list.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOBe4hok_gDdR3JESoZjuRTs9elfWSrUXakCUCkHag2RUJtm4UAsYmJHtOUVZADor-VnalFY9IS2TxLroJWN4DiLYUoPiP3mEmeMcHxp9L_zaRH-psREogEK6y7Hs6lUYnXLwRTqy4S9ow/s1600/Screen+Shot+2012-11-21+at+10.22.45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="43" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOBe4hok_gDdR3JESoZjuRTs9elfWSrUXakCUCkHag2RUJtm4UAsYmJHtOUVZADor-VnalFY9IS2TxLroJWN4DiLYUoPiP3mEmeMcHxp9L_zaRH-psREogEK6y7Hs6lUYnXLwRTqy4S9ow/s320/Screen+Shot+2012-11-21+at+10.22.45.png" width="320" /></a></li>
<li>Try to run the application again. You will see the Vaadin hello world.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9lQT66oJhfiW3EzVQASuhfyVaRWsiw_p7Gp7_LK5CQnt-5vfBg-tA87SgnfphOW9QoNjRRH3YSR4C7gyT5pk65uqYifyYpGx5VL2S0uUCjAT33orz0ZaGI65CIntMiUgzJXNzcjK1oZFU/s1600/Screen+Shot+2012-11-21+at+10.24.19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="229" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9lQT66oJhfiW3EzVQASuhfyVaRWsiw_p7Gp7_LK5CQnt-5vfBg-tA87SgnfphOW9QoNjRRH3YSR4C7gyT5pk65uqYifyYpGx5VL2S0uUCjAT33orz0ZaGI65CIntMiUgzJXNzcjK1oZFU/s320/Screen+Shot+2012-11-21+at+10.24.19.png" width="320" /></a></li>
<li>We are done. </li>
</ol>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0tag:blogger.com,1999:blog-5527497837602369509.post-13867752667531528882012-10-03T10:39:00.002-07:002016-03-27T22:38:12.774-07:00Grails and Vaadin 7 beta - first version of the plugin<div style="text-align: justify;">
It is finally out. The first working version of Grails plugin for Vaadin 7.<br />
<br />
<a href="https://vaadin.com/roadmap">Vaadin 7</a> differers from Vaadin 6 a lot and therefore there is no backward compatibility beween the plugins for 6th and 7th version. Actually, the plugin for Vaadin 7 is made almost from scratch. Many things have been simplified and plugin is just handling the connection between Grails and Vaadin. For example dynamic methods getBean and i18n are not injected anymore. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
One thing I have noticed after playing with Grails 2.2.0 and Vaadin 7 - it is fast (actually in two ways). First, I have made localized application with access to database via ORM (Hibernate) and Spring (Services), displaying list of users in a good looking table in just 5 minutes (sometimes, in other frameworks, I don't even setup the project in that short time). Second, it is really responsive user interface. I think the guys in Vaadin did amazing job with the 7th version. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Let's have a look how to install the latest version and try it out. Setup <a href="http://grails.org/doc/latest/ref/Command%20Line/Usage.html">Grails console</a> before you start or you can just make it in your favorite IDE. </div>
<ol>
<li>Create new project and run it.<br /><span style="font-family: Courier New, Courier, monospace;">grails create-app bookstore<br />cd bookstrore<br />grails run-app</span></li>
<li><div style="text-align: justify;">
You can stop the application now. It was just to verify that you have successfully created the project. <a href="https://github.com/downloads/ondrej-kvasnovsky/grails-vaadin-plugin/grails-vaadin-1.7.0-beta2.zip">Download</a> and install the plugin</div>
<span style="font-family: 'Courier New', Courier, monospace;">grails install-plugin /path/to/plugin/</span><span style="font-family: Courier New, Courier, monospace;">grails-vaadin-1.7.0-beta2.zip</span></li>
<li>And run the application<br /><span style="font-family: 'Courier New', Courier, monospace;">grails run-app</span></li>
</ol>
<div style="text-align: justify;">
<span style="font-family: inherit;">Quite simple, right? You might be wondering... what about access to database or localization. There is a new class Grails and that one is meant to be used when you need to get the access to the services or i18n. </span><span style="font-family: inherit;">Few examples follows.<br /><br />Let's create a service class in Grails. It just returns all the users from the database.</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">class UserService {</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"> List<User> listUsers() {</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"> return User.list()</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"> }</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
<div style="text-align: justify;">
Now get the service and call the method.</div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">List<User> users = Grails.get(UserService).listUsers()</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">Or just create new Label and pass there localized string. </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">String text = Grails.i18n("key.to.localization.from.i18n")</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">Label label = new Label(text)</span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;">If you find an issue, please report it in <a href="http://jira.grails.org/browse/GPVAADIN">Jira</a></span> or preferably in <a href="https://github.com/ondrej-kvasnovsky/grails-vaadin-plugin/issues">Github</a>. </div>
<style type="text/css">
* {
/*padding: 0;*/
/*margin: 0;*/
/*box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*-webkit-box-sizing: border-box;*/
/*-webkit-transition: all 0s ease-in-out;*/
/*-moz-transition: all 0s ease-in-out;*/
/*-o-transition: all 0s ease-in-out;*/
/*transition: all 0s ease-in-out;*/
font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
.content-box {
margin: 10px auto 10px auto;
width: 60%;
height: 200px;
max-width: 80%;
position: relative;
background: #f2f3ed;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.logo-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 200%;
color: #4f4f4f;
}
.content-container {
margin: 10px auto 10px auto;
margin-left: 10px;
font-size: 120%;
color: #2e2e2e;
}
.action-container {
margin: 10px auto 10px auto;
/*margin-top: 15px;*/
text-align: center;
/*margin-bottom: 10px;*/
}
.logo-note {
font-size: 80%;
color: #4f4f4f;
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
}
</style>
<div class="content-box">
<div class="logo-container">
TextLab <span class="logo-note">for Mac</span>
</div>
<div class="content-container">
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.
<div class="action-container">
<a href="https://itunes.apple.com/us/app/textlab/id1024903185?ls=1&mt=12">
<img src="http://textlab-app.com/assets/img/app-store.svg" alt="Buy TextLab"/>
</a>
</div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com5tag:blogger.com,1999:blog-5527497837602369509.post-10414042563948763422012-10-03T09:32:00.002-07:002013-06-06T00:09:15.461-07:00Grails and Vaadin 6 - few changes in the plugin<div style="text-align: justify;">
There are few changes in <a href="https://github.com/ondrej-kvasnovsky/grails-vaadin-plugin" target="_blank">the plugin</a>. You can find the changed <a href="http://grails.org/plugin/vaadin" target="_blank">Vaadin plugin</a> under this version number <a href="https://github.com/ondrej-kvasnovsky/grails-vaadin-plugin/downloads">1.5.5</a>. </div>
<ul><b>
<li><b>No configuration needed after the plugin installation. </b></li>
</b></ul>
<b>
</b>
<blockquote class="tr_bq">
<span style="text-align: justify;">Previously we had to add a new class that extends Vaadin application, add a reference to VaadinConfig about that class and finally remove content of UrlMapping. This all is automated now. We just create Grails project install the Vaadin plugin and run the application.</span></blockquote>
<ul><b>
<li><b>Versions updated.</b></li>
</b></ul>
<b>
</b>
<br />
<blockquote class="tr_bq">
<span style="font-family: inherit;">Grails updated to 2.2.0 and Vaadin to 6.8.4. </span></blockquote>
<b>Follow these steps in case you want to try it out. </b><br />
<ol>
<li>First set <a href="http://grails.org/doc/latest/ref/Command%20Line/Usage.html">Grails console</a></li>
<li>Create new Grails project and try to run it (so we can verify successful creation of the project + dependencies are downloaded).<br /><span style="font-family: Courier New, Courier, monospace;">grails create-app bookstore<br />cd bookstrore<br />grails run-app</span></li>
<li><a href="https://github.com/downloads/ondrej-kvasnovsky/grails-vaadin-plugin/grails-vaadin-1.5.5.zip">Download</a> and install the plugin<br /><span style="font-family: Courier New, Courier, monospace;">grails install-plugin /path/to/plugin/</span><span style="font-family: 'Courier New', Courier, monospace;">grails-vaadin-1.5.5.zip</span></li>
<li>Run the application<br /><span style="font-family: Courier New, Courier, monospace;">grails run-app</span></li>
</ol>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com7tag:blogger.com,1999:blog-5527497837602369509.post-62400579084924755822012-07-27T13:20:00.000-07:002013-12-05T04:58:04.054-08:00Trying to update Grails Vaadin plugin to Vaadin 7<div style="text-align: justify;">
<span style="background-color: white;">I am quite in a shock. I have tried to update grails-vaadin plugin so I could use the new version of Vaadin 7.0.0alfa3 together with Grails 2.1.0. But what a surprise... alfa3 contains a bit more classes than previous version and it makes it imposible to integrate Vaadin 7.0.0 alfa3 with Grails 2.1.0. </span></div>
<div style="text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: white;">Have a look how size of Vaadin jars increased...</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeFeglfJ2KL7pqIeIsLaiSddO56zIeFNKWOmEJfQbxmG2X16PfVDLYAN38gWjZP06ZWFn9rLtOOY79W1ITa3g8oNoRc4zRhX_0wtaDXpJllpa5J4isQ5Cj11uE4VkqN5Qe9OuiWbbghRTk/s1600/Screen+Shot+2012-07-27+at+22.01.54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="91" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeFeglfJ2KL7pqIeIsLaiSddO56zIeFNKWOmEJfQbxmG2X16PfVDLYAN38gWjZP06ZWFn9rLtOOY79W1ITa3g8oNoRc4zRhX_0wtaDXpJllpa5J4isQ5Cj11uE4VkqN5Qe9OuiWbbghRTk/s320/Screen+Shot+2012-07-27+at+22.01.54.png" width="320" /></a></div>
<div style="text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: white;">What does it mean. When I try to add </span><span style="background-color: white;">com.vaadin:vaadin:7.0.0.alpha3 </span><span style="background-color: white;">as dependency then Grails fails to load with the following error: </span></div>
<div style="text-align: justify;">
<span style="background-color: white;"></span></div>
<div style="text-align: left;">
<span style="background-color: white; font-family: 'Courier New', Courier, monospace;">Error Interactive mode exited with error: loader constraint violation: when resolving method "javax.xml.parsers.SAXParser.getXMLReader()Lorg/xml/sax/XMLReader;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, groovy/util/XmlSlurper, and the class loader (instance of <bootloader>) for resolved class, javax/xml/parsers/SAXParser, have different Class objects for the type org/xml/sax/XMLReader used in the signature.</span></div>
<div style="text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: white;">I have already complained about it </span><span style="background-color: white;"><a href="http://dev.vaadin.com/ticket/9180">http://dev.vaadin.com/ticket/9180</a>. Let's see what happens with the next releases. I still hope it is a kind of a bug or bad joke that there are so many libraries included in the package. </span></div>
<div style="text-align: justify;">
<span style="background-color: white;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: white;">Here you can find working version of Vaadin 7 (alfa2) for Grails (it is still experimental version, but it worked for few people already): </span><span style="background-color: white;"><a href="https://github.com/ondrej-kvasnovsky/grails-vaadin-plugin/downloads">https://github.com/ondrej-kvasnovsky/grails-vaadin-plugin/downloads</a>.</span></div>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com1tag:blogger.com,1999:blog-5527497837602369509.post-3006515830262104072012-07-24T07:36:00.006-07:002013-06-06T00:10:58.888-07:00Hints for Grails app running on Cloudbees<div style="text-align: justify;">
Here are my most used commands I use during development and deployment of <a href="http://grails.org/" target="_blank">Grails</a> application which is running on <a href="http://www.cloudbees.com/" target="_blank">Cloudbees</a>.<br />
<br /></div>
<h4>
Dependencies when changing BuildConfig </h4>
<ol>
<li><div style="text-align: justify;">
<span style="background-color: white;">It happens quite usually - you add a new dependency to BuildConfig and it is not visible in your code. This helps to load it. I am also using </span><span style="background-color: white;">--include-source option to get jars (because I might be wondering what code is behind).</span></div>
<span style="font-family: 'Courier New', Courier, monospace;">grails <a href="http://grails.org/doc/latest/ref/Command%20Line/refresh-dependencies.html" target="_blank">refresh-dependencies</a> --include-source</span></li>
</ol>
<h4>
Testing during development</h4>
<ol>
<li><div style="text-align: justify;">
<span style="background-color: white;">I am not using integration tests. The are two reasons why. First, it is possible to mock everything. Second, integration tests requires context and it is time consuming when starting it up. </span></div>
<span style="font-family: 'Courier New', Courier, monospace;">dev <a href="http://grails.org/doc/latest/ref/Command%20Line/test-app.html" target="_blank">test-app</a> unit:</span></li>
<li>I usually run only one specific unit test when developing a feature.<br /><span style="font-family: 'Courier New', Courier, monospace;">dev <a href="http://grails.org/doc/latest/ref/Command%20Line/test-app.html" target="_blank">test-app</a> unit: UserServiceTests</span></li>
<li><div style="text-align: justify;">
<span style="background-color: white;">From time to time I need to have more applications running at the same time (e.g. when doing an integration between client application, admin application and some web services). </span></div>
<span style="font-family: 'Courier New', Courier, monospace;">dev <a href="http://grails.org/doc/latest/ref/Command%20Line/run-app.html" target="_blank">run-app</a> -Dserver.port=8080</span></li>
</ol>
<h4>
Validation before deploying war into the production</h4>
<ol>
<li><div style="text-align: justify;">
<span style="background-color: white;">At first, run all the tests. E.g. my web services written in Grails have 95% line coverage, applications about 80%. So I am quite confident when deploying it to production. </span></div>
<a href="http://grails.org/doc/latest/ref/Command%20Line/test-app.html" style="font-family: 'Courier New', Courier, monospace;" target="_blank">test-app</a></li>
<li><div style="text-align: justify;">
<span style="background-color: white;">Simulate running the war on local machine. Running application by run-war might uncover some issues which could occur during deployment of war on cloud. It can happen that </span><span style="background-color: white;">application</span><span style="background-color: white;"> is running well when it is started by run-app but it fails during deployment (which causes your production app is not available). </span></div>
<span style="font-family: 'Courier New', Courier, monospace;"><a href="http://grails.org/doc/latest/ref/Command%20Line/run-war.html" target="_blank">run-war</a></span></li>
<li><div style="text-align: justify;">
<span style="background-color: white;">After the steps above are without problems then I make a production war file.</span></div>
<span style="font-family: 'Courier New', Courier, monospace;">prod <a href="http://grails.org/doc/latest/ref/Command%20Line/war.html" target="_blank">war</a></span></li>
<li><div style="text-align: justify;">
<span style="background-color: white;">It is </span><span style="background-color: white;">necessary</span><span style="background-color: white;"> to </span><a href="http://wiki.cloudbees.com/bin/view/RUN/BeesSDK" style="background-color: white;" target="_blank">install CloudBees SDK</a> so the <span style="background-color: white;">applications can be deployed from command line. </span></div>
<span style="font-family: 'Courier New', Courier, monospace;">bees app:deploy myapp.war -a myaccount/myapplication</span></li>
<li><span style="font-family: inherit;">This is how to restart application from command line... it is quite handy. </span><span style="font-family: 'Courier New', Courier, monospace;">bees app:restart </span><span style="font-family: 'Courier New', Courier, monospace;">myaccount/myapplication</span></li>
</ol>
Anonymoushttp://www.blogger.com/profile/00751854008976756290noreply@blogger.com0