15 novembro 2018

OpenLiberty.io to Java EE Microservices


OpenLiberty.io is completely open source and, in their own words, is used to build cloud-native apps and microservices while running only what you need. At the moment, it provides a full Java EE 7 stack complemented with the mighty MicroProfile. Java EE 8 support is being added constantly. The new JAX-RS and Servlet 4.0 are already supported.MicroProfile. Java EE 8 support is being added constantly. The new JAX-RS and Servlet 4.0 are already supported.

08 outubro 2018

12 Frameworks Java Web Developers Should learn in 2018

1) Angular 2+
2) Node JS
3) Spring Boot
4) React
5) Bootstrap
6) jQuery
7) Spring Security 5
8) Apache Hadoop
9) Apache Spark
10) Cordova
11) Firebase
12) Xamarin

Source: hackernoon.com

28 setembro 2018

Micronaut - A Java framework to microservices



Micronaut is a modern, JVM-based, full stack microservices framework designed for building modular, easily testable microservice applications.


Micronaut is developed by the creators of the Grails framework and takes inspiration from lessons learnt over the years building real-world applications from monoliths to microservices using Spring, Spring Boot and Grails.

Micronaut aims to provide all the tools necessary to build full-featured microservice applications, including:
  • Dependency Injection and Inversion of Control (IoC)
  • Sensible Defaults and Auto-Configuration
  • Configuration and Configuration Sharing
  • Service Discovery
  • HTTP Routing
  • HTTP Client with client-side load-balancing


At the same time Micronaut aims to avoid the downsides of frameworks like Spring, Spring Boot and Grails by providing:

  • Fast startup time
  • Reduced memory footprint
  • Minimal use of reflection
  • Minimal use of proxies
  • Easy unit testing
Articles

03 setembro 2018

WildFly 14 available


WildFly 14 features

Well, it’s certainly improved lots of Java EE8 functions. Here’s an overview of the new and updated standards in WildFly 14:

  • Java Servlet
  • Contexts and Dependency Injection for Java
  • Bean Validation
  • JavaServer Faces
  • JavaMail
  • Java API for RESTFul Web Services
  • Java API for JSON Processing
  • Java API for JSON Binding
  • Common Annotations for the Java Platform
  • Java EE Security
  • Java Persistence

Source: jaxenter.com

02 maio 2018

Run4All - Agenda de Eventos Running



Agenda de Eventos de Running (Trail, Estrada, Caminhada) em Portugal

Características:
- lista de eventos running
- detalhes do evento
- visualização da localização no mapa
- possibilidade de gestão de favoritos
- visualização de lista offline
- listagem de novos eventos adicionados nos últimos 7 dias
- Filtrar lista por tipo de actividade

Eventos de Running, com detalhes como:
- data do evento
- data limite de inscrição
- localização
- tipo de evento: Trail, Estrada, Caminhada
- distâncias
- url de mais informações

Este projeto continua em desenvolvimento ativo, para sugestões de melhoria, comunicação de problemas ou mesmo adicionar mais eventos poderão contactar através do email
run4allapp@gmail.com



Podes contribuir com um pequeno donativo para ajudar na manutenção da aplicação e para apoio a novos desenvolvimentos.


28 março 2018

Developing Distributed Apps on the Ethereum Blockchain



About:
A hands-on talk about programming distributed apps on the Ethereum Blockchain. In this talk you will be introduced in the basics of the blockchain and we'll show some real code of an example application. The app is a freelancing competition where freelancers compete for a work based on a clients briefing and after that the most voted work receives the prize money (given by the client).

Source: infoq.com

26 março 2018

Privacy Policy

Privacy Policy

Tiago Saraiva Lopes built the Run4All app as a Free app. This SERVICE is provided by Tiago Saraiva Lopes at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Run4All unless otherwise defined in this Privacy Policy.

Information Collection and Use
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to Android advertising ID. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third party services that may collect information used to identify you.

Link to privacy policy of third party service providers used by the app



Log Data
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.

Cookies
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.

Service Providers
I may employ third-party companies and individuals due to the following reasons:

  • To facilitate our Service; 
  • To provide the Service on our behalf; 
  • To perform Service-related services; or 
  • To assist us in analyzing how our Service is used. 


I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.

Security
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.

Links to Other Sites
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.

Children’s Privacy
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do necessary actions.

Changes to This Privacy Policy
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.

Contact Us
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me.

16 fevereiro 2018

GPS Tracker APN MEO config

Para configurar APN num aparelho de GPS Tracker na rede MEO usar o seguinte comando

pw,123456,apn,mmsc.tmn.pt,tmn,tmnnet,26806#

Antes de enviar o comando acima assegurar que o cartão SIM não pede código quando colocado no aparelho, retirar código usando um telemóvel/smartphone.

Deverão receber uma resposta de configuração do serviço.


31 janeiro 2018

How to use Queue in Java


public class QueueDemo {

    public static void main(String args[]) {
        Queue months = new LinkedList<>();
        // Example 1 - Adding objects into Queue
        System.out.println("Queue : " + months);
        months.add("JAN");
        months.add("FEB");
        months.add("MAR");
        months.add("APR");
        months.add("MAY");
        months.add("JUN");
        months.add("JUL");
        months.add("AUG");
        months.add("SEP");
        months.add("OCT");
        months.add("NOV");
        months.add("DEC");
        System.out.println("Queue after initialization : " + months);

        // Example 2 - Checking if an Object is in Queue or not
        boolean hasMay = months.contains("MAY");
        System.out.println("Does Queue has MAY in it? " + hasMay);

        // Example 3 - Retrieving value from head of Queue
        String head = months.peek();
        System.out.println("Head of the Queue contains : " + head);

        // Example 4 - Removing objects from head of the Queue
        String oldHead = months.poll();
        String newHead = months.peek();
        System.out.println("old head : " + oldHead);
        System.out.println("new head : " + newHead);

        // Example 5 - Another way to remove head objects from Queue
        months.remove();
        System.out.println("now head of Queue is: " + months.peek());
    }
}


Source: java67.com

25 janeiro 2018

FileInputStream / FileOutputStream - new ways to code

From Java7 that we must use FileInputStream and FileOuputStream as described below

public void writeToFile(String fileName, byte[] content) throws IOException {
    try (OutputStream os = Files.newOutputStream(Paths.get(fileName))) {
        os.write(content);
    }
}
public byte[] readFromFile(String fileName) throws IOException {
    byte[] buf = new byte[8192];
    try (InputStream is = Files.newInputStream(Paths.get(fileName))) {
        int len = is.read(buf);
        if (len < buf.length) {
            return Arrays.copyOf(buf, len);
        }
        ByteArrayOutputStream os = new ByteArrayOutputStream(16384);
        while (len != -1) {
            os.write(buf, 0, len);
            len = is.read(buf);
        }
        return os.toByteArray();
    }
}

Source: dzone.com

10 things to remember while reading, writing from/to a file in Java

10 essential things Java developer should know about File handling in Java programming language.  

1) The same java.io.File class is used to represent both file and directory in Java. You can use the isDirectory() and isFile() method from the java.io.File class to check if you are actually working with a file or directory.  See this article to learn more about File and Directory in Java.

2) In Java, InputStream is used for reading data and OutputStream is used for writing data. In the context of a file, FileInputStream is used to read data from a file and FileOutputStream is used to write data into the file. I know, it's easy to remember that one you know but I have seen many Java programmers struggling with InputStream and OuputStream and their meaning.

3) Java provides different classes for different needs in java.io package, for example, Stream classes e.g. InputStream and OutputStream are used to read and write binary data while Reader and Writer e.g. BufferedReader and BufferedWriter are used to writing character or text data.

4) It is very important to close the stream after using it, as it is not closed implicitly, to release any resources associated with it, while in the output stream, the close() method calls flush() before releasing the resources which force any buffered bytes to be written to the stream. See Complete Java 9 Masterclass to learn more about how to close Stream in right way.

5) If we try to read from a file that doesn’t exist, a FileNotFoundException will be thrown but If we try to write to a file that doesn’t exist, the file will be created first and no exception will be thrown

6) FileReader and FileWriter classes are used to read/write data from a text file in Java. Even though you can use FileInputStream and FileOutputStreamFileReader and FileWriter are more efficient and handles character encoding issues for you. You can see the difference between FileReader and FileInputStream to learn more about that.

7) If you are dealing with a shared file then make sure you lock the file before writing into it. You can use the FileLock interface for locking the portion of the file. You can get the associated lock for a file by calling the FileChannel.getLock() method. See here for an example of locking a file in Java before writing into it.

8) Make sure you know the right way to close the stream in Java because calling the close itself can throw IOException. See my post about how to properly close input and output stream in Java to learn more.

9) The java.io and java.nio package provides several classes to write different kinds of data on the different situation.  For example, you can use
  •  PrintWriter to write formatted text;
  •  FileOutputStream to write binary data; 
  •  FileWrite to writer text data, 
  •  DataOutputStream to write primitive data types; 
  •  RandomAccessFile to write to a specific position, and 
  •  FileChannel to write faster in bigger files.

10) Use the JDK 7 new file API as much as possible, particularly for writing new code. Spend some time know and understand the new File API introduced in JDK 7, at least the java.nio.file.Files class, which allows you to create, read, write, copymove, and delete files and directories in Java.

Source: www.java67.com