Sorry

This feed does not validate.

In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://dpastov.blogspot.com/feeds/posts/default?alt=rss

  1. <?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-34728599</atom:id><lastBuildDate>Sun, 22 Jan 2017 03:47:43 +0000</lastBuildDate><category>lotus script</category><category>lotus approach</category><category>lotus features</category><category>lotus notes</category><category>Java</category><category>Domino</category><category>lotus news</category><category>me</category><category>web</category><category>javascript</category><category>lotus issues</category><category>lotus and java</category><category>Development</category><category>lotus formula</category><category>lotus integration</category><category>DSAPI</category><category>Google</category><category>Play Framework</category><category>notes api</category><category>lotus community</category><category>xPages</category><category>GitHub</category><category>SEO</category><category>PDF</category><category>Velocity</category><category>lotus fun</category><category>lotus perfomance</category><category>Certificate</category><category>XML-XSL</category><category>locale</category><category>Drupal</category><category>Jenkins</category><category>LS2J</category><category>Node.js</category><category>XFDF</category><category>Algorithms</category><category>Analytics</category><category>CSS</category><category>DDE</category><category>FDF</category><category>Jira</category><category>Mongodb</category><category>RSS</category><category>SOAP</category><category>Scala</category><category>Typesafe</category><category>XPath</category><category>XSS</category><category>htmlminifier</category><category>iText</category><category>notes.ini</category><category>sqwish</category><category>uglifyjs</category><category>views</category><title>Find the best way</title><description>I write about Java, Scala, Play Framework, IBM Notes Domino, JavaScript, HTML, CSS</description><link>http://dpastov.blogspot.com/</link><managingEditor>[email protected] (Dmytro Pastovenskyi)</managingEditor><generator>Blogger</generator><openSearch:totalResults>256</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-1670596980056503904</guid><pubDate>Thu, 12 Jan 2017 12:08:00 +0000</pubDate><atom:updated>2017-01-12T13:08:49.000+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><title>Kill Play Framework process</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;When we run application in DEV mode (using command activator run) the process normally will be killed when terminal is closed. It&#39;s pretty easy since PID is started/closed automatically and therefore we do not care about it at all.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Once we start application in PROD mode there is a file RUNNING_PID is created (./target/universal/stage/RUNNING_PID). There is a command (since version 2.4) in activator (stopProd) which will close PID&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ activator stopProd&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Alternatively you can just kill process &#39;manually&#39;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ kill $(cat target/universal/stage/RUNNING_PID)&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2017/01/kill-play-framework-process.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-802839450719715223</guid><pubDate>Thu, 12 Jan 2017 09:31:00 +0000</pubDate><atom:updated>2017-01-12T15:18:18.096+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><title>Play Framework project in production - Building process</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;We want to deploy our Play project to production environment.&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Create a binary version of application&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There are two commands that can help you to make a build. Simply run &lt;b&gt;dist&lt;/b&gt; (it invokes universal:packageBin) or &lt;b&gt;universal:packageZipTarball&lt;/b&gt; in Play console and wait&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ dist&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ universal:packageZipTarball&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Result will be a ZIP or TGZ file located in target/universal folder with everything needed for you project (it means you do not need to install SBT or Activator on your server, just pure Java). Once you extract ZIP you will find 2 runner files in bin folder (one for unix and one for windows). Just run it and your server will up&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ path/to/hellow-world/bin/hello-world-app &lt;br /&gt;[info] play.api.Play - Application started (Prod)&lt;br /&gt;[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Make sure you have rights to run server, sometimes you need to give rights (see example below)&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ chmod +x /path/to/bin/project-name&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;To run process in background&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;$ sudo nohup target/universal/stage/bin/eqa-app -Dhttp.port=80 -Dplay.crypto.secret=&quot;secret_token_123&quot; &lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2017/01/play-project-production-building-process.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-6201891631946620722</guid><pubDate>Thu, 12 Jan 2017 07:00:00 +0000</pubDate><atom:updated>2017-01-12T10:32:58.600+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><title>Play Framework project in production - Application Secret</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;I am going to make series of articles about how to deploy &lt;a href=&quot;https://www.playframework.com/&quot;&gt;Play Framework&lt;/a&gt;&amp;nbsp;(version 2.5) application on &lt;a href=&quot;https://www.centos.org/&quot;&gt;centOS&lt;/a&gt;&amp;nbsp;together with build system &lt;a href=&quot;https://jenkins.io/&quot;&gt;Jenkins&lt;/a&gt;. I&#39;m doing this first time and want to document everything for myself and at the same time I hope it can be useful for somebody else as well.&lt;br /&gt;&lt;br /&gt;Before I wrote few articles how to setup hello-world project on centOS or macOS however now I&#39;m going to work on production setup. I assume you already have you hello-world project and clean centOS environment.&lt;br /&gt;&lt;br /&gt;Let&#39;s have a look on important moment.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h1&gt;Application secret&lt;/h1&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Each play application has secret key which is used for signing session and some other important stuff. It is not possible to run play project in production mode in case if secret is not set or if it is set to default value &#39;changeme&#39;. Secret key is stored in application.conf file /path/to/hello-word/conf/application.conf in variable play.crypto.secret (see below).&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;## Secret key&lt;br /&gt;# http://www.playframework.com/documentation/latest/ApplicationSecret&lt;br /&gt;# ~~~~~&lt;br /&gt;# The secret key is used to sign Play&#39;s session cookie.&lt;br /&gt;# This must be changed for production, but we don&#39;t recommend you change it in this file.&lt;br /&gt;play.crypto.secret = &quot;changeme&quot;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Of course we should not share our secret key and therefore it has to be used/stored on production side only.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;There are at least 3 ways how we can use secret key on production side.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;1. Secret key as a parameter&lt;/h3&gt;It is fine if you have simple application on 1 server, but I would not really recommend that for bigger project.&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;/path/to/hello-world -Dplay.crypto.secret=&quot;secret_token_123&quot;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3&gt;2. Environment variables&lt;/h3&gt;That would read variable from OS environment, otherwise default value will be used (actually the last defined one, in example below it is &quot;chagneme&quot;).&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;play.crypto.secret=&quot;changeme&quot;&lt;br /&gt;play.crypto.secret=${?APPLICATION_SECRET}&lt;/span&gt;&lt;/pre&gt;&lt;h3&gt;3. Use separate configuration file&lt;/h3&gt;Separate configuration is probably the best way to go.&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;include &quot;application&quot;&lt;br /&gt;play.crypto.secret=&quot;QCY?tAnfk?aZ?iwrNwnxIlR6CTf:G3gf:[email protected]`R5W:1uDFN];[email protected]&quot;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;They include config while running application.&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;/path/to/hello-word/bin/yourapp -Dconfig.file=/path/to/production.conf&lt;/span&gt;&lt;/pre&gt;&lt;h3&gt;Secret tools&lt;br /&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There are few already builtin function that can help you deal with secrets: playGenerateSecret (generate secret) and playUpdateSecret (generate and update into config).&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;$ playGenerateSecret&lt;br /&gt;[info] Generated new secret: G28Dze][email protected]_9DCoz;tT_yCj6opKkkIh27K&gt;[0l_NT9lZaFfs?=zx[Wulz&gt;cX&lt;br /&gt;[success] Total time: 0 s, completed Jan 11, 2017 6:24:12 PM&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;$ playUpdateSecret&lt;br /&gt;[info] Generated new secret: QmJ?udauJgDj34AYifbprJvbT5I8^Vw1MY0WmbYRscZmAOotkalbhXbIs^48_Uc9&lt;br /&gt;[info] Updating application secret in /Users/dpa/git/eqa-app/conf/application.conf&lt;br /&gt;[info] Replacing old application secret: changeme&lt;br /&gt;[success] Total time: 0 s, completed Jan 11, 2017 9:22:06 PM&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2017/01/play-project-production-application-secret.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-5478261138628991011</guid><pubDate>Sun, 25 Dec 2016 18:55:00 +0000</pubDate><atom:updated>2016-12-25T19:58:08.765+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><title>HTTP Routing in Play Framework</title><description>&lt;p&gt;We are going to check how Play connect http requests with our code. F.x. when user hits http://localhost:9000/ what happens?&lt;/p&gt;&lt;h3&gt;HTTP Routing&lt;/h3&gt;&lt;p&gt;There is already built in http router in Play Framework. It allows to connect incoming requests with &lt;a href=&quot;https://dpastov.blogspot.dk/2016/12/actions-in-play-framework-25.html&quot; title=&quot;Action in Play Framework&quot;&gt;Play Action&lt;/a&gt; and therefore with public method in a controller class.&lt;/p&gt;&lt;h3&gt;Configuring HTTP Routing&lt;/h3&gt;&lt;p&gt;Normally the configuration for HTTP routing is located in conf/routes. See example:&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;# Static path&lt;br /&gt;GET   /clients/all                  controllers.Clients.list()&lt;br /&gt;# Dynamic path&lt;br /&gt;GET   /clients/:id                  controllers.Clients.show(id: Long)&lt;br /&gt;GET   /files/*name               controllers.Application.download(name)&lt;br /&gt;# Dynamic parts with regexp&lt;br /&gt;GET   /items/$id&lt;[0-9]+&gt;    controllers.Items.show(id: Long)&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;If there are few routes are matched for the same request then the first one in a configuration file will be used.&lt;/p&gt;</description><link>http://dpastov.blogspot.com/2016/12/http-routing-in-play-framework.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-3485099017221828262</guid><pubDate>Fri, 23 Dec 2016 07:00:00 +0000</pubDate><atom:updated>2016-12-23T08:00:32.463+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>Template literals</title><description>&lt;p&gt;I have to follow up with changes to ES6. Today I noticed template literals (there is also tagged template literals but that I will check later).&lt;br /&gt;I am really happy with that, it is simple and helps a lot.&lt;/p&gt;&lt;p&gt;Template literals are a new feature in ES6 that provide us string template things!&lt;/p&gt;&lt;p&gt;Let&#39;s have a look on real example&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;var a = &quot;Apples&quot;;&lt;br /&gt;var b = 10;&lt;br /&gt;console.log(`I would like to buy ${b+b} ${a}.`);&lt;br /&gt;// I would like to buy 20 Apples.&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2016/12/template-literals.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-75119149454015195</guid><pubDate>Thu, 22 Dec 2016 15:13:00 +0000</pubDate><atom:updated>2016-12-22T16:37:22.869+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><title>Actions in Play Framework 2.5</title><description>&lt;p&gt;Requests that come to application based on Play usually are processed by thing which is called action.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Action&lt;/strong&gt; it is just a method that processes parameters of requests and sends result back to web client&lt;/p&gt;&lt;p&gt;Let&#39;s look on example below&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;package controllers;&lt;br /&gt;&lt;br /&gt;import play.mvc.*;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * This controller contains an action to handle HTTP requests&lt;br /&gt; * to the application&#39;s home page.&lt;br /&gt; */&lt;br /&gt;public class HomeController extends Controller {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * An action that renders an HTML page with a welcome message.&lt;br /&gt;     * The configuration in the &lt;code&gt;routes&lt;/code&gt; file means that&lt;br /&gt;     * this method will be called when the application receives a&lt;br /&gt;     * &lt;code&gt;GET&lt;/code&gt; request with a path of &lt;code&gt;/&lt;/code&gt;.&lt;br /&gt;     */&lt;br /&gt;    public Result index() {&lt;br /&gt;        return ok(&quot;Hello World!&quot;);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;We see an action index that return Result (HTTP response which we send to web client).&lt;/p&gt;</description><link>http://dpastov.blogspot.com/2016/12/actions-in-play-framework-25.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-4810745915189334794</guid><pubDate>Wed, 21 Dec 2016 11:06:00 +0000</pubDate><atom:updated>2016-12-21T12:06:29.565+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><category domain="http://www.blogger.com/atom/ns#">Typesafe</category><title>Hello World on Play Framework 2.5 on OSX</title><description>&lt;h2&gt;Today we are going to make Hello World project based on Play Framework 2.5 on OS X&lt;/h2&gt;&lt;p&gt;I&#39;m getting back to &lt;a href=&quot;https://www.playframework.com/&quot;&gt;Play Framework&lt;/a&gt; again and I&#39;m going to build simple start project.&lt;/p&gt;&lt;h3&gt;1. Checking if Java is installed&lt;/h3&gt;&lt;p&gt;Make sure you have java installed.&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;java -version&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;If java is installed you will see message like that:&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;java version &quot;1.8.0_45&quot;&lt;br /&gt;Java(TM) SE Runtime Environment (build 1.8.0_45-b14)&lt;br /&gt;Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3&gt;2. Installing Typesafe activator (current version is 1.3.12)&lt;/h3&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;brew install typesafe-activator&lt;/span&gt;&lt;/pre&gt;&lt;h3&gt;3. Let&#39;s create a new project&lt;/h3&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;activator new hello-world&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;Activator will ask you what template you want to use for new project? (I used play-java).&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;  1) minimal-akka-java-seed&lt;br /&gt;  2) minimal-akka-scala-seed&lt;br /&gt;  3) minimal-java&lt;br /&gt;  4) minimal-scala&lt;br /&gt;  5) play-java&lt;br /&gt;  6) play-scala&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;That will create a java project for us&lt;/p&gt;&lt;p&gt;Now let&#39;s run it. Go into newly create project and run activator&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;activator run&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;That will run our project and up server as well. You can access project by localhost:9000&lt;/p&gt;</description><link>http://dpastov.blogspot.com/2016/12/hello-world-on-play-framework-25-on-osx.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-2553981188981782516</guid><pubDate>Thu, 08 Dec 2016 08:58:00 +0000</pubDate><atom:updated>2016-12-08T10:09:26.013+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Algorithms</category><category domain="http://www.blogger.com/atom/ns#">Development</category><category domain="http://www.blogger.com/atom/ns#">Scala</category><title>Programming Pascal&#39;s triangle</title><description>&lt;h3&gt;What is Pascal&#39;s triangle?&lt;/h3&gt;&lt;div&gt;It is a triangular array which is consists from &lt;a href=&quot;https://en.wikipedia.org/wiki/Binomial_coefficient&quot;&gt;binomial coefficients&lt;/a&gt; (you can see visual representation of it below).&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://3.bp.blogspot.com/-IPoODgT0Z2w/WEkcziBaQyI/AAAAAAAANlE/j8yvu40GRpoxSu1rcGLCJLue_f1ooOmjQCLcB/s1600/PascalTriangleAnimated2.gif&quot; imageanchor=&quot;1&quot; style=&quot;background-color: transparent;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;297&quot; src=&quot;https://3.bp.blogspot.com/-IPoODgT0Z2w/WEkcziBaQyI/AAAAAAAANlE/j8yvu40GRpoxSu1rcGLCJLue_f1ooOmjQCLcB/s320/PascalTriangleAnimated2.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To get more information check article on wiki: &lt;a href=&quot;https://en.wikipedia.org/wiki/Pascal&#39;s_triangle&quot;&gt;Pascal&#39;s triangle&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I had a task where I needed to find out a value in a cell and what I only had were coordinates of it. I came with quit simple solution (Scala) which I really like.&lt;br /&gt;&lt;br /&gt;The idea is to move up from the initial cell to the borders (left and right, since I know the values there) and once I am there, I move back to my initial cell but now I can bring some values from above.&lt;/div&gt;&lt;br /&gt;&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;object Main {&lt;br /&gt;  def main(args: Array[String]) {    &lt;br /&gt;    println(pascal(4, 3))&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  def pascal(c: Int, r: Int): Int = {&lt;br /&gt;    if (c == 0 || r == 0 || c == r) 1&lt;br /&gt;    else pascal(c - 1, r - 1) + pascal(c, r - 1)&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2016/12/programming-pascals-triangle.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://3.bp.blogspot.com/-IPoODgT0Z2w/WEkcziBaQyI/AAAAAAAANlE/j8yvu40GRpoxSu1rcGLCJLue_f1ooOmjQCLcB/s72-c/PascalTriangleAnimated2.gif" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Copenhagen, Denmark</georss:featurename><georss:point>55.6760968 12.568337100000008</georss:point><georss:box>55.532822800000005 12.245613600000008 55.8193708 12.891060600000008</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-204499200834064239</guid><pubDate>Tue, 22 Mar 2016 10:19:00 +0000</pubDate><atom:updated>2016-03-22T11:19:41.375+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Use equal for string literal, rather than for an object</title><description>When you wanna compare String object with string literal, we often disregard what we compare with what, however there is one and safe way to do it.&lt;br /&gt;&lt;br /&gt;It&#39;s much better to use equals() and equalsIgnoreCase() for a string literal, instead of Object, because it helps to avoid possible NullPointerException.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; String a = null;  &lt;br /&gt; System.out.print(&quot;123&quot;.equals(a));     // false  &lt;br /&gt; System.out.print(a.equals(&quot;123&quot;));     // java.lang.NullPointerException&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2016/03/use-equal-for-string-literal-rather.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-3648452310915307118</guid><pubDate>Fri, 08 Jan 2016 10:32:00 +0000</pubDate><atom:updated>2016-01-08T11:35:05.048+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Typical mistakes with String in Java</title><description>Just few typical mistakes developers do when dealing with Strings. It&#39;s common stuff and everybody knows that, but for some reasons I still find such things (even written by myself :-)).&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;1. Checking empty string&lt;/h3&gt;&lt;br /&gt;In old days (version 1.5 and lower) we used String.equal(&quot;&quot;), but 1.6 brought us String.IsEmpty which is better and faster.&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; // wrong/slow  &lt;br /&gt; if (name.equals(&quot;&quot;)) {  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; // correct/fast&lt;br /&gt; if (name.isEmpty()) {&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;2. Concatenation&lt;/h3&gt;&lt;br /&gt;Method &lt;strong&gt;String.concat&lt;/strong&gt; creates new String object, it&#39;s OK to use it when you do operation only once, otherwise use operator + += operators (see below why).&lt;br /&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; String s = &quot;Hello &quot;.concat(&quot;new&quot;).concat(&quot; world!&quot;); // &quot;Hello new world!&quot;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Using operators + and +=, they do not use &lt;strong&gt;String.concat&lt;/strong&gt; method but &lt;strong&gt;StringBuilder&lt;/strong&gt; and it&#39;s important to know what it means to us.&lt;br /&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; String s = &quot;Hello &quot; + &quot;new&quot; + &quot; world!&quot;; // &quot;Hello new world!&quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;What actually happens when you use + operator is StringBuilder used:&lt;br /&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; String s = new StringBuilder().append(&quot;Hello &quot;).append(&quot;new&quot;).append(&quot; world!&quot;).toString(); // &quot;Hello new world!&quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So conclusion - it&#39;s ok to use concat if you do one time operation, for any other situation I would recommend to use + or +=.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;3. String Formatting&lt;/h3&gt;&lt;br /&gt;Very often in order to format string people either concatenate the string to achieve result or do replace or invent something else. I do it as well sometimes (what a shame!). Instead we should use String.format method to do that.&lt;br /&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; int n = 10;  &lt;br /&gt; // wrong  &lt;br /&gt; String s = &quot;I have &quot; + Integer.toString(10) + &quot; books&quot;;  &lt;br /&gt; // wrong  &lt;br /&gt; String s = &quot;I have #num books&quot;.replace(&quot;#num&quot;, Integer.toString(10));  &lt;br /&gt; // correct  &lt;br /&gt; Strig s = String.format(&quot;I have %d books&quot;, n);  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;I would be glad to hear other typical mistakes we do with String object! So please share your experience.</description><link>http://dpastov.blogspot.com/2016/01/typical-mistakes-with-string-in-java.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-3481889557796435867</guid><pubDate>Thu, 07 Jan 2016 11:00:00 +0000</pubDate><atom:updated>2016-01-07T12:00:00.138+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">SOAP</category><title>SOAP and passing session</title><description>Here is an example how to &lt;strong&gt;pass session&lt;/strong&gt; using SOAP envelope approach. I was starlight with it for some time.&lt;br /&gt;&lt;br /&gt;That is why people use REST our days :) and not SOAP approach.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;   // Create SOAP Connection  &lt;br /&gt;   SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();  &lt;br /&gt;   SOAPConnection soapConnection = soapConnectionFactory.createConnection();  &lt;br /&gt;   // connect to webserivce&lt;br /&gt;   SOAPMessage soapResponse = soapConnection.call(connect(username, password), url);&lt;br /&gt;&lt;br /&gt;   // read cookie from response and use it when send another requests&lt;br /&gt;   MimeHeaders session = soapResponse.getMimeHeaders(); &lt;br /&gt;   String sesisonCookie = session.getHeader(&quot;Set-Cookie&quot;)[0];&lt;br /&gt;&lt;br /&gt;   SOAPMessage soapResponse2 = soapConnection.call(customerGetAll(sesisonCookie), url);&lt;br /&gt;   soapConnection.close();&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Here is how we add cookie to soap request&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;   SOAPBody soapBody = envelope.getBody();&lt;br /&gt;   SOAPElement soapBodyElem = soapBody.addChildElement(&quot;Customer_GetAll&quot;, &quot;m&quot;);&lt;br /&gt;   soapMessage.getMimeHeaders().addHeader(&quot;Cookie&quot;, sesisonCookie);&lt;br /&gt;   soapMessage.saveChanges();&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2016/01/soap-and-passing-session.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-2049917686259086379</guid><pubDate>Wed, 06 Jan 2016 08:00:00 +0000</pubDate><atom:updated>2016-01-06T09:00:03.315+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Java web-consumer in Domino and cookie session</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;Recently I&#39;ve faced with few mistake that drain hours from me. I had to make integration with web-serivce. I imported WSDL file and got java classes generated, than I according to documentation I checked connect method with credentials...&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Error connecting to &#39;endpoint&#39; on port &#39;443&#39;, SSL invalid certificate, may need to cross-certify&lt;/blockquote&gt;Spend some time and found very detailed answer on stackoverflow:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/34167733/create-cross-certificate-for-domino-java-agent&quot;&gt;Create cross certificate for Domino Java agent?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Tried connect method again - it worked! Gonna be easy task now (I thought). However nothing else except connect method worked. All other method of consumer either did nothing or returned null to me. I was confused, spend few hours and than contacted web-service provider, they were not familiar with Java and provided me example in PHP that worked as expected.&lt;/div&gt;&lt;br /&gt;My issue was I had to set SESSION_MAINTAIN_PROPERTY to true for my proxy object.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; SecretServiceLocator service = new SecretServiceLocator();  &lt;br /&gt; SecretPortType port = service.getSecretPort();  &lt;br /&gt; ((javax.xml.rpc.Stub)port)._setProperty(javax.xml.rpc.Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h4&gt;SESSION_MAINTAIN_PROPERTY&lt;/h4&gt;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint. If this property is set to true, the service client indicates that it wants the session to be maintained. If set to false, the session is not maintained. The default value for this property is false.&lt;/blockquote&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Once I set session maintain to true - everything started to work.&lt;/div&gt;</description><link>http://dpastov.blogspot.com/2016/01/java-web-consumer-in-domino-and-cookie.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-3808306096627726791</guid><pubDate>Tue, 05 Jan 2016 08:00:00 +0000</pubDate><atom:updated>2016-01-05T18:44:00.041+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DSAPI</category><title>DSAPI for Domino</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;This post is about to make short summary about DSAPI filter. I&#39;ve finished my project some time ago and it looks like I&#39;m not going to do any work with it in near future.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;h3&gt;What is DSAPI?&lt;/h3&gt;&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;The Domino Web Server Application Programming Interface (DSAPI) is a C API that lets you write your own extensions to the Domino Web Server. DSAPI extensions, or filters, are notified whenever a particular event occurs during the processing of a request.&lt;/blockquote&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;I&#39;ve written few articles about DSAPI before and now it is time to publish my work/project on github. You can find it here:&amp;nbsp;&lt;a href=&quot;https://github.com/dpastov/domino-dsapi-handler&quot;&gt;domino-dsapi-handler&lt;/a&gt;. I did not have time to make a documentation for it (and I&#39;m not sure I will do it, without funding), but all sources are there.&lt;/div&gt;&lt;br /&gt;In this post I will highlight most important things you need to know if you are going to build your own DSAPI filter.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;/h3&gt;&lt;h3&gt;Initialization&lt;/h3&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Domino calls the initialization function when the filter is loaded. The filter is loaded when the Domino HTTP server task is started or when the HTTP task is restarted with the Domino console command &#39;tell http restart&#39;.&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; DLLEXPORT unsigned int FilterInit(FilterInitData* filterInitData) {  &lt;br /&gt;  // init events you want to handle  &lt;br /&gt;  filterInitData-&amp;gt;eventFlags = kFilterRewriteURL | kFilterResponse | kFilterTranslateRequest;  &lt;br /&gt;  // another code  &lt;br /&gt;  return kFilterHandledRequest;  &lt;br /&gt; } // end FilterInit  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Terminate filter&lt;/h3&gt;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;The filter may also define a termination entry point. Domino will call this function whenever the filter is about to be unloaded. The filter can use this function to clean up resources it allocated&lt;/span&gt;&lt;/blockquote&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; DLLEXPORT unsigned int TerminateFilter(unsigned int reserved) {  &lt;br /&gt;  return kFilterHandledEvent;  &lt;br /&gt; }     // end TerminateFilter  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;HttpFilterProc&lt;/h3&gt;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;The Event Notification function does the actual work of the filter. Domino calls the Event Notification function whenever a particular event occurs during the processing of an http request. When Domino calls the filter&#39;s Event Notification function it passes information about the request and the event being processed. On each call the filter can decide to handle the event, with or without an error return, or decline to handle the event.&lt;/span&gt;&lt;/blockquote&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; DLLEXPORT unsigned int HttpFilterProc(FilterContext* context, unsigned int eventType, void* eventData) {  &lt;br /&gt;      switch (eventType) {  &lt;br /&gt;           case kFilterTranslateRequest:  &lt;br /&gt;                return QueryRewrite(context, (FilterMapURL *) eventData);  &lt;br /&gt;           case kFilterRewriteURL:  &lt;br /&gt;                return RewriteURL(context, (FilterMapURL *) eventData);  &lt;br /&gt;           case kFilterResponse:  &lt;br /&gt;                return ResponseHeaders(context, (FilterResponseHeaders *) eventData);  &lt;br /&gt;           default:  &lt;br /&gt;                return kFilterNotHandled;  &lt;br /&gt;      }  &lt;br /&gt; }     // end HttpFilterProc  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The rest of logic you can read yourself in&amp;nbsp;SEOUrlHandler.c file. I&#39;ve added information about how to compile DLL in readme on github. However If you have any question regarding some details let me know either via email or as a comment to this post. I will be glad to help.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;Related topics&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://dpastov.blogspot.dk/2013/03/rewriting-url-in-domino-using-dsapi.html&quot;&gt;Rewriting URL in Domino using DSAPI&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://dpastov.blogspot.dk/2011/11/solution-for-lotus-domino-to-trailing.html&quot;&gt;Solution for Lotus Domino to the trailing slash problem&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://dpastov.blogspot.dk/2013/07/dsapi-or-javaxpages.html&quot;&gt;Replacement for DSAPI in Java/XPages&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Used materials&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://www-12.lotus.com/ldd/doc/tools/c/5.0.3/api503ug.nsf/85255d56004d2bfd85255b1800631684/aad371dc1de6cad58525687b0054da41?OpenDocument&quot;&gt;Domino Web Server Application Interface (DSAPI)&lt;/a&gt;</description><link>http://dpastov.blogspot.com/2016/01/dsapi-for-domino.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-6785706395499808013</guid><pubDate>Mon, 04 Jan 2016 08:00:00 +0000</pubDate><atom:updated>2016-01-04T09:00:03.503+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">locale</category><category domain="http://www.blogger.com/atom/ns#">LS2J</category><title>Format datetime object in Lotus Script</title><description>Sometimes datetime output become tricky in Lotus Notes.&lt;br /&gt;&lt;br /&gt;F.x. imagine you have code like this and you have german or any another locale on user&#39;s PC.&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Set dt = New NotesDateTime(&quot;&quot;)  &lt;br /&gt; Call dt.SetNow  &lt;br /&gt; msgbox Format$(dt.LSLocalTime, &quot;dddd, dd. MMMM yyyy&quot;)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Out would be&lt;br /&gt;&lt;b&gt;Tuesday, 22. December 2015&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;But what if you want output in german i.e.?&lt;br /&gt;&lt;b&gt;22. Dezember 2015&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In such case you may want to use LS2J approach to display it properly to user&lt;br /&gt;&lt;br /&gt;Below you will find a solution that either allow to set locale or use default locale.&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; Option Public  &lt;br /&gt; Option Declare  &lt;br /&gt; UseLSX &quot;*javacon&quot;  &lt;br /&gt; Sub Initialize   &lt;br /&gt;  On Error GoTo errhandler  &lt;br /&gt;  Dim jSession As New JavaSession  &lt;br /&gt;  Dim jCalendarClass As Javaclass, jLocaleClass As JavaClass, jSimpleDateFormatClass As JavaClass&lt;br /&gt;  Dim jCalendar As Javaobject, jLocale As Javaobject, jSDF As JavaObject, jDate As Javaobject  &lt;br /&gt;  Dim jError As JavaError  &lt;br /&gt;  Dim dt As New NotesDateTime(&quot;&quot;)  &lt;br /&gt;  Call dt.SetNow  &lt;br /&gt;  &#39;in order to initiate date - we have to use Calendar object  &lt;br /&gt;  Set jCalendarClass = jSession.GetClass(&quot;java.util.Calendar&quot;)  &lt;br /&gt;  Set jCalendar = jCalendarClass.getInstance()  &lt;br /&gt;  Call jCalendar.set(Year(dt.DateOnly), month(dt.DateOnly) - 1, day(dt.DateOnly))  &lt;br /&gt;  &#39;initialize date object  &lt;br /&gt;  Set jDate = jCalendar.getTime()  &lt;br /&gt;  &#39;IMPORTANT  &lt;br /&gt;  &#39;create locale (here we specify langauge/country code)   &lt;br /&gt;  Set jLocaleClass = jSession.GetClass(&quot;java.util.Locale&quot;)  &lt;br /&gt;  Set jLocale = jLocaleClass.CreateObject(&quot;(Ljava/lang/String;Ljava/lang/String;)V&quot;, &quot;de&quot;, &quot;DE&quot;)  &lt;br /&gt;  &#39;also you can use local settings, if you need that - enable line below  &lt;br /&gt;  &#39;Set jLocale = jLocaleClass.getDefault()  &lt;br /&gt;  &#39;output format  &lt;br /&gt;  Set jSimpleDateFormatClass = jSession.GetClass(&quot;java.text.SimpleDateFormat&quot;)  &lt;br /&gt;  Set jSDF = jSimpleDateFormatClass.CreateObject(&quot;(Ljava/lang/String;Ljava/util/Locale;)V&quot;, &quot;dd. MMMM yyyy&quot;, jLocale)  &lt;br /&gt;  &#39;result  &lt;br /&gt;  MsgBox jSDF.format(jDate)  &lt;br /&gt;  done:  &lt;br /&gt;  Exit Sub  &lt;br /&gt;  errhandler:  &lt;br /&gt;  Set jError = jSession.GetLastJavaError()  &lt;br /&gt;  MsgBox &quot;JavaError was &quot; &amp;amp; jError.errorMsg  &lt;br /&gt;  jSession.ClearJavaError  &lt;br /&gt;  Resume done  &lt;br /&gt; End Sub  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Related topics:&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://dpastov.blogspot.dk/2015/10/locale-settings-for-date-time-in-domino-notes.html&quot;&gt;Locale settings for date and time in IBM Domino and Notes&lt;/a&gt;</description><link>http://dpastov.blogspot.com/2016/01/format-datetime-object-in-lotus-script.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-816096028478540674</guid><pubDate>Tue, 27 Oct 2015 14:53:00 +0000</pubDate><atom:updated>2016-01-04T10:12:46.387+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">locale</category><category domain="http://www.blogger.com/atom/ns#">notes.ini</category><title>Locale settings for date and time in IBM Domino and Notes</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;Recently we setup 2 new IBM Domino servers and today I found an issue related to how we display time in our application. The 12-hours format was used (with AM or PM). I&#39;ve checked OS date settings and they were right so I started to google and found out that in order to change locale settings to 24-hours you have either update notes.ini with a ClockType variable or change register.&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;I went with notes.ini (feel more safe with it). Below few variables that control date/time format output.&lt;/div&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; DateOrder=YMD  &lt;br /&gt; DateSeparator=.  &lt;br /&gt; TimeSeparator=:  &lt;br /&gt; CLOCKTYPE=24_HOUR  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;It is also possible for windows OS to change register (but I personally do not like that).&lt;br /&gt;&lt;pre style=&quot;background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; HKEY_USERS\.DEFAULT\Control Panel\International\iDate  &lt;br /&gt; HKEY_USERS\.DEFAULT\Control Panel\International\iTime  &lt;br /&gt; HKEY_CURRENT_USER\Control Panel\International\iDate  &lt;br /&gt; HKEY_CURRENT_USER\Control Panel\International\iTime  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You may find more information about it in article &lt;a href=&quot;http://www.ibm.com/developerworks/lotus/library/ls-timelyinfo/&quot;&gt;Timely information in NOTES.INI&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Related topics&lt;/b&gt;:&lt;br /&gt;&lt;a href=&quot;http://dpastov.blogspot.dk/2016/01/format-datetime-object-in-lotus-script.html&quot;&gt;Format datetime object in Lotus Script&lt;/a&gt;</description><link>http://dpastov.blogspot.com/2015/10/locale-settings-for-date-time-in-domino-notes.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-8434140481549158887</guid><pubDate>Mon, 19 Oct 2015 08:54:00 +0000</pubDate><atom:updated>2015-10-19T10:54:42.050+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">XPath</category><title>Using preceding-sibling and following-sibling in xpath</title><description>In this article I will show few examples about how to use &lt;strong&gt;following-sibling&lt;/strong&gt; and &lt;strong&gt;preceding-sibling&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Our XML example we are going to use.&lt;br /&gt;&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;div id=&quot;cities&quot;&amp;gt;  &lt;br /&gt; &amp;lt;country&amp;gt;France&amp;lt;/country&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;Paris&amp;lt;/city&amp;gt;  &lt;br /&gt;   &amp;lt;country&amp;gt;UK&amp;lt;/country&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;London&amp;lt;/city&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;Manchester&amp;lt;/city&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;Liverpool&amp;lt;/city&amp;gt;  &lt;br /&gt;   &amp;lt;country&amp;gt;Denmark&amp;lt;/country&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;Copenhagen&amp;lt;/city&amp;gt;  &lt;br /&gt;   &amp;lt;country&amp;gt;Ukraine&amp;lt;/country&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;Kiev&amp;lt;/city&amp;gt;  &lt;br /&gt;   &amp;lt;city&amp;gt;Odessa&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;/div&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Taking all city elements after element UK&lt;/h3&gt;&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /div/country[.=&#39;UK&#39;]/following-sibling::city  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;city&amp;gt;London&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Manchester&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Liverpool&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Copenhagen&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Kiev&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Odessa&amp;lt;/city&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Taking all city elements before element Denmark&lt;/h3&gt;&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; /div/country[.=&#39;Denmark&#39;]/preceding-sibling::city  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;city&amp;gt;Paris&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;London&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Manchester&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Liverpool&amp;lt;/city&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Let&#39;s increase difficulty little bit and try to use preceding-sibling and following-sibling in the brackets []&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Taking all city elements following till first country is UK&lt;/h3&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; /div/city[following-sibling::country=&#39;Denmark&#39;]  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;city&amp;gt;Paris&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;London&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Manchester&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Liverpool&amp;lt;/city&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Taking all city elements from bottom till first country is Denmark&lt;/h3&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; /div/city[preceding-sibling::country=&#39;Denmark&#39;]  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;city&amp;gt;Copenhagen&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Kiev&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Odessa&amp;lt;/city&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Let&#39;s increase difficulty even more and start using both preceding-sibling and following-sibling in one xpath.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Taking all city elements between two elements&lt;/h3&gt;In this example I&#39;m going to get cities after UK and before Ukraine.&lt;br /&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; /div/city[preceding-sibling::country=&#39;UK&#39; and following-sibling::country=&#39;Ukraine&#39;]  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;city&amp;gt;London&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Manchester&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Liverpool&amp;lt;/city&amp;gt;  &lt;br /&gt; &amp;lt;city&amp;gt;Copenhagen&amp;lt;/city&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2015/10/preceding-sibling-and-following-signling-xpath.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-197885046011080006</guid><pubDate>Wed, 14 Oct 2015 14:44:00 +0000</pubDate><atom:updated>2016-12-25T15:56:03.341+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Play Framework</category><title>Setup Play Framework and TypeSafe on centOS</title><description>I&#39;m going to setup simple project based on &lt;a href=&quot;https://www.playframework.com/&quot; target=&quot;_blank&quot;&gt;Play Framework&lt;/a&gt;&amp;nbsp;together with &lt;a href=&quot;http://cassandra.apache.org/&quot; target=&quot;_blank&quot;&gt;Cassandra&lt;/a&gt;&amp;nbsp;on two&amp;nbsp;&lt;a href=&quot;https://www.centos.org/&quot; target=&quot;_blank&quot;&gt;centOS&lt;/a&gt;&amp;nbsp;servers.&lt;br /&gt;&lt;br /&gt;I&#39;m going to do 3 steps during that process:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install Java&lt;/li&gt;&lt;li&gt;Install Typesafe activator&lt;/li&gt;&lt;li&gt;Create test project.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h3&gt;Installing Java&lt;/h3&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;//1. go to opt folder&lt;br /&gt;cd /opt&lt;br /&gt;&lt;br /&gt;//2. download java&lt;br /&gt;wget --no-cookies --no-check-certificate --header &quot;Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie&quot; &quot;http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz&quot;&lt;br /&gt;&lt;br /&gt;//3. extract java archive&lt;br /&gt;tar xzf jdk-8u60-linux-x64.tar.gz&lt;br /&gt;&lt;br /&gt;//4. installing java&lt;br /&gt;cd /opt/jdk1.8.0_60/&lt;br /&gt;alternatives --install /usr/bin/java java /opt/jdk1.8.0_60/bin/java 2&lt;br /&gt;alternatives --config java&lt;br /&gt;&lt;br /&gt;//5. recommended options: setup javac and jar&lt;br /&gt;alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_60/bin/jar 2&lt;br /&gt;alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_60/bin/javac 2&lt;br /&gt;alternatives --set jar /opt/jdk1.8.0_60/bin/jar&lt;br /&gt;alternatives --set javac /opt/jdk1.8.0_60/bin/javac&lt;br /&gt;&lt;br /&gt;//6. setup variables so we can access java from everywhere&lt;br /&gt;export JAVA_HOME=/opt/jdk1.8.0_60&lt;br /&gt;export JRE_HOME=/opt/jdk1.8.0_60/jre&lt;br /&gt;export PATH=$PATH:/opt/jdk1.8.0_60/bin:/opt/jdk1.8.0_60/jre/bin&lt;br /&gt;&lt;br /&gt;//7. checking java version&lt;br /&gt;java -version&lt;br /&gt;&lt;br /&gt;//8. delete java archive&lt;br /&gt;rm jdk-8u60-linux-x64.tar.gz&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Installing Play Framework / TypeSafe&lt;/h3&gt;&lt;br /&gt;Example is about current version, which is 1.3.6&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;//1. go to tmp folder and download typesafe activator&lt;br /&gt;cd /tmp&lt;br /&gt;wget https://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip&lt;br /&gt;&lt;br /&gt;//2. unzip and move to opt folder&lt;br /&gt;unzip typesafe-activator-1.3.6.zip&lt;br /&gt;mv activator-dist-1.3.6 /opt&lt;br /&gt;&lt;br /&gt;//3. delete zip file, we do not need it anymore&lt;br /&gt;rm typesafe-activator-1.3.6.zip&lt;br /&gt;&lt;br /&gt;//4. create soft symbolic link from /opt/activator-dist-1.3.6/activator to /usr/local/sbin/activator&lt;br /&gt;ln -s /opt/activator-dist-1.3.6/activator /usr/local/sbin/activator&lt;br /&gt;&lt;br /&gt;//5. set variables so we can use activator from everywhere&lt;br /&gt;export PATH=/usr/local/sbin/activator:$PATH&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Create helloworld project&lt;/h3&gt;&lt;br /&gt;&lt;div&gt;Time to create our first project. Play Framework provides many templates, we are going to use play-java (it has already web interface and some code, so we can discover it).&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;//1. create folder www in /var (we are going to keep projects there).&lt;br /&gt;cd /var&lt;br /&gt;mkdir www&lt;br /&gt;cd www&lt;br /&gt;&lt;br /&gt;//2. have a look on current templates&lt;br /&gt;activator list-templates&lt;br /&gt;&lt;br /&gt;//3. create a new project based on play-java template&lt;br /&gt;activator new helloworld play-java&lt;br /&gt;&lt;br /&gt;//4. go into newly created project and run it&lt;br /&gt;cd helloworld&lt;br /&gt;activator run&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;If activator run properly, you should see something like this:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://3.bp.blogspot.com/-q7LrZ9eQmpw/Vh5p-pVHepI/AAAAAAAAMhQ/5kbjYKuGQy4/s1600/play-helloworld.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://3.bp.blogspot.com/-q7LrZ9eQmpw/Vh5p-pVHepI/AAAAAAAAMhQ/5kbjYKuGQy4/s400/play-helloworld.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Now you are ready to open project in browser. Type 127.0.0.1:900 and boooom, we have it ready!&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-52Lqvcad42M/Vh5qHiMqynI/AAAAAAAAMhY/VDxEMlsOu0I/s1600/helloworld-ui.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;342&quot; src=&quot;https://2.bp.blogspot.com/-52Lqvcad42M/Vh5qHiMqynI/AAAAAAAAMhY/VDxEMlsOu0I/s400/helloworld-ui.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I&#39;m going to play with centOS little bit more (before I start to look on code). I already have some minor issues I want to optimise.</description><link>http://dpastov.blogspot.com/2015/10/setup-play-framework-and-typesafe-centos.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://3.bp.blogspot.com/-q7LrZ9eQmpw/Vh5p-pVHepI/AAAAAAAAMhQ/5kbjYKuGQy4/s72-c/play-helloworld.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-4292372480412897257</guid><pubDate>Sat, 04 Jul 2015 18:49:00 +0000</pubDate><atom:updated>2016-01-02T15:21:53.195+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">locale</category><title>Transformation of String into Date respecting Locale</title><description>Let&#39;s say you need to parse a string into date and it is localized string (f.x. name of month on local language). In past I would definitely define an array with months and then parse a String to get a number of my month and then build a Date object. In Java it&#39;s pretty simple (almost 1 line of code).&lt;br /&gt;&lt;h3&gt;Locale approach&lt;/h3&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;package parser;&lt;br /&gt;&lt;br /&gt;import java.text.ParseException;&lt;br /&gt;import java.text.SimpleDateFormat;&lt;br /&gt;import java.util.Date;&lt;br /&gt;import java.util.Locale;&lt;br /&gt;&lt;br /&gt;public class parser {&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) throws ParseException {&lt;br /&gt;  Locale locale = new Locale(&quot;ru&quot;);&lt;br /&gt;  Date date = convertStringToDate(&quot;19 Сентября 2004&quot;, &quot;d MMMM yyyy&quot;, locale);&lt;br /&gt;  System.out.println(date); // Sun Sep 19 00:00:00 CEST 2004&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public static java.util.Date convertStringToDate(String dateString, String format, Locale locale) throws ParseException {&lt;br /&gt;  return new SimpleDateFormat(&quot;d MMMM yyyy&quot;, locale).parse(dateString);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;Alternatively, if you need to define months yourself use &lt;a href=&quot;http://docs.oracle.com/javase/7/docs/api/java/text/DateFormatSymbols.html&quot;&gt;DateFormatSymbols&lt;/a&gt;&lt;br /&gt;&lt;h3&gt;Define symbols in DateFormatSymbols&lt;/h3&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;package parser;&lt;br /&gt;&lt;br /&gt;import java.text.DateFormatSymbols;&lt;br /&gt;import java.text.ParseException;&lt;br /&gt;import java.text.SimpleDateFormat;&lt;br /&gt;&lt;br /&gt;public class parser {&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) throws ParseException {&lt;br /&gt;  String months[] = {&quot;Январь&quot;, &quot;Февраль&quot;, &quot;Март&quot;, &quot;Апрель&quot;, &quot;Май&quot;, &quot;Июнь&quot;, &quot;Июль&quot;, &quot;Август&quot;, &quot;Сентябрь&quot;, &quot;Октябрь&quot;, &quot;Ноябрь&quot;, &quot;Декабрь&quot;};&lt;br /&gt;  DateFormatSymbols dfs = new DateFormatSymbols();&lt;br /&gt;  dfs.setMonths(months);&lt;br /&gt;  &lt;br /&gt;  SimpleDateFormat sdf = new SimpleDateFormat(&quot;d MMMM yyyy&quot;);&lt;br /&gt;  sdf.setDateFormatSymbols(dfs);&lt;br /&gt;  System.out.print(sdf.parse(&quot;19 Сентября 2004&quot;)); // Sun Sep 19 00:00:00 CEST 2004&lt;br /&gt; }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2015/07/transformation-of-string-into-date.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-5373724267969001939</guid><pubDate>Mon, 15 Jun 2015 09:24:00 +0000</pubDate><atom:updated>2015-10-26T23:09:42.143+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Domino</category><title>Insufficient memory - NSF pool is full</title><description>Recently I&#39;ve faced up with an odd issue. When users tried to open Lotus Notes applications they got a warning saying&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Insufficient memory - NSF pool is full&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;What &#39;Insufficient memory - NSF pool is full&#39; is about?&lt;/h2&gt;As far as I understood it is memory leak on IBM Domino server. There are different kind of issues similar to this one:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Insufficient memory - NSF pool is full&lt;/li&gt;&lt;li&gt;Insufficient memory - index pool is full&lt;/li&gt;&lt;li&gt;Insufficient memory - NSF directory manager pool is full&lt;/li&gt;&lt;li&gt;Insufficient memory - Event pool is full&lt;/li&gt;&lt;li&gt;Insufficient memory - NSF Monitor pool is full&lt;/li&gt;&lt;li&gt;Insufficient memory - Network pool is full&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Fixing the issue&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Of course it require investigation why it happened but as a temporary fix you can simple increase memory while you are looking into the problem (if you do so :)). The variable name responsible for this pool is NSF_Buffer_Pool_Size (number of bytes) or alternatively you can use NSF_Buffer_Pool_Size_MB (number of megabytes). I&#39;m not going to explain details about this variable, since you can find everything on IBM, just open this link: &lt;a href=&quot;http://www-01.ibm.com/support/knowledgecenter/SSKTMJ_9.0.1/admin/conf_nsf_buffer_pool_size_r.dita&quot;&gt;NSF_Buffer_Pool_Size&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;Adding or changing NSF_Buffer_Pool_Size_MB in notes.ini&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;I didn&#39;t find a default size for NSF_Buffer_Pool_Size (One article mentioned 32MB as a default value, however I could not really confirm that with IBM documentations). Anyway, for I set 64MB and from now I will keep my eyes open on this problem.&lt;/div&gt;Let&#39;s &lt;a href=&quot;https://draft.blogger.com/Editing%20the%20NOTES.INI%20file&quot;&gt;change notes.ini&lt;/a&gt; using a Configuration Settings document&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First, open IBM Domino Administrator and find a Configuration tab there.&lt;/li&gt;&lt;li&gt;Find Configuration settings now (in R9, it&#39;s nuder Server\Configurations), if it is not there, you may need to create it first.&lt;/li&gt;&lt;li&gt;Highlight right server and and click button Edit Configuration and switch to NOTES.INI Settings tab.&lt;/li&gt;&lt;li&gt;There must be a button: Set/Modify Parameters at the bottom, click on it and add/change your variable.&lt;/li&gt;&lt;li&gt;Save configuration and Restart Server.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Done.</description><link>http://dpastov.blogspot.com/2015/06/insufficient-memory-nsf-pool-is-full.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-4616352343355533918</guid><pubDate>Tue, 05 May 2015 07:00:00 +0000</pubDate><atom:updated>2015-10-13T12:06:26.711+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">lotus features</category><category domain="http://www.blogger.com/atom/ns#">lotus script</category><title>ColumnValuesIndex property of NotesViewColumn</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;Since there is no documentation about property &lt;strong&gt;ColumnValuesIndex&lt;/strong&gt; of class &lt;strong&gt;NotesViewColumn&lt;/strong&gt;. Let me describe it. &lt;/div&gt;Let&#39;s create a view with 7 columns:&lt;br /&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;@DocNumber&lt;/li&gt;&lt;li&gt;Hidden (sorting) column that does &lt;b&gt;sorting&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Column with formula value: &lt;b&gt;Form&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Icon (static value: &lt;b&gt;12&lt;/b&gt;)&lt;/li&gt;&lt;li&gt;Column with formula value: &lt;b&gt;@Created&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Constant value: &lt;b&gt;100&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Total with &#39;hide details row&#39; enabled (for each row value: &lt;b&gt;1&lt;/b&gt;)&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-EZbeb92dqYM/VUVUwLWlEcI/AAAAAAAAMPo/FuIDPiyMImw/s1600/view-example-for-columnvaluesindex.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;116&quot; src=&quot;http://3.bp.blogspot.com/-EZbeb92dqYM/VUVUwLWlEcI/AAAAAAAAMPo/FuIDPiyMImw/s400/view-example-for-columnvaluesindex.PNG&quot; title=&quot;Example for IBM Lotus Notes Domino ColumnValuesIndex&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;Analyze ColumnValuesIndex&lt;/h2&gt;Let&#39;s write some code and check what exactly &lt;strong&gt;ColumnValuesIndex&lt;/strong&gt; returns &lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;  Dim ws As New NotesUIWorkspace&lt;br /&gt;  Dim view As NotesView&lt;br /&gt;  Dim col As NotesViewColumn&lt;br /&gt;  Dim i As Integer&lt;br /&gt; &lt;br /&gt;  Set view = ws.CurrentView.View&lt;br /&gt;  For i = 0 To view.ColumnCount - 1&lt;br /&gt;    Set col = view.Columns(i)&lt;br /&gt;    Msgbox col.ColumnValuesIndex&lt;br /&gt;  Next&lt;/span&gt;&lt;/pre&gt;The result for columns will be: -1, 0, 1, -1, 2, -1, 3.&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;We may see now that for some of columns we got (-1). Let&#39;s look on these 3 columns and try to guess how they are different compare to other columns. Here is my assumptions for what cases it returns (-1) &lt;br /&gt;&lt;ul&gt;&lt;li&gt;A formula containing a UI-only function such as @IsExpandable or @DocNumber.&lt;/li&gt;&lt;li&gt;A constant.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Summary for ColumnValuesIndex&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Otherwise it returns columns position (&lt;i&gt;without taking into account columns with -1&lt;/i&gt;), It looks like it is exactly same logic as in notesViewEntry.ColumnValues&lt;/div&gt;&lt;/div&gt;</description><link>http://dpastov.blogspot.com/2015/05/columnvaluesindex-property-notesviewcolumn.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-EZbeb92dqYM/VUVUwLWlEcI/AAAAAAAAMPo/FuIDPiyMImw/s72-c/view-example-for-columnvaluesindex.PNG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-5840426656768595900</guid><pubDate>Mon, 04 May 2015 07:00:00 +0000</pubDate><atom:updated>2015-10-27T15:58:20.050+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">lotus script</category><category domain="http://www.blogger.com/atom/ns#">views</category><title>Refresh embedded view</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;Here is the classic old issue. I&#39;ve a form with embedded view on it (Show single category is used as well). There is an action on a view that create a new documents (which should be displayed in that embedded view). These solutions most likely wont work&lt;/div&gt;&lt;ul&gt;&lt;li&gt;ws.ViewRefresh&amp;nbsp;will not help&lt;/li&gt;&lt;li&gt;Refreshing NotesUIDocument may cause a Notes client to crash, so it is not a way to go as well.&lt;/li&gt;&lt;/ul&gt;Here are some possible ways to solve it: &lt;br /&gt;&lt;h2&gt;&lt;b&gt;Refresh view by simulating of pressing F9&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;While searching for an example I found it on my blog :-), so you can easily find it here: &lt;a href=&quot;http://dpastov.blogspot.com/2009/12/how-to-emulate-f9-key.html&quot; target=&quot;_blank&quot; title=&quot;how to emulate F9 key&quot;&gt;how to emulate F9 key&lt;/a&gt;&amp;nbsp;and save some minutes.&lt;/div&gt;&lt;h2&gt;&lt;b&gt;Refresh view by changing focus to another fields&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The idea is to have 2 fields (let&#39;s call them FieldA and fieldB). Once you need to refresh embedded view - set focus to fieldA and then change it to fieldB. You also need either add refresh logic on Exiting property of fieldA (I prefer it, as it will not cause the perfomance on a form) or enable Automatically Refresh fields.&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Refresh embedded view using hidden formula&lt;/h2&gt;&lt;/div&gt;Here the idea is to make sure we have hidden formula on Embedded View (even such like 1 = 0) and use Refresh&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-7bDnsBIlEZw/VUVATN3wEJI/AAAAAAAAMPY/TxXPdmcWd64/s1600/embedded-view-hidden-formula.PNG&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;186&quot; src=&quot;http://1.bp.blogspot.com/-7bDnsBIlEZw/VUVATN3wEJI/AAAAAAAAMPY/TxXPdmcWd64/s320/embedded-view-hidden-formula.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt; &lt;/div&gt;And here is code examples&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;  Call ws.ViewRefresh&lt;br /&gt;  Call uidoc.RefreshHideFormulas&lt;br /&gt;  Call ws.ViewRefresh&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Please have a look on these 2 articles that inspired me: &lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://blog.aashq.nl/blog/blog.nsf/dx/22-02-2010094254FVEC8V.htm?opendocument&amp;amp;comments&quot; rel=&quot;&quot; target=&quot;_blank&quot;&gt;Refreshing an embedded view&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://ypastov.blogspot.dk/2013/01/how-to-refresh-notesuidocument-from.html&quot; target=&quot;_blank&quot;&gt;How to refresh NotesUIDocument from categorized embedded view&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</description><link>http://dpastov.blogspot.com/2015/05/refresh-embedded-view.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-7bDnsBIlEZw/VUVATN3wEJI/AAAAAAAAMPY/TxXPdmcWd64/s72-c/embedded-view-hidden-formula.PNG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-1075489168786992443</guid><pubDate>Mon, 05 Jan 2015 08:00:00 +0000</pubDate><atom:updated>2015-01-05T09:00:02.021+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">SEO</category><title>Find Orphan pages on website</title><description>You have a website and want to be sure that there are no &lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Orphan&quot;&gt;Orphan pages&lt;/a&gt;? Not sure how to develop it? If so - you found a right place to go :), let&#39;s talk about most important steps. &lt;br /&gt;I assume you have a list of all pages you want to verify (otherwise - it will be your first task) &lt;br /&gt;&lt;br /&gt;Here is a logic/snippets &lt;br /&gt;&lt;ol&gt;&lt;li&gt;We need functionality that can extract HTML from a web page. Later we will scan it and get internal links. &lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private String getPageContent(String pageurl) throws Exception {&lt;br /&gt;   StringBuffer buf = new StringBuffer();&lt;br /&gt;   URL url = new URL(pageurl);&lt;br /&gt;   InputStream is = url.openConnection().getInputStream();&lt;br /&gt;   BufferedReader reader = new BufferedReader( new InputStreamReader( is )  );&lt;br /&gt;   String line = null;&lt;br /&gt;   while( ( line = reader.readLine() ) != null )  {&lt;br /&gt;      buf.append(line);&lt;br /&gt;   }&lt;br /&gt;   reader.close();  &lt;br /&gt;   return buf.toString();&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Make a logic that can deal with DOM. I use &lt;a href=&quot;http://jsoup.org/&quot; title=&quot;Java HTML Parser&quot;&gt;jsoup&lt;/a&gt; to manipulate with HTML and I really recommend it (easy and fast). The method below select all links that begin with baseurl (it&#39;s domain of your website), in that way we can cut all external links and get only internal links. &lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private List&amp;lt;string&amp;gt; getAllInernalLinks(String html, String baseurl) throws Exception {&lt;br /&gt;   List&amp;lt;string&amp;gt; res = new ArrayList&amp;lt;string&amp;gt;();&lt;br /&gt;   String select = &quot;a[href^=&quot;+baseurl+&quot;]&quot;;&lt;br /&gt;   org.jsoup.nodes.Document dom = Jsoup.parse(html);&lt;br /&gt;   Elements links = dom.select(select);&lt;br /&gt;&lt;br /&gt;   for (Element link : links) {&lt;br /&gt;      String src = link.attr(&quot;href&quot;);&lt;br /&gt;      res.add(src);&lt;br /&gt;   }&lt;br /&gt;   return res;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Now we must build a List with all internal links from all pages on your website. &lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;String List&amp;lt;string&amp;gt; alllinks = getAllInernalLinks(html_from_all_pages, baseurl);&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt; &lt;li&gt;We need to make sure that pageurl can be found in alllinks more then in pagelinks (to avoid case when page has link to itself). &lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private boolean isOrphan(List&amp;lt;string&amp;gt; pagelinks, List&amp;lt;string&amp;gt; alllinks, String url) throws Exception {&lt;br /&gt;   if (Collections.frequency(alllinks, url) &amp;gt; Collections.frequency(pagelinks, url)) {&lt;br /&gt;      return false;&lt;br /&gt;   }&lt;br /&gt;   return true;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;</description><link>http://dpastov.blogspot.com/2015/01/find-orphan-pages-on-website.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-2018532976720519239</guid><pubDate>Tue, 28 Oct 2014 23:24:00 +0000</pubDate><atom:updated>2014-10-29T00:29:00.091+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Drupal</category><title>Formatting a URL link in Drupal using function l</title><description>Another nice function in Drupal. It&#39;s called &lt;a href=&quot;https://api.drupal.org/api/drupal/includes%21common.inc/function/l/7&quot;&gt;function l&lt;/a&gt;.&lt;br /&gt;It formats a URL link as an HTML anchor tag.&lt;br /&gt;I know it looks really easy and simple, it&#39;s just nice to use it after doing that manually many times.&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;$option = array();&lt;br /&gt;$option[&#39;attributes&#39;] = array(&#39;title&#39; =&amp;gt; $label);&lt;br /&gt;l($label_trimmed, $uri[&#39;path&#39;], $option));// will output [a href=&quot;$uri-path&quot; title=&quot;$label&quot;&amp;gt;[/a]&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2014/10/formats-url-link-drupal-function-l.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-638218314593095606</guid><pubDate>Tue, 28 Oct 2014 13:37:00 +0000</pubDate><atom:updated>2014-10-29T00:29:30.004+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Drupal</category><title>Truncating a string on a word boundary in Drupal</title><description>Typical task: &quot;truncate a string only on a word boundary and add a some postfix to resulting string&quot;. Every developer did it many times, I&#39;m sure. Here is a how Drupal solves it with it&#39;s api: &lt;a href=&quot;https://api.drupal.org/api/views/views.module/function/views_trim_text/7&quot; target=&quot;_blank&quot; title=&quot;Truncating a string on a word boundar using Drupal api&quot;&gt;function views_trim_text&lt;/a&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;define(MAX_LENGTH, 30);&lt;br /&gt;&lt;br /&gt;$alter = array(&lt;br /&gt;    &#39;max_length&#39; =&amp;gt; MAX_LENGTH,&lt;br /&gt;    &#39;word_boundary&#39; =&amp;gt; TRUE,&lt;br /&gt;    &#39;ellipsis&#39; =&amp;gt; TRUE&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;$mystring = &quot;truncate a string only on a word boundary and add a some postfix to resulting string&quot;;&lt;br /&gt;$mystring = views_trim_text($alter, $mystring); //result is &#39;truncate a string only on a...&#39;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://dpastov.blogspot.com/2014/10/truncating-string-on-word-boundary-in-drupal-view-trim-text.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34728599.post-7101861111721343507</guid><pubDate>Mon, 08 Sep 2014 07:00:00 +0000</pubDate><atom:updated>2016-01-04T23:31:52.133+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Issues when importing WSDL files into Web Service Consumer</title><description>Recently I faced up with WSDL which I couldn&#39;t import into Web Service Consumer. Our consumer worked well from last 5 years but it is a long period and during that time our Service Provider was updated a lot so we decided to update our Consumer as well. Guess everything went fine? &lt;br /&gt;&lt;h5&gt;No WSDL was returned from the URL&lt;/h5&gt;I simply created new Consumer in Domino Designer, set URL to our WSDL, picked Java and clicked OK. Oops... &lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;---------------------------&lt;br /&gt;Domino Designer&lt;br /&gt;---------------------------&lt;br /&gt;No WSDL was returned from the URL:&lt;br /&gt;https://api.ourserver.com/secure/api1/WebService?WSDL&lt;br /&gt;---------------------------&lt;br /&gt;OK&lt;br /&gt;---------------------------&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h5&gt;The requested operation failed: no import files&lt;/h5&gt;Wow, thought I :) let&#39;s try to import WSDL as Lotus Script then (just to see if it is not related to Java)&lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;---------------------------&lt;br /&gt;IBM Domino Designer&lt;br /&gt;---------------------------&lt;br /&gt;The requested operation failed: no import files&lt;br /&gt;---------------------------&lt;br /&gt;OK   &lt;br /&gt;---------------------------&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h5&gt;Name too long&lt;/h5&gt;Hey, what? This WSDL is used by many another applications without any issues, what is going on!? I downloaded WSDL as file to my local PC and tried to import it as Lotus Script again. This time it went fine (except issues with Name too long). Well, great news anyway, at least everything works when WSDL is a local file.&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-gvMplMqwaL8/VAxNm-A9VAI/AAAAAAAAMEI/7Y_XzVdaPF8/s1600/name-to-long.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-gvMplMqwaL8/VAxNm-A9VAI/AAAAAAAAMEI/7Y_XzVdaPF8/s1600/name-to-long.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5&gt;The Web Service implementation code generated from the provided WSDL could not be compiled, so no design element was created&lt;/h5&gt;&lt;div&gt;Ok, it worked for Lotus Script, let&#39;s set now Java...&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;---------------------------&lt;br /&gt;IBM Domino Designer&lt;br /&gt;---------------------------&lt;br /&gt;The Web Service implementation code generated from the provided WSDL could not be compiled, so no design element was created.  Please correct the WSDL and try again.  The errors are located in the following file:: C:\Users\dpa\AppData\Local\Temp\notes90C43B\47238811.err&lt;br /&gt;---------------------------&lt;br /&gt;OK   &lt;br /&gt;---------------------------&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;OK, it&#39;s time to blame Designer and IBM! Why it is so difficult just to import WSDL? All another application that use WSDL from our server did not have such issues. It&#39;s just not fair :). Found a file with error and quite typical line: java.lang.OutOfMemoryError: Java heap space. I knew what to do, I increased HTTPJVMMaxHeapSize and JavaMaxHeapSize to 512M, restarted Designer/Notes and tried again. Worked well! I restored original values to HTTPJVMMaxHeapSize and JavaMaxHeapSize after that.  &lt;br /&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 97%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;The system is out of resources.&lt;br /&gt;Consult the following stack trace for details.&lt;br /&gt;java.lang.OutOfMemoryError: Java heap space&lt;br /&gt;at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:151)&lt;br /&gt;at com.sun.tools.javac.util.Position.makeLineMap(Position.java:75)&lt;br /&gt;at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1117)&lt;br /&gt;at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:524)&lt;br /&gt;at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:562)&lt;br /&gt;at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:816)&lt;br /&gt;at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:739)&lt;br /&gt;at com.sun.tools.javac.main.Main.compile(Main.java:365)&lt;br /&gt;at com.sun.tools.javac.main.Main.compile(Main.java:291)&lt;br /&gt;at com.sun.tools.javac.main.Main.compile(Main.java:282)&lt;br /&gt;at com.sun.tools.javac.Main.compile(Main.java:99)&lt;br /&gt;at lotus.notes.internal.IDEHelper.compile(Unknown Source)&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;Simple thing however it costed few hours for me. Hope it will save some time for other people.</description><link>http://dpastov.blogspot.com/2014/09/issues-import-wsdl-files-domino-designer.html</link><author>[email protected] (Dmytro Pastovenskyi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-gvMplMqwaL8/VAxNm-A9VAI/AAAAAAAAMEI/7Y_XzVdaPF8/s72-c/name-to-long.PNG" height="72" width="72"/><thr:total>3</thr:total><georss:featurename>Christianshavn, Copenhagen, Denmark</georss:featurename><georss:point>55.670590626865739 12.583379745483398</georss:point><georss:box>55.668352126865742 12.578337245483398 55.672829126865736 12.588422245483398</georss:box></item></channel></rss>
Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda