Skip to content

Instantly share code, notes, and snippets.

View papylhomme's full-sized avatar

Michaël Lhomme papylhomme

View GitHub Profile
@papylhomme
papylhomme / testlist.cpp
Created March 27, 2015 23:25
Test QListView using grid layout and dataChanged signal
#include <QApplication>
#include <QMainWindow>
#include <QLayout>
#include <QPushButton>
#include <QListView>
#include <QStringListModel>
class CustomModel : public QStringListModel {
Q_OBJECT
@papylhomme
papylhomme / output
Created August 17, 2015 18:55
influxdb 0.9 master, panic when trying to backup data
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x2fbad8]
goroutine 56 [running]:
github.com/boltdb/bolt.(*DB).beginTx(0x0, 0x10bd7770, 0x0, 0x0)
/home/papy/aur/influxdb-git/src/src/github.com/boltdb/bolt/db.go:422 +0x38
github.com/boltdb/bolt.(*DB).Begin(0x0, 0x0, 0x76e0b108, 0x0, 0x0)
/home/papy/aur/influxdb-git/src/src/github.com/boltdb/bolt/db.go:415 +0x64
github.com/influxdb/influxdb/tsdb.appendShardSnapshotFile(0x10c30a60, 0x10be21e0, 0x10bd68b7, 0x12, 0x0, 0x0)
/home/papy/aur/influxdb-git/src/src/github.com/influxdb/influxdb/tsdb/snapshot_writer.go:86 +0x158
@papylhomme
papylhomme / res_derivative.json
Created August 22, 2015 19:51
Influxdb results from different function
{
"results": [
{
"series": [
{
"columns": [
"time",
"derivative"
],
"name": "users_value",
diff --git a/Battery.cpp b/Battery.cpp
index 0c61063..dc444e3 100644
--- a/Battery.cpp
+++ b/Battery.cpp
@@ -36,13 +36,16 @@ void Battery::begin(uint16_t refVoltage, float dividerRatio) {
}
uint8_t Battery::level() {
- int16_t sense = this->voltage();
- if (sense <= minVoltage) {