Skip to content

Instantly share code, notes, and snippets.

Avatar

Orleando Dassi dassiorleando

View GitHub Profile
@dassiorleando
dassiorleando / web_compoment_objects.html
Created Apr 9, 2019
TrackingJs - Web Compoment Objects Detection
View web_compoment_objects.html
<!DOCTYPE html>
<html>
<head>
<!-- Importing Web Component's Polyfill -->
<script src="bower/platform/platform.js"></script>
<!-- Importing Custom Elements -->
<link rel="import" href="../src/image-object-tracking.html">
</head>
<body>
<!-- Using Custom Elements -->
@dassiorleando
dassiorleando / object_detector.html
Created Apr 9, 2019
Object detection - TrackingJs
View object_detector.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - first tracking</title>
<script src="tracking-min.js"></script>
<!-- include dataset for each objet type -->
<script src="data/face.js"></script>
<script src="data/eye.js"></script>
@dassiorleando
dassiorleando / color_detection_cutom_colors.html
Created Apr 9, 2019
Color detection with custom colors
View color_detection_cutom_colors.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - first tracking</title>
<script src="tracking-min.js"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
View color_detection.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - first tracking</title>
<script src="tracking-min.js"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
View ToStringProgramUnitTest.java
@Test
public void safeToStringTest() {
ObjectB objectB = new ObjectB("Fake propB");
ObjectA objectA = new ObjectA("Fake propA", objectB);
String stringObjectA = Objects.toString(objectA);
System.out.println(stringObjectA);
assertNull(objectA.getObjectB2());
assertTrue(stringObjectA.contains("objectB2=null"));
View Main.java
ObjectB objectB = new ObjectB("Fake propB");
ObjectA objectA = new ObjectA("Fake propA", objectB);
System.out.println(Objects.toString(objectA));
View ObjectA.java
public class ObjectA {
private String propA;
private ObjectB objectB1;
private ObjectB objectB2;
public ObjectA(String propA, ObjectB objectB1) {
this.propA = propA;
this.objectB1 = objectB1;
}
View ObjectB.java
public class ObjectB {
private String propB;
public ObjectB(String propB) {
this.propB = propB;
}
// Getters and setters
@Override
@dassiorleando
dassiorleando / valueIOf.java
Created Apr 3, 2018
a part of valueOf method
View valueIOf.java
/**
* Returns the string representation of the {@code Object} argument.
*
* @param obj an {@code Object}.
* @return if the argument is {@code null}, then a string equal to
* {@code "null"}; otherwise, the value of
* {@code obj.toString()} is returned.
* @see java.lang.Object#toString()
*/
public static String valueOf(Object obj) {
@dassiorleando
dassiorleando / script.js
Last active Mar 24, 2018
Using $timeout and setTimout in AngularJs App
View script.js
/**
* Simple script to show how to solve the scrope update
* When using the native js TimeOut call
*
* @author dassiorleando
*/
(function (angular) {
'use strict';
angular