Skip to content

Instantly share code, notes, and snippets.

View GiovanniBalestrieri's full-sized avatar
🍣
When there is a shell, there is a way

UserK GiovanniBalestrieri

🍣
When there is a shell, there is a way
View GitHub Profile
<NamedIndividual rdf:about="sm#chair1">
<rdf:type rdf:resource="&semantic_mapping_domain_model;Chair"/>
<semantic_mapping_domain_model:hasPosition rdf:resource="sm#chair1_coordinates"/>
<semantic_mapping_domain_model:hasSize rdf:resource="sm#chair1_size"/>
<semantic_mapping_domain_model:hasAlternativeReference rdf:resource="sm#chair_alternative_reference_1"/>
<semantic_mapping_domain_model:hasAlternativeReference rdf:resource="sm#chair_alternative_reference_2"/>
<semantic_mapping_domain_model:hasAlternativeReference rdf:resource="sm#chair_alternative_reference_3"/>
<semantic_mapping_domain_model:hasPreferredReference rdf:resource="sm#chair_preferred_reference"/>
</NamedIndividual>
@GiovanniBalestrieri
GiovanniBalestrieri / CoordinatesObjectProperty.owl
Created February 13, 2017 23:13
just another object property Coordinates
<owl:Class rdf:about="sm#Coordinates">
<rdfs:subClassOf rdf:resource="sm#Position"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="sm#float_coordinates_z"/>
<owl:someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#float"/>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
@GiovanniBalestrieri
GiovanniBalestrieri / objectproperty1.owl
Created February 13, 2017 23:12
just an object property
<owl:ObjectProperty rdf:about="sm#hasPosition">
<rdfs:subPropertyOf rdf:resource="sm#hasSpatialProperty"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#IrreflexiveProperty"/>
</owl:ObjectProperty>
@GiovanniBalestrieri
GiovanniBalestrieri / Listener.java
Created February 11, 2017 00:44
RosJava program to test Jena libraries import
package com.github.rosjava.jinchimiru.jinchimiru_sub_project;
import org.apache.commons.logging.Log;
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.NodeMain;
import org.ros.node.topic.Subscriber;
float a = 0, b = 0;
int angularDir = 1;
void setup() {
size(500, 500);
ellipseMode(CENTER);
frameRate(15);
background(0);
}
@GiovanniBalestrieri
GiovanniBalestrieri / notification_item_list.xml
Created November 10, 2016 14:38
Xml layout of list Item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white_100_percent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:id="@+id/discount_header"
@GiovanniBalestrieri
GiovanniBalestrieri / rfcomm.conf
Created August 16, 2016 22:15
Rfcomm configuration file
rfcomm0 {
# Automatically bind the device at startup
bind no;
# Bluetooth address of the device
device 11:22:33:44:55:66;
# RFCOMM channel for the connection
channel 3;
# Description of the connection
comment "This is Device 1's serial port.";
}
@GiovanniBalestrieri
GiovanniBalestrieri / Part_Candidate_trajectory_fcn1.py
Created August 9, 2016 18:33
Curve of the smallest length + weight on the altitude
arg1 = 0.00001
arg2 = 1
def function(a , T):
return numpy.array([T[1] , # evaluate dT1/dA
T[0]*arg1 - (T[1]/math.sqrt(1+T[1]**2))*arg2]) # evaluate dT2/dA
"""
The "solve" function returns a Solution object which can be passed an array of points at which to evaluate the solution.
"""
A = numpy.linspace(0,TF, 101)
T = solution(A)
print T
"""
We can plot the solution using pylab with the following code
"""
@GiovanniBalestrieri
GiovanniBalestrieri / Part_Candidate_trajectory_Solve.py
Created August 9, 2016 17:31
Call the solve function to solve the two point boundary value problem
solution = scikits.bvp_solver.solve(problem,
solution_guess = ((X1T0 + X1Tf)/2.0,
(X2T0 + X2Tf)/2.0))