Skip to content

Instantly share code, notes, and snippets.

View paolorotolo's full-sized avatar
🖖

Paolo Rotolo paolorotolo

🖖
View GitHub Profile
% #traccia simulazione
%acquisisco il #numero di operai
n_op= input('Inserire il numero di operai');
%Acquisisco per ogni #operaio: paga oraria, ore settimanali e pezzi prodotti
%in un giorno
for i=1:n_op
paga_oraria(i)=input('Inserire la paga oraria');
ore_settimanali(i)=input('Inserire le ore settimanali dell''operaio');
n = input('Quanti operai vuoi inserire?');
% Non abbiamo trovato un modo in matlab per definire variabili globali
% nella documentazione c'è la keyword 'global' ma non funziona :/
pezzi = caricaInputPezzi(n);
ore = caricaInputOre(n);
paga = caricaInputPaga(n);
% Allora.
% f ci serve per capire la scelta dell'utente
@paolorotolo
paolorotolo / voti.m
Last active December 6, 2016 12:54
voti.m
numeroVotanti = input('Quanti sono i votanti: ');
votoSi = 0;
votoNo = 0;
votoNonSo = 0;
nonVoto = 0;
for i=1:numeroVotanti
k = input('[1 - SÌ, 2 - NO, 3 - NON SO, 4 - NON RISPONDO]');
faiScegliere();
function f = faiScegliere()
scelta = input('Metti input [1 media - 2 massimo e minimo - 3 potenza]: ');
if scelta == 1
disp(strcat('La media è:', int2str(media())))
elseif scelta == 2
disp('Massimo e minimo')
numeroSoci = input('Quanto soci vuoi inserire?')
for i=1:numeroSoci
socio(i).nome= input('nome: ', 's')
socio(i).cognome=input('cognome: ', 's')
socio(i).cf=input('cf: ', 's')
socio(i).qs=input('qs: ', 's')
socio(i).ruolo=input('ruolo (AMM 1 - CONS 2 - SOCIO 3): ')
end
/*
* Copyright (C) 2016 Glucosio Foundation
*
* This file is part of Glucosio.
*
* Glucosio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* Glucosio is distributed in the hope that it will be useful,
/*
* Copyright (C) 2016 Glucosio Foundation
*
* This file is part of Glucosio.
*
* Glucosio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* Glucosio is distributed in the hope that it will be useful,
@paolorotolo
paolorotolo / RealmBackupRestore.java
Last active June 17, 2018 17:31
Class to easily backup/restore data from Realm.
package org.glucosio.android.tools;
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Environment;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.widget.Toast;
@paolorotolo
paolorotolo / GlucoseConverter.java
Last active February 2, 2016 18:37
Glucose Conversion tools in Java
import java.math.BigDecimal;
import java.math.RoundingMode;
public class GlucoseConverter {
public class GlucoseConverter {
public int glucoseToMgDl(double mmolL){
// Mg/dL = mmol/L * 18
double converted = mmolL * 18;
return (int) converted;
}
#!/usr/bin/env bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
mkdir $HOME/android/
mkdir $HOME/android/wear
cp -R app/build/outputs/apk/app-debug.apk $HOME/android/
cp -R wear/build/outputs/apk/wear-debug.apk $HOME/android/wear