PodCast `Hora do Lancamento`

All

Hora do Lancamento

Gabriel Alabarse and me, we started a podcast to talk about some of the launches that currently happen: basically SpaceX and RocketLab. We are trying to fight the HUGE amount of MISINFORMATION there is around, particularly in Youtube in Portuguese. Abnormal amount. Big channels, with millions of views spreading conspirational theories.

The explanation for being in Portuguese more than English, is because we have several very good channels that explain the basics for the general population in English, examples: Everyday Astronaut, SpaceXcentric, Scott Manley, 2 The Future Together, SpaceXfans, and the Angry Astronaut, besides the launches from SpaceX, ULA, RocketLab, all content in English.

It is just the first try:

-f

Infinispan/JDG Quickstarts Pt5 – Java HotRod

All

Intro

Another Hot Rod tutorial, this time with java, similar concept but using a Hot Rod java client. Just a reminder, basically TCP client that access the cache on JDG.

Core part

There is the `​FootballManager` and the Team, which are pretty much the classes that play a role here (except for the user). So then a FootballManager has team(s) and so forth. The team just encapsulates the list of players and the name. The core part (talking with the cache itself) is on the FootballManager class.

ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
.host(jdgProperty(JDG_HOST))
.port(Integer.parseInt(jdgProperty(HOTROD_PORT)));
cacheManager = new RemoteCacheManager(builder.build());
cache = cacheManager.getCache(“teams”);

The main part is then the builder adding the server with jdgProperty (from a file) and the port. Then it adds the players. The file has basically the host and the port:

jdg.host=localhost
jdg.hotrod.port=11222

To read the commands,  it is used java.io.Console in comparison with the javascript version (that uses Vorpalo=||==>).

Interesting Topics

– Originally the players added were Messi, Pedro, and Puyol. I changed for Pele, Tostao, and Rivelino (Tri-world champions on the1970th World Cup in Mexico)

– Comparing with the JS version: This version is done in Java,that’s the only difference. Although js has a simpler connection with JDG.

– Interestingly, java.io.Console reading is faster than bufferedReader

REFs

inline

 

Mocking request http

All

Intro

Recently I needed to simulate some requests http so then I used EasyMock. Quite useful indeed and very simple:

Code

HelloServletMock mock = new HelloServletMock();

HttpServletRequest request = createMock(HttpServletRequest.class);
HttpServletResponse response = createMock(HttpServletResponse.class);

expect(request.getParameter(“yourName“)).andReturn(“Jose Carlos“).times(1, 2);
replay(request);

On this case the request will return “Jose Carlos” when I get the paramter “yourName”, example:

String yourName = request.getParameter(“yourName”);

Icedtea-web ~ jnlp launcher

All

Intro

As replacement for Java Web Start, IcedTea-web, provides a Java Web browser plugin. What I like about this project is that it is so clean, easy to access, easy to execute some Java Network Launch Protocol files.

Icedtea-web

Control Panel

ice_tea

Iced Tea Web – Control Panel

JVM Settings

Using this setting will help to set the browser plugin

Policy Settings

This basically is a link to the java.policy:

[$JAVA_HOME/jdk1.8.0_191]$ cd jre/lib/security/
[fdemeloj@fdemeloj security]$ ls
blacklist blacklisted.certs cacerts java.policy java.security javaws.policy policy trusted.libraries

         Extended applet security

So here one can add the exceptions, in a similar way to JWS. So then you edit the rows in order to add the site exception.

IcedTea-Web Tests/Samples

On the link you can select the test to be done, the tests are .jnlp files that you execute directly clicking on it (of course, the default will be IcedTea-web) so we open. This one is pretty cool: circuit-construction-kit-dc_en.jnlp – Developed by PhET at the University of Colorado.

icedtea2

IcedTea test – circuit construction

 

The code is pretty straightforward, is jnlp file:

You will have a XML file with:

                    1. code base link (to fetch),

                    2.a jar file (to execute),

                    3. some properties – language for example

<?xml version=”1.0″ encoding=”utf-8″?>

<!– JNLP File for Circuit Construction Kit (DC Only) –>

<jnlp spec=”1.0+” codebase=”https://phet.colorado.edu/sims/circuit-construction-kit” href=”circuit-construction-kit-dc_en.jnlp”>

<property name=”javaws.phet.locale” value=”en” />
<property name=”javaws.user.language” value=”en” />

<jar href=”circuit-construction-kit_all.jar”/> ii

</resources>

<application-desc main-class=”edu.colorado.phet.circuitconstructionkit.CircuitConstructionKitDCApplication“>

</application-desc>

</jnlp>

  1. The main class to be executed is set with <application-desc main-class>
  2. Interestingly they have this for several languages, including Korean and Portuguese! But the trick is to change the language is to change the property AND the doc circuit-construction-kit-dc_es.jnlp – Ampolleta is light in Spanish.

 

REFs

inline

OOB messages

All

Intro

I’m using this new block scheme in Word Press, and I can say: I suck on this. Like totally, I don’t know where do to anything. Totally, is like learning a new language, I know nothing about it. But does not seem that bad, in fact.

OOB Messages

Out Of Band messages – are sent periodically from the members. Is a message with a tag Message.OOB and is processed by a specific thread pool: out-of-band thread pool at the receiver’s side and they are handled at the transport level.

Message msg=new Message();
msg.setFlag(Message.OOB, Message.NO_FC);

Configuration of the oob thread pool:

oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="3"
oob_thread_pool.keep_alive_time="60000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="500"
oob_thread_pool.rejection_policy="run"/>
getOOBThreadPool
    public Executor getOOBThreadPool()

setOOBThreadPool
    public void setOOBThreadPool(Executor oob_thread_pool)

Removing OOB Thread Pool

For simplicity, JGroups ended up removing OOB Thread Pool, which was combined with the regular thread pool, reducing the number of thread pools in JGroups 4. This means the configuration above, for oob thread pool, becomes obsolete and the new configuration is done as follows:

thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="8"
thread_pool.keep_alive_time="5000"

REFs

inline

Quick servlet

All

Intro

Gonna show how to do a small servlet here.

Writing

Basically the main part is to extend HttpsServlet

public class StarterServlet extends HttpServlet {

private static final long serialVersionUID = 1L;

@Override
public void init(ServletConfig servletConfiguration) throws ServletException {

super.init(servletConfiguration);

System.out.println(“SERVLET STARTED!”);
}

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

System.out.println(“DOGET!”);

PrintWriter printWriter = response.getWriter();

printWriter.println(“Hello world”);
}
}

Creating the war file

jar -cvf myapp.war *

Deploying

cp myapp.war /home/fdemeloj/jboss-eap-7.3/standalone/deployments

Accessing it

http://127.0.0.1:8080/myapp/starter

 

Linkedin Social Selling Index

All

Heads up

Linkedin has an index of social influence, is called SSI. Basically is how much you impact your social network – SSI. Although I usually don’t care much about index in social media, this one might be relevant since it is related to work career.

How is calculated

Basically is a sum of the 4 items:

  • Establish your professional brand (1-25)

  • Find the right people (1-25)

  • Engage with insights (1-25)

  • Build relationships (1-25)

How to improve your Social Selling Index:

There is a presentation about this directly from Linkedin.

REFs

https://www.linkedin.com/sales/ssi

 

Wildfly-config file

All

Intro

During the process of discovery a client requires access to its configuration, the classpath is scanned for and the first thing is to look at wildfly file or can be set with a system-configuration as well – which will load several properties.

In  EJB replaces jboss-ejb-client.properties file which is configured for EJB standalone client applications.

Wildfly-config file

There are several usages for wildfly-config but authentication is one of them:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
    <authentication-client xmlns="urn:elytron:1.0">
       ...
    </authentication-client>
</configuration>

jboss-ejb-client

Using this can be helpful to set several properties, invocation-timeouts and can be used to add connections, which is used to specify an EJB client connection but also can add an interceptors element – I will post about interceptors on this year.

Demo

REFs

inline