Skip to content

Instantly share code, notes, and snippets.

View jabrena's full-sized avatar

Juan Antonio Breña Moral jabrena

View GitHub Profile
@jabrena
jabrena / Kata.java
Last active June 11, 2017 18:35
Kata.java
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Created by jabrena
@jabrena
jabrena / Pong7
Created August 13, 2017 15:48
Stone, Paper, Scissor, Lizard & Spock Game using a Cloud API
package examples;
import cloud.robots.bridge.client.Bridge;
import cloud.robots.bridge.client.exceptions.BridgeException;
import cloud.robots.bridge.client.internal.BridgeBuilderFactory;
import cloud.robots.bridge.client.model.Message;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@jabrena
jabrena / CombinedUSBDevices.java
Last active August 13, 2017 17:52
Event-based approach to process complex Sensors connected to a Serial Port connection
package examples;
import ev3dev.sensors.Battery;
import ev3dev.sensors.arduino.bn055.BNO055;
import ev3dev.sensors.arduino.bn055.BNO055Listener;
import ev3dev.sensors.arduino.bn055.model.BNO055Response;
import ev3dev.sensors.slamtec.RPLidarA1;
import ev3dev.sensors.slamtec.RPLidarA1ServiceException;
import ev3dev.sensors.slamtec.RPLidarProviderListener;
import ev3dev.sensors.slamtec.model.Scan;
Java for Kids
Juan Antonio Breña Moral
Table of Contents
Introduction..........................................................................................................................................3
Getting Started......................................................................................................................................3
The language........................................................................................................................................3
Introduction......................................................................................................................................3
The architecture of Java...................................................................................................................3
The JVM.....................................................................................................................................3
@jabrena
jabrena / ROSPubSubDemo.java
Last active September 18, 2017 20:25
Teleoperate EV3 Mobile platform with ROS and Java
package examples;
import edu.wpi.rail.jrosbridge.Ros;
import ev3dev.rosbridge.publishers.BrickBattery;
import ev3dev.rosbridge.publishers.Odom;
import ev3dev.rosbridge.publishers.Scan;
import ev3dev.rosbridge.subscribers.TeleOperation;
import ev3dev.sensors.Battery;
@jabrena
jabrena / HelloWorld.java
Created September 19, 2017 17:31
Exercise 1
public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
@jabrena
jabrena / HelloWorld.java
Created September 25, 2017 17:14
Exercise1
/**
Program description
*/
public class HelloWorld {
public static void main(String[] args) {
//Message
String message = "Hello, World";
// Prints "Hello, World" to the terminal window.
@jabrena
jabrena / convertAndVerify.sh
Last active December 24, 2017 18:05
Convert mp3 from any bitrate to 320; Verify bitrate conversion
#1. Create folder
mkdir 320
#2. Convert any .mp3 to 320 bit rate
for f in *.mp3
do
echo "Processing $f"
ffmpeg -i "$f" -c:a libmp3lame -b:a 320k "./320/$f"
done
@jabrena
jabrena / Outuput:
Created April 7, 2018 19:53
java -jar vmbenchmarks.jar -wi 1 -i 1 -f 1
robot@ev3dev:~$ java -jar vmbenchmarks.jar -wi 1 -i 1 -f 1
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/home/robot/vmbenchmarks.jar) to field java.io.Console.cs
WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
# JMH version: 1.20
# VM version: JDK 10, VM 10+46-ev3
# VM invoker: /opt/jri-10-build-46-v2/bin/java
# VM options: <none>
swagger: "2.0"
info:
description: ""
version: "1.0.0"
title: "TDD Sum"
termsOfService: "http://swagger.io/terms/"
contact:
email: "apiteam@swagger.io"
license:
name: "Apache 2.0"