HNHacker News
TopNewBestAskShowJobs

stackmad

96 karma · joined August 22, 2018

An author of the Boden cross-platform framework. Find us at GitHub: https://github.com/ashampoosystems/boden
submissionscomments
stackmad··on Boden – Native mobile cross-platform applications
Author of boden here: We have since moved away from a self written smart pointer and replaced as much as possible with standard C++ classes ( shared_ptr, weak_ptr, std::string etc. )
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Actually its 9 plants ;)
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yeah, you have to use IOKit, which hidapi wraps.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
LOL
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
:) But the CO2 measurement part honestly came first.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Sure, but I wanted to see the data over time. And I was bored :)
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yeah, its quite ok.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Totally true, but my soldering iron is in the basement, so ... ;)
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yes, absolutely. I only have one device at the moment, but it sure would be interesting to see how fast the levels equalize between rooms
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yes, I agree. But this was way more fun :)
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
I guess it should match the outside air as close as possible. So around 400ppm
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Its not that I'm afraid to die here :) Its more about improving the quality of the air. And the body is pretty bad at recognizing higher than norm CO2 level unless it gets to life threatening levels. ( https://youtu.be/1Nh_vxpycEA?t=45 )
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Though with your steps it at least starts, but the webserver fails, and CTRL+C doesn't work ^^

   * Serving Flask app "co2meter.server" (lazy loading)
   * Environment: production
     WARNING: Do not use the development server in a production environment.
     Use a production WSGI server instead.
   * Debug mode: off
  INFO:werkzeug: * Running on http://127.0.0.1:1201/ (Press CTRL+C to quit)
  ERROR:flask.app:Exception on / [GET]
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
      response = self.full_dispatch_request()
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
      rv = self.dispatch_request()
    File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/usr/local/lib/python2.7/site-packages/co2meter/server.py", line 64, in home
      data = read_logs()
    File "/usr/local/lib/python2.7/site-packages/co2meter/server.py", line 236, in read_logs
      with open(os.path.join('logs', name + '.csv'), 'r') as f:
  IOError: [Errno 2] No such file or directory: 'logs/co2.csv'
  INFO:werkzeug:127.0.0.1 - - [25/Jan/2019 14:18:23] "GET / HTTP/1.1" 500 -
  INFO:werkzeug:127.0.0.1 - - [25/Jan/2019 14:18:23] "GET /favicon.ico HTTP/1.1" 404 -
  ^C^C^C^C
  ^C^C
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
That looks great as well! But for some reason the library they use (pyhidapi) would always crash on my Mac.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
I saw some study that suggests that higher CO2 levels decrease cognitive abilities. You wont die, but I do tend to get headaches when the air gets worse.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
It definitely shows that this is one of the cheapest meters on the market. But the values seem to be realistic, when having all windows open it shows 450-460 ppm which is at least close to the global 400ppm ( and I live next to a road in a bigger city ).
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yeah, I've finally managed to tweak the thermostat on the radiators and the main thermostat for the heater to where I like it :)
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yeah, that was pretty quickly hacked together :)
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
The device on its onscreen display shows the same steps, so I think its due to how the sensor works.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Depends, this was a question I tried to answer for myself with this project. I did not easily find a good library for Python that would work on my Mac for reading the HID messages, so writing the device part in C++ was easier for me ( and an interesting excercise in c++17'ifying C code ). I thought about just having the c++ app be called from python, but wanted to try and see how hard it would be in c++ and found it extremely easy with the cpprestsdk.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
Yes, I agree. I've already ordered a bunch of plants :) Sadly my building is quite old and ventilation is poor.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
That looks good as well! I actually didn't know about that project. It wouldn't have worked on my specific case though since I wanted it connected to my Mac, that tool only works on Linux.
stackmad··on Show HN: I wanted to measure CO2 in my office, so I build a C++ WebServer/App
You can only put link + title on here. And the story is rather boring :) I wanted to measure it, I got a device from amazon, found a python script to read the data, the dependencies (pyhidapi) always sigfaulted, so I wrote my own :)
stackmad··on Pijul: distributed version control system based on a sound theory of patches
Is there a TL;DR version of their "theory of patches" ?
stackmad··on Ask HN: Which tool for generating aesthetically pleasing C++ reference docs?
I'd recommend having a look at sphinx together with exhale https://exhale.readthedocs.io/en/latest/
stackmad··on CppCon 2018: Kate Gregory “Simplicity: Not Just for Beginners”
More people should see this!