Wednesday, October 28, 2020

Setup Windows Terminal with PowerLine

Windows Terminal is a terminal application that aggregates several shells, like Command Prompt, Powershell and Windows Subsystem for Linux (WSL)

Windows Terminal. Image credits to Microsoft.


It features:
  • multiple tabs
  • panes
  • Unicode and UTF-8 character support
  • a GPU accelerated text rendering engine
  • themes (or use customized themes by you)
  • customize text, colors, backgrounds, and shortcuts

It's very flexible and very configurable.

On top of Windows Terminal, we can have Powerline for a pretty prompt. Microsoft has the tutorial that explains how to setup Powerline, which includes integration with GIT, with Posh-Git and Oh-My-Posh.
Windows Terminal Powershell with Powerline. Image credits to Microsoft.

Isn't this nice?

Monday, October 28, 2019

Learn to code for kids with Scratch

Scratch is a free programming language and online community, developed by MIT, for learning to code in a very simple way.
It's designed in a way that allows kids to understand how to build their own games or just create animations or interactive stories, using interlocking blocks to represent coding concepts.

Image source: ICTEDUMAG
There is also Scratch Junior, for kids from 5 to 7 years old, with blocks without words, just with symbols that the kids can associate with the coding concept.

It's fun and simple. Try it!

Google's Blocky

Scratch is a result of a collaboration between Google and MIT, and builds on Google’s Blockly technology. Blocky is a JavaScript library for building visual programming editors. It outputs syntactically correct code in the programming language of your choice.

Friday, July 26, 2019

Create 2D games in LUA and LÖVE framework


LUA is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
The best of all, it's open-source and free.

With LUA, you mark blocks of code using the syntax do and end, instead of using braces. It has about 20 reserved keywords.

image source: Admin Magazine


With LUA and the LÖVE framework, you can create some cool 2D Games.
The LÖVE framework is very simple. Just check out these code snippets:

Drawing text

function love.draw()
love.graphics.print("Hello World!", 400, 300)
end


Drawing an image

function love.load()
whale = love.graphics.newImage("whale.png")
end

function love.draw()
love.graphics.draw(whale, 300, 200)
end


Playing a sound

function love.load()
sound = love.audio.newSource("music.ogg", "stream")
love.audio.play(sound)
end


More tutorials can be found in the LÖVE wiki.

Thursday, October 18, 2018

Web Summit 2018 workshops

The schedule for the workshops is now available at the Partners Workshop site! Let's find some interesting workshops to attend...

workshops
Workshops!

Monday, October 1, 2018

Web Summit 2018 Lisbon

From 5 to 8 November 2018, Lisbon, Portugal, will be hosting Web Summit for the 3rd time. It's just the largest tech conference in the world. Web Summit is hosting 23 independent conferences under one roof

I went to Web Summit 2017 (me plus 59 114 people), and I can say that I loved every piece of it. For the conferences, for the invited speakers, for the news about innovation...

Feeling lost about Web Summit? I'll give you some hints...

1. Where is my ticket?
Your ticket is at the Web Summit app. Please enter your code in the app, that code that was given to you when you bought the ticket. In the Pre-Registration venue, please show your QR Code app with your government issued photo ID. A bracelet will be given to you - this bracelet is the ticket that lets you enter the Web Summit campus, so do not remove it!!

2. Where can I Pre-Register?
You can beat that long queues at the main entrance of the event for the Registration, before Web Summit begins. Just do the Pre-Registration in the Lisbon Airport (Terminal 1) at the following days/times:

Airport registration times:
Saturday – November 3 – 10am to 11:00pm
Sunday – November 4 – 7am to 11:00pm
Monday – November 5 – 7am to 11:00pm
Tuesday – November 6 – 7am to 3:00pm

Venue registration times:
Monday – November 5 – 12pm to 8pm
Tuesday – November 6 – 9am to 5pm
Wednesday – November 7 – 9am to 5pm
Thursday – November 8 – 9am to 5pm

Pre-Registration location at the Venue:
FIL – Feira Internacional de Lisboa
Alameda dos Oceanos
Lisboa
Portugal
Venue map

3. Plan the conferences schedule
Just plan ahead what you pretend to see in the Web Summit. There will be multiple conferences at the same time, so you must choose which one you will see, or you will be feeling lost. Check for the schedule in the app and mark there which conferences most interests you, or online in the Web Summit Schedule page.

For the Opening Night, on the 5th November, it will be needed a special registration to attend it in the Center Stage. Just look out forward for the news about it.

Monday, February 12, 2018

Presearch: Decentralized Search Engine

Presearch is an open, decentralized search engine, powered by the community, that rewards community members with Presearch Tokens for their usage, contribution to, and promotion of the platform.

Watch the intro video for Presearch:

Nebulas: Decentralized Search Framework

Nebulas is a decentralized search framework that allows to search for Blockchain Data. It empowers you to create your first Blockchain Search Engine.

Nebulas decentralized search network
Nebulas

Monday, January 29, 2018

Top websites to earn Steem coins

Cryptocurrency is a trend in nowadays and there are platforms that allow you to create contents and earn Steem, a digital cryptocurrency like Bitcoin, based on the blockchain technology.

Here are some websites where you can earn free Steem:

Steemit.com and Busy.org are both blogging and decentralized social network media platforms, based on the blockchain technology. These two are comparable to trains, that ride the same railroad (the steem blockchain). Steemit is the first, the old train, while Busy is the new fast train. Basically, the difference is the interface and some features, like the "wallet" that has more info in Busy than in Steemit, the post Editor that allows to create nice posts in Busy, Steemit has a night mode... The content that you create on Steemit also appears in Busy and vice-versa. Here you can earn by creating contents (blog posting), and upvoting other blog posts (aka curation). Just like Facebook or Reddit, but paid to you.
Then there are some bots for allowing your posts to be upvoted, in trade of a small donation, like the @minnowbooster.
The @originalworks bot can be called from any comment, for the declaration of original work and earn some upvotes. This one is free.

SteemAuto is an automated platform for scheduling posts, automated wallet claimings rewards and automated vote for your favorite author.


SteemitChat is a dedicated steemit chat.

Zappl claims to be the "Twitter of Steemit"

Steepshot is the blockchain-powered censorship-resistant app that you can use to share cool pictures with your friends, curate and comment their photos and get crypto rewards for your activity.

Steemit Worldmap finds and shares blog posts with others from all over the world. To add your post to this map, add the following to the post (replace the coordinates):
[//]:# (!steemitworldmap 3.903346 lat 73.357944 long  d3scr)

Steemspot allows you to discover other steemians around the world

Dmania is the decentralized 9GAG for Steem. Make money by posting, commenting and upvoting their favourite memes, funny pictures and videos.

DecentMemes allows you to create memes and post it directly to steem platform.

Dtube is the decentralized Youtube for Steem. Here you earn by share, upvote and posting videos.

Utopian.io is the platform where open source contributions are getting paid, also using the steem blockchain technology

Dlive.io well, the name says it all... for watching/publishing live streems integrated with steem  platform.

DSound allows you to upload, listen and discover music stored on top of the IPFS Network. It uses STEEM blockchain as a decentralized database, so you can earn Steem from it, by upvoting or posting or reposting contents.

More info...

  • The Steem blue paper, can be found in Steem.io
  • The Block Explorer can be found in Steemd.com. Here, if the url is used as https://steemd.com/@yourUserName, you will find details about your user account, such as the Voting Power.
  • The Steem Developer Portal can be found in Developers.steem.io
  • SteemTools lists the steem related apps
  • Steem.supply tracks account value and the next payouts.
  • SteemReports reports about the steem blockchain
  • SteemViz watch the blockchain live
  • SteemViz Pending Payout to check pending payouts
  • Rating for ratrings about users, posts, etc. Usage: http://rating.mysteemit.xyz/en/steem/@yourUserName
  • Slider for showing your posts in a slider
  • SteemVoter bot for automatic voting







Monday, January 8, 2018

Solving "JPA Project Change Event Handler (waiting)" annoying message from Eclipse

I'm using Eclipse Oxygen IDE and I'm always getting this annoying message "JPA Project Change Event Handler (waiting)" after saving a file, but I'm not using JPA in my project.

I tried to turn off the JPA validators under Preferences, with no success and the message kept appearing. Now I've found out that the guilty for the message appearing is the Dali/JPT plugin.
Since I do not need this plugin, I uninstalled it from the "Preferences" > "Install/Update"> then click again in the "Uninstall or update" link under that tab and finally I've selected, from the "Installed Software", the "Dali Java Persistence Tools - JPA Support" entry. Then I uninstallled it.

Problem solved!

Monday, November 20, 2017

Solving SLF4J: Class path contains multiple SLF4J bindings.

Problem:
While running unit tests, if you ever find these warnings, logged with INFO...

SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/C:/apache-maven-3.3.3/mvn.release.repo/org/slf4j/slf4j-log4j12/1.7.2/slf4j-log4j12-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/C:/apache-maven-3.3.3/mvn.release.repo/org/slf4j/slf4j-nop/1.7.2/slf4j-nop-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

The solution for fixing this is....
Use the maven surefire plugin to exclude the org.slf4j:slf4j-log4j12 usage during tests (slf4j-nop-1.7.2 is only used during tests)

pom.xml extract:

<build>
  <plugins>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
              <classpathDependencyExcludes>
                 <classpathDependencyExcludes> org.slf4j:slf4j-log4j12 </classpathDependencyExcludes>
              </classpathDependencyExcludes>
   </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>    <dependency>         <groupId>org.slf4j</groupId>         <artifactId>slf4j-api</artifactId>     </dependency>     <dependency>         <groupId>org.slf4j</groupId>         <artifactId>slf4j-nop</artifactId>         <version>1.7.2</version>         <scope>test</scope>     </dependency>   <dependency>

Friday, November 17, 2017

Java Unit Test Frameworks

I love writting unit tests for my code. It makes it easy to test code that is very hard to test in a running system, just for checking the behavior of certain implementations. Besides that, is useful when trying to refactor some code, so we can assure that the behavior is not broken.
Well, I'll show you the java unit test frameworks that I currently use...

Junit



The JUnit Platform serves as a foundation for launching testing frameworks on the JVM
JUnit 5 user guide is available as documentation.

Nice features:
Parameterized tests make it possible to run a test multiple times with different arguments.
Supports annotations.

E.g.
import org.junit.*;

public class TestXXX {
    @BeforeClass
    public static void setUpClass() throws Exception {
        // Code executed before the first test method
    }

    @Before
    public void setUp() throws Exception {
        // Code executed before each test
    }
    @Test
    public void testOneThing() {
        // Code that tests one thing
    }
    @After
    public void tearDown() throws Exception {
        // Code executed after each test 
    }
 
    @AfterClass
    public static void tearDownClass() throws Exception {
        // Code executed after the last test method 
    }
}

EasyMock



EasyMock provides dynamically generated Mock objects (at runtime), without having to implement them.
Can be used in conjunction with Junit.

E.g.
public class XXXTest extends TestCase {

    public void tesComputeValue(){
        ClassUnderTest testObject = new ClassUnderTest();
        ClassToMock mock = EasyMock.createMock(ClassToMock.class);
        EasyMock.expect(mock.getSomething()).andReturn("Hello");
        EasyMock.replay(mock);
        assertEquals("Hello", testObject.saySomething(mock));
    }
}

PowerMock


PowerMock is an extension to both Mockito and EasyMock that allows mocking of static methods, constructors, final classes and methods, private methods, removal of static initializers and more.
Allows the usage of the beneficts of PowerMock and the usage of Mockito to setup and verify expectations by using PowerMockito.

E.g.
@RunWith(PowerMockRunner.class)
@PrepareForTest(ClassUnderTest.class)
public class XXXTest {
 
  private ClassToMock mock;
  private ClassUnderTest testObject;

  @Test
  public void tesComputeValue() {
    mock = PowerMockito.mock(ClassToMock.class);
    PowerMockito.when(mock.getSomething()).thenReturn("Hello");
    testObject = new ClassUnderTest(mockUserService);
    assertEquals("Hello", testObject.saySomething());
  }
}

Mockito


Mockito allows to verify the behavior of the system under test without establishing expectations beforehand, attempting to eliminate the expect-run-verify pattern, so the coupling is minimized.
Can be used in conjunction with Junit.

E.g.
public class XXXTest {
   
  private ClassToMock mock;
  private ClassUnderTest testObject;
   
   @Before
   public void setUp() {
      mock = mock(ClassToMock.class);
      testObject = new ClassUnderTest(mock);
   }
   
   @Test
   public void testComputeValue() throws Exception {
      when(mock.getSomething(any(String.class))).thenReturn("Hello");
      testObject.saySomething();
      verify(mock).getSomething(any(String.class));
   }
}

Nice features:
Can define the behavior of the same method call to produce different results, in the same test.

More...

More java unit tests frameworks can be found in this wikipedia listing.


Monday, November 14, 2016

OCA/OCP Java 8 Programmer Study Guide

Exam 1Z0-808: OCA Java SE 8 Programmer I
Duration: 150 minutes
Number of Questions: 77
Passing Score: 65%

Resources:
Exam Topics, Oracle
Sample Questions, Oracle

Exam 1Z0-809: OCP Java SE 8 Programmer II
Duration: 150 minutes
Number of Questions: 85
Passing Score: 65%
Exam Topics, Oracle
Sample Questions, Oracle

Resources:
Online Book "Java 8 Programmer II Study Guide", Esteban Herrera

Exam 1Z0-810: Upgrade to Java SE 8 OCP from Java SE 7 OCP
Duration: 150
Number of Questions: 81
Passing Score: 65%
Exam Topics, Oracle
Sample Questions, Oracle

Resources:
Mikalai Zaikin Upgrade Guide
Notes for 1Z0-810

Exam 1Z0-813: Upgrade to Java SE 8 OCP ( Java SE 6 and all prior versions)
Duration: 130 minutes
Number of Questions: 60
Passing Score: 63%
Exam Topics, Oracle
Sample Questions, Oracle

Java 8 Books:
Other Java 8 Resources:




Friday, February 13, 2015

ObjectAid UML Explorer for Eclipse

ObjectAid UML Explored for Eclipse is an Eclipse plugin to show the Java source code and libraries in live UML class and sequence diagrams, that automatically update as your code changes.


ObjectAid UML Explorer class diagram
ObjectAid UML Explorer, class diagram.

Monday, December 15, 2014

IntelliJ shortcuts


I'm using IDE IntelliJ for the first time. Until now, my favorite IDE is Eclipse. Why am I trying IntelliJ? Because everyone that uses it says that it is much better than Eclipse. So, I'm trying it to see for my self.

First of all, I've downloaded the IntelliJ Community Edition, and after running it and setting up my Project, I'm faced with a new challenge: so, what shortcuts should I use?

IntelliJ welcomes me with a few shortcut:

IntelliJ shortcuts


  • Search Everywhere with Double Shift
  • Open a file by name with Ctr + Shift + N
  • Open Recent Files with Ctrl + E
  • Open Naviagtion Bar with Alt + Home
  • Drag and Drop file(s) here from Explorer

(I' ll adding useful shortcuts as long as I discover them)

Which IDE do you prefer? Eclipse? IntelliJ? Some other? Why?

Monday, November 24, 2014

Wiki Markup language in Atlassian Crucible


Atlassian Crucible is a collaborative peer code review tool, where you can leave comments about reviews created based on some commited code.
It allows the development teams to catch major defects, improve code architecture, and discuss desired improvements, without the need for meetings. With FishEye, it lets you view the contents of your Source Code Management (SCM) repositories in your web browser.


And, it supports integration with Jira, which is a very important thing about these collaborative tools. Integration is the key for a better handling.


The Crucible documentation, the FishEye documentation and the Jira documentation can be found at the Atlassian Documentation page.

Did you know that you can use Wiki Markup in Crucible, just like for incorporating some code block in the comments? Check out this Crucible Help page about the Wiki Markup and learn how it can be used.

Tuesday, October 7, 2014

How to create an ico file?

How to create an ico/png file?

It's very easy! Just follow these tutorial steps.

  1. Go to  http://converticon.com
  2. Upload your gif, jpeg or png file and press the "Export" button.
  3. Select the Export options, like sizes and type of the file to be exported: ico or png.
  4. Press the "Save As" button.


That's it! No need to download any software to make the ico file!

How to create an ico
How to create an ico
Tips:
If the purpose of the ico file is to be used as a favicon, export it with the 16x16 option selected.
If you want to change the icon on a folder, export it with the 32x32 option.

As an alternative, you can use the http://iconverticons.com/ online tool.

Thursday, July 10, 2014

I'm an OCE JEE6 1Z0-895 Certified!

I've passed the exam for 1Z0-895 Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert with 83%!


My training materials were:

1. Enterprise JavaBeans 3.1 (the most recommended book, ignore JPA chapters, this is the Bible from where to learn all the exam topics, but it's incomplete concerning the deepness of needed knowledge - complete the knowledge from the EJB 3.1 specification!)
Andrew Lee Rubinger, Bill Burke
O'Reilly Media; Sixth Edition edition (September 24, 2010)

2. EJB 3 in Action (EJB 3.0, ignore JPA chapters, I don't remember what I learned from this book that I didn't learned with the O'Reilly book. Be aware that in version 3.0 there are no singletons, so this book does not mention it)
Debu Panda, Reza Rahman, Derek Lane
Manning Publications Co.; 1st Edition

3. Head First EJB (EJB 2.0, just for the basic concepts, like the EJB Roles and how to understand the "equals" between EJBs - ignore EJB 2.0 specific stuff)
Kathy Sierra, Bert Bates
O'Reilly


4. OCP JavaEE 6 EJB Developer Study Notes by Ivan A Krizsan (very complete! Read it! Learned the structure of an .ear and .jar from here and also the Exceptions tree structure for distinguishing between Application Exceptions and System Exceptions)

5. Frits Walraven OCPEJBD 6 EJB3.1 (a very good short study notes! I became aware of the "equals" questions between EJBs from here. If you know all the topics mentioned here, then you should be prepared for the exam)

6. JSR-000318 Enterprise JavaBeansTM 3.1 Final Release (The EJB 3.1 specification: it has all the needed information but it is really hard to read, but it must be read to complement the knowledge)

7. Interceptors 1.1 (The EJB 3.1 Interceptors specification: It's very quick to read!)

8. Enthuware 1Z0-895 exams (some questions are very similar to the real exam, really good software for practice! I was getting around 80% in this software and I got 83% in the real exam!)

After all this study, if you are passing in Enthuware exams, then you should pass on the real exam!
Good luck!