Catégories
Internet

Comment reconnaître le hameçonnage ?

Savez-vous reconnaitre un e-mail de hameçonnage ?

Si la réponse est non, lisez la suite.

Catégories
Processing Programmation

Resize event in Processing sketch

Here is how to make the Processing window resizable AND get an event when the window is resized.

Tested with Processing 3.

// For resize event
import java.awt.Canvas;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentAdapter;


void setup() {
  surface.setResizable(true);

  ((Canvas)surface.getNative()).addComponentListener(new ComponentAdapter() {
    @Override public void componentResized(ComponentEvent e) {
      println("resized " + width + " " + height);
    }
  }
  );
}

Catégories
Arduino Programmation

State machine Arduino demo

The LED is either blinking or glowing, but not at the same time. This simple example is a use case for a state machine.

The video shows the led alternating between blinking and glowing using a StateMachine objet and two State inherited objects.

When it comes to program complex interactions with Adrduino, we may benefit from using state machines. This allows to separate the code needed to manage different states of the applications and easily switch from one stat to another.