Walensee in St Gallen

The Walensee, also known as Lake Walen or Lake Walenstadt from Walenstadt, is one of the larger lakes in Switzerland, with about two thirds of its area in the Canton of St. Gallen and about one third in the Canton of Glarus. Other towns and villages at the lake include Weesen, Quinten, Quarten, and Murg.

The three main rivers leading to the lake are the Seez, Murgbach, and Linth. The last continues its course from Walensee to Lake Zurich. The Schnittlauchinsel, at the eastern end of the lake, is the only island in the Walensee.

The Churfirsten range raises steeply on the north side from the lake’s level at 419 m to 2,306 m above sea level. On the south, the lake is overlooked by the Mürtschenstock Massif, whose peak is 2,441 m above sea level. The highest point of the lake’s drainage basin is the Tödi (3,614 m).

2751 coins, 47 Consensus and 82 cryptographic algorithms

The innovation speed in Blockchain landscape is just breathtaking and being able to (or to be honest trying to…) follow all these rapid changes is a chance for all software engineers.

At the core of the Blockchain disruption are consensus algorithm:

Consensus algorithms enable network participants to agree on the contents of a blockchain in a distributed and trust-less manner.

And the consensus algorithm plays a crucial role in maintaining the safety and efficiency of blockchain. Using the right algorithm may bring a significant increase to the performance of blockchain application.

But do you know how much consensus type are out there? or where they are applied? my new Consensus Map may help you there exploring the always evolving landscape:

Here is the actual Consensus list: DPoR, DPoS, DPoS/LPoS, FBA, HPoW, LFT, Limited Confidence Proof-of-Activity, Ouroboros, POBh, PoA, PoB, PoB/PoS, PoC, PoI, PoP, PoP/PoV/PoQ, PoPP, PoR, PoS, PoS/LPoS, PoS/PoB, PoS/PoD, PoS/PoP, PoS/PoW, PoS/PoW/PoT, PoST, PoSign, PoW, PoW/DPoW, PoW/HiPoS, PoW/PoM/PoSII, PoW/PoS, PoW/PoS/PoC, PoW/PoSC, PoW/PoZ, PoW/nPoS, PoWT Proof of Believability, Proof of Existence, Proof of Ownership, Proof of Time, Scrypt-adaptive-N (ASIC resistant), TPoS, Tangle, dPoW/PoW, mFBA 

You can filter by any type of Consensus and zoom, learn more about them by hovering over the menu.

The map also feature a mode selector at the bottom, if you switch to Algorithm Map you’ll see where each of the 82 cryptographic algorithm are used!

The Map will be auto-magically regenerated every week on Sunday evening. The tedious task of maintaining the list of all Consensus algorithms (I’ve documented 60+ but only 47 are represented) and their descriptions are (still) maintained manually.

More filters will be added soon (showing for example only the top 100 by market cap, consensus by date of creation, and so on…), and your feedback is always welcomed.

Running WordPress and MySql in Docker

Notes

  • A Docker image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both #Linux and #Windows based apps, containerized software will always run the same, regardless of the environment. #Containers isolate software from its surroundings, for example differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.
  • A container is a runtime instance of an image—what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so. #Container are stateless and should be considered read only! (you can go inside the container change data, but at container creation your changes are lost)
  • Both MYSQL (Data, users) and WordPress (plugins, themes, uploads) are stateful, so we have to use #Docker volume to persist data across container restart.
  • expose: 3306 will let you connect later with MySQLWorbench to the port from outside of the container. it is optional.
  • depends_on tell #wordpress to wait till mysql db container is up
  • The always restart policy tells #Docker to restart the container under every circumstance. What’s great about the always restart policy is that even if our #Docker host was to crash on boot, the Docker service will restart our container.

We will be using the official #Wordpress image from Docker HUB But first let’s create a file uploads.ini to avoid issues later on while uploading plugins in wordpress.

file_uploads = On 
memory_limit = 256M 
upload_max_filesize = 256M 
post_max_size = 300M 
max_execution_time = 600 

Create a new file docker-compose.yml, adapt values to your liking, especially all passwords and username. Note that #MYSQL and #Worpress data are persisted OUTSIDE of container.

version: '2' 
services: 
 wordpress: 
	depends_on: 
	 - db 
	image: wordpress:latest 
	volumes: 
	 - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini 
	 - ./file-wordpress:/var/www/html 
	ports: 
	 - 80:80 
	 - 443:443 
	restart: always 
	environment: 
	  WORDPRESS_DB_HOST: db 
	  WORDPRESS_DB_USER: wordpress 
	  WORDPRESS_DB_PASSWORD: wordpress 
	  WORDPRESS_TABLE_PREFIX: abcd 
 db: 
	image: mysql:5.7 
	volumes: 
	 - ./db-wordpress:/var/lib/mysql 
	restart: always 
	expose: 
	 - "3306" 
	environment: 
	  MYSQL_ROOT_PASSWORD: wordpress 
	  MYSQL_DATABASE: wordpress 
	  MYSQL_USER: wordpress 
	  MYSQL_PASSWORD: wordpress

The docker-compose up command aggregates the output of each container. It Builds, (re)creates, starts, and attaches to containers for a service. When the command exits, all containers are stopped. Running docker-compose up -d starts the containers in the background and leaves them running. To start WordPress in the background

docker-compose up -d

To find the name of the container

docker ps -a

or

docker-compose ps

To read the logs file

docker logs wordpress docker logs db

To go inside the container (remember all changes in there are lost at container restart)

docker exec -it wordpress bash

To delete all volume

docker-compose  rm -v

Review: Getting Started with Apache Maven by Russell Gold

Some time ago I was asked if I would like to write a review about one of the new video courses from Packt Publishing. It was “Getting Started with Apache #Maven” http://bit.ly/1fycmpP by Russell Gold and since I have been using Maven for some years now (since 2007) and did publish some articles myself, I thought it would be nice to help them promote Apache #Maven.

The course is organized in eight chapters, forty videos with a length between two and five minutes, for a total length of two hours. The aim of the course is to provide the shortest path to use effectively Maven

You can download the course as a single zip file. After unpacking the file to a local hard disk you find a user guide, support information, a reference to the code examples and the video files. As you may notice I said “reference to the code examples”. Even if the name of the file “Code Bundle.zip” it contains only a file with the link to the source code on github.

Continue reading Review: Getting Started with Apache Maven by Russell Gold

Update Maven pom version on GIT checkout in TeamCity

Here is a solution to the following problems

  • Deriving #Maven artifact version from #GIT branch,
  • Update pom version on #GIT checkout automatically,
  • Add the ability to use Pull request with Apache #Maven.

You have a workflow requirement that require you to have the artifact version of a module externally defined from the current branch in #GIT.

For example

You want to start working on a new feature branch “feature-memory-improvement”, so you branch from master a new branch named feature/feature-memory-improvement

Having unique snapshot is a something you need to share your code using a #Maven repository, so you may want to have into the branch all pom.xml version changed to

<version>FEATURE-MEMORY-IMPROVEMENT-SNAPHOTS</version>

changing all your pom.xml and doing a technical commit  will create merge conflicts when using pull request!

One solution, while not perfect is to do the following:  You can add a separate execution to run a goal which will change the version of the POM automatically in the #Maven reactor. This small script will do it¨

Continue reading Update Maven pom version on GIT checkout in TeamCity

NEOGEO X GOLD ENTERTAINMENT SYSTEM

NEO GEO X GOLD ENTERTAINMENT SYSTEM Announced for Worldwide Distribution

Tommo Inc. sets release date and price for revolutionary gaming “system within a system”

Los Angeles, Calif. – August 13, 2012 – Tommo, Inc., in partnership with SNK PLAYMORE, today confirmed that the NEO GEO X GOLD entertainment system is scheduled for a worldwide release this December. Following the 20th anniversary of the ground breaking NEO GEO AES console, the NEO GEO X GOLD entertainment system provides players with all of the features of a home arcade and the convenience of a handheld gaming device. The NEO GEO X GOLD entertainment system is set for a worldwide release on December 6, 2012 for a suggested retail price of $199.99 (USD).

The NEO GEO X GOLD entertainment system comes complete with the NEO GEO X Station, the NEO GEO X Handheld with 20 pre-loaded NEO GEO classic titles, and the NEO GEO X Joystick. In addition to coming pre-loaded with 20 NEO GEO classic titles, the NEO GEO X Handheld device features a crisp 4.3″ LCD display, an expandable game card slot, internal stereo speakers, and a 3.5 mm headphone jack for a personal gaming experience you can take anywhere. The NEO GEO X Handheld device works with the NEO GEO X Joystick and NEO GEO X Station to charge the handheld device and transfer the action directly to a television set or monitor, via HDMI or A/V out, for a true arcade experience right at home.

PR_NGXG_Console_all

The full list of NEO GEO X Handheld pre-installed games is as follows:

  1. 3 COUNT BOUT
  2. LEAGUE BOWLING
  3. ART OF FIGHTING II
  4. MAGICIAN LORD
  5. ALPHA MISSION II
  6. METAL SLUG
  7. BASEBALL STARS II
  8. MUTATION NATION
  9. CYBER LIP
  10. NAM 1975
  11. FATAL FURY
  12. PUZZLED
  13. FATAL FURY SPECIAL
  14. REAL BOUT – FATAL FURY SPECIAL
  15. THE KING OF FIGHTERS ’95
  16. SAMURAI SHODOWN II
  17. KING OF THE MONSTERS
  18. SUPER SIDEKICKS
  19. LAST RESORT
  20. WORLD HEROES PERFECT

“Great game consoles don’t die; they’re just reborn in much more affordable and convenient packages,” said Tommo CEO Jonathan Wan. “The NEO GEO X GOLD is a love letter to one of my favorite consoles of all time, and working with SNK PLAYMORE to acquire the NEO GEO license, Tommo Inc. looks to provide gaming and entertainment enthusiasts with a classic arcade experience both at home and on the go.”

Distribution of the NEO GEO X GOLD entertainment system for European and Asian territories will be handled exclusively by BLAZE and Success Company. North American distribution of the NEO GEO X GOLD entertainment system will be handled exclusively by Tommo, Inc..

For the latest news as it is released, and for additional information regarding the NEO GEO X GOLD entertainment system, please visit: http://www.NEOGEOX.com.

About SNK PLAYMORE CORPORATION:

SNK PLAYMORE Logo

Headquartered in Osaka, Japan, SNK PLAYMORE CORPORATION (SNK) develops, publishes and distributes interactive entertainment software in Japan, North America, Europe and Asia. Founded in 1978, SNK is one of the largest privately held interactive entertainment content providers in the world.

Known for such franchises as THE KING OF FIGHTERS, METAL SLUG, and SAMURAI SHODOWN SNK continues to be an industry leader by focusing on their rich arcade history. More information on SNK PLAYMORE CORPORATION can be found at http://www.snkplaymore.co.jp SNK PLAYMORE USA is a wholly owned subsidiary of SNK PLAYMORE CORPORATION.

About Tommo, Inc.:

tommo logo

With over 20 years of experience in logistics and sales, a knowledgeable staff and sales representatives available nationwide, Tommo Inc. is one of North America’s largest distributors of video gaming merchandises. Founded in 1989, Tommo has grown from a wholesaler of imported video games to becoming one of the nation’s main suppliers of video gaming content to national retail chain stores as well as independent retailers.

About BLAZE:
Founded by Jason Cooper over 20 years ago, BLAZE now specializes in the creation and distribution of retro gaming devices. BLAZE currently distribute SEGA and ATARI branded consoles and, in Q1 2012, are set to release the “Game gadget” games console, billed as the “iPod for games”

About Success Company:
Based in Hong Kong, Success Company are specialists in the distribution of all video games formats throughout the Asian region.

© SNK PLAYMORE “NEO GEO” is a registered trademark of SNK PLAYMORE CORPORATION. Used under license from SNK PLAYMORE USA CORPORATION.

Apache M2Eclipse: Get rid of Duplicate resources when opening resources and types

In this small post, I’ll show you how to remove duplicated resources in the Open Resource view of #Eclipse

Eclipse – M2Eclipse – Subversive

Continue reading Apache M2Eclipse: Get rid of Duplicate resources when opening resources and types

Apache Maven Cargo deploy with Tomcat 7

Following the post about Deploy to Tomcat 6 using #Maven, here is a ready to use example with the main differences explained in the table below

 Tomcat 7Tomcat 6
containerId<containerId>tomcat7x</containerId><containerId>tomcat6x</containerId>
Url of Tomcat manager<cargo.remote.uri><cargo.tomcat.manager.url>
examplehttp://host..com/manager/text/http://host..com/manager/
tomcat-users.xml

<tomcat-users>
<role rolename=”manager-gui”/>
<role rolename=”manager-script”/>
<role rolename=”manager-jmx”/>
<role rolename=”manager-status”/>
<user username=”admin” password=”admin” roles=”manager-gui,manager-script”/>
</tomcat-users>

<tomcat-users>
  <role rolename=”manager”/>
  <user username=”admin” password=”admin” roles=”manager”/>
</tomcat-users>

And finally a snippet of an Apache #Maven pom.xml ready to use in a profile, so you can reuse this profile like a method call

<profile>
    <id>deployTomcat</id>
    <activation>
        <activeByDefault>false</activeByDefault>
    </activation>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.1.0</version>
                <configuration>
                    <wait>true</wait>
                    <container>
                        <containerId>tomcat7x</containerId>
                        <type>remote</type>
                    </container>
                    <configuration>
                        <type>runtime</type>
                        <properties>
                            <cargo.remote.uri>${tomcat.url}</cargo.remote.uri>
                            <cargo.remote.username>${tomcat.user}</cargo.remote.username>
                            <cargo.remote.password>${tomcat.pwd}</cargo.remote.password>
                        </properties>
                    </configuration>
                    <deployer>
                        <type>remote</type>
                        <deployables>
                            <deployable>
                                <groupId>${deploy.groupid}</groupId>
                                <artifactId>${deploy.artifactid}</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>${deploy.context}</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </deployer>
                </configuration>
                <executions>
                    <execution>
                        <id>verify-deploy</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deployer-undeploy</goal>
                            <goal>deployer-deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

Place as many profiles as you have machine to deploy in settings.xml and declare some variables as properties, as shown below:

<profile>
    <id>serverA</id>
    <activation>
        <activeByDefault>false</activeByDefault>
    </activation>
    <properties>
        <tomcat.url>http://host.com/manager/text</tomcat.url>
        <tomcat.user>admin</tomcat.user>
        <tomcat.pwd>admin
        </tomcat.pwd> 
        <!-- these properties must be defined as system property or -D --> 
        <!-- - deployable.artifactid: artifactId of web application to be deployed --> 
        <!-- - deployable.context: web context name -->
    </properties>
</profile>

So you can run, and target multiple host by just exchanging the name of the profile serverA to something else.

mvn integration-test –PdeployTomcat,serverA –Ddeployable.artifactid=demo -Ddeploy.groupid=com.mycompany –Ddeployable.context=showcase

Behavior Driven Development with JBehave and Apache Maven

I won’t explain you how to write any JBehave tests as the online documentation is more than complete.

I prefer to show you how to make them run in eclipse, and in Apache #Maven as the example were not easy to run (scenario are wrongly in src/main/java).

JBehave is a framework for Behaviour-Driven Development
Behaviour-driven development (BDD) is an evolution of test-driven development (TDD) and acceptance-test driven design, and is intended to make these practices more accessible and intuitive to newcomers and experts alike.
It shifts the vocabulary from being test-based to behaviour-based, and positions itself as a design philosophy.
You can find out more about behaviour-driven development on the BDD wiki, or in the article Introducing BDD

Features of JBehave include:

  • Pure #Java implementation, which plays well with #Java-based enterprises.
  • Users can specify and run text-based user stories, which allows “out-in” development.
  • Annotation-based binding of textual steps to #Java methods, with auto-conversion of string arguments to any parameter type (including generic types) via custom parameter converters.
  • Annotation-based configuration and Steps class specifications
  • Dependency Injection support allowing both configuration and Steps instances composed via your favourite container (Guice, PicoContainer, Spring).
  • Extensible story reporting: outputs stories executed in different human-readable file-based formats (HTML, TXT, XML). Fully style-able view.
  • Auto-generation of pending steps so the build is not broken by a missing step, but has option to configure breaking build for pending steps.
  • Localisation of user stories, allowing them to be written in any language.
  • IDE integration: stories can be run as JUnit tests or other annotation-based unit test frameworks, providing easy integration with your favourite IDE.
  • Ant integration: allows stories to be run via Ant task
  • Maven integration: allows stories to be run via #Maven plugin at given build phase

To make the online sample run easily without having to check out the whole tree of JBehave, I will show you that by slightly altering the pom.xml of a sample (Trader), you can run them against a fix version of JBehave.

The whole pom.xml

<profiles>
    <profile>jbehave
        <activation>
            <activebydefault>false</activebydefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupid>org.apache.maven.plugins</groupid>
                    <artifactid>maven-dependency-plugin</artifactid>
                    <executions>
                        <execution>unpack-jbehave-site-resources                     
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>unpack</goal>
                            </goals>
                            <configuration>
                                <overwritereleases>false</overwritereleases>
                                <overwritesnapshots>true</overwritesnapshots>
                                <artifactitems>
                                    <artifactitem>
                                        <groupid>org.jbehave.site</groupid>
                                        <artifactid>jbehave-site-resources</artifactid>
                                        <version>2.0.2</version>
                                        <outputdirectory>${project.build.directory}/jbehave-reports/rendered
                                        </outputdirectory>
                                    </artifactitem>
                                </artifactitems>
                            </configuration>
                        </execution>
                        <execution>unpack-jbehave-reports-resources                     
                            <phase>generate-resources
                        </phase>
                            <goals>
                                <goal>unpack</goal>
                            </goals>
                            <configuration>
                                <overwritereleases>false</overwritereleases>
                                <overwritesnapshots>true</overwritesnapshots>
                                <artifactitems>
                                    <artifactitem>
                                        <groupid>org.jbehave</groupid>
                                        <artifactid>jbehave-core</artifactid>
                                        <version>${jbehave.version}</version>
                                        <outputdirectory>${project.build.directory}/jbehave-reports/rendered
                                        </outputdirectory>
                                        <includes>**\/*.css,**\/*.ftl,**\/*.js</includes>
                                    </artifactitem>
                                </artifactitems>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupid>org.jbehave</groupid>
                    <artifactid>jbehave-maven-plugin</artifactid>
                    <version>${jbehave.version}</version>
                    <executions>
                        <execution>run-scenarios-found                     
                            <phase>integration-test</phase>
                            <configuration>
                                <scenarioincludes>
                                    <scenarioinclude>**/scenarios/*.java</scenarioinclude>
                                </scenarioincludes>
                                <scenarioexcludes>
                                    <scenarioexclude>**/i18n/scenarios/*.java</scenarioexclude>
                                </scenarioexcludes>
                                <batch>false</batch>
                                <ignorefailure>true</ignorefailure>
                                <classloaderinjected>false</classloaderinjected>
                                <scope>test</scope>
                            </configuration>
                            <goals>
                                <goal>run-scenarios</goal>
                            </goals>
                        </execution>
                        <execution>run-i18n-scenarios-found                     
                            <phase>integration-test</phase>
                            <configuration>
                                <scenarioincludes>
                                    <scenarioinclude>**/i18n/scenarios/*.java</scenarioinclude>
                                </scenarioincludes>
                                <skip>false</skip>
                                <classloaderinjected>true</classloaderinjected>
                                <scope>test</scope>
                            </configuration>
                            <goals>
                                <goal>run-scenarios</goal>
                            </goals>
                        </execution>
                        <execution>stepdoc                     
                            <phase>integration-test</phase>
                            <configuration>
                                <scenarioincludes>
                                    <scenarioinclude>**/scenarios/*.java</scenarioinclude>
                                </scenarioincludes>
                                <scenarioexcludes>
                                    <scenarioexclude>**/scenarios/None.java</scenarioexclude>
                                </scenarioexcludes>
                                <skip>false</skip>
                                <scope>test</scope>
                                <classloaderinjected>false</classloaderinjected>
                            </configuration>
                            <goals>
                                <goal>stepdoc</goal>
                            </goals>
                        </execution>
                        <execution>render-reports-generated                     
                            <phase>post-integration-test</phase>
                            <configuration>
                                <formats>
                                    <format>txt</format>
                                    <format>html</format>
                                    <format>xml</format>
                                </formats>
                                <scope>test</scope>
                                <ignorefailure>true</ignorefailure>
                            </configuration>
                            <goals>
                                <goal>render-reports</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
        <reporting>
            <excludedefaults>true</excludedefaults>
            <plugins>
                <plugin>
                    <groupid>org.jbehave</groupid>
                    <artifactid>jbehave-maven-plugin</artifactid>
                    <version>${jbehave.version}</version>
                    <configuration></configuration>
                    <reportsets>
                        <reportset>
                            <reports>
                                <report>render-reports</report>
                            </reports>
                        </reportset>
                    </reportsets>
                </plugin>
            </plugins>
        </reporting>
    </profile>
</profiles>