For the past few months, I’ve been playing around with the new Web Bluetooth API which is about to ship in Chrome 56 in February 2017. And let me tell you, this new feature just unlocked lots of new possibilities for the Web. As a Web Advocate, I was so excited and couldn’t wait to build an application showing how easy it is to combine Angular and the Web Bluetooth API (even more, with any of the upcoming Web APIs, more on that soon, stay tuned). Let’s meet The Missing Web Bluetooth Module for Angular Application I started then working with my buddy François Beaufort (kudos to him!) to build a demo app, a kind of proof of concept that illustrates how to integrate Web Bluetooth with Angular. After implementing a couple of use cases, I came up with an Angular module which abstracts away all the boilerplate needed to configure the Web Bluetooth API. A Few Disclaimers Web Bluetooth APIs I am going to assume that you’re already familiar with the Web Bluetooth APIs: GATT server, Services, Characteristics…etc. Please make yourself comfortable with this topic before reading the next sections. Here are few resources: https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web https://medium.com/@urish/start-building-with-web-bluetooth-and-progressive-web-apps-6534835959a6 Observables I am also assuming that you have some basic knowledge about Observables, Observers and Subjects. Finnish Notation You will notice that some methods ends with a $ symbol. This is some sort of convention in the Observables world that we’ve been using for a while. We may drop this $ symbol in the future because of this blog post. Installing the module You can get this module… Read more
Month: February 2021
Installing openCV 3.0 on macOS
doing some machine learning and want to install openCV the right way to be used with python, follow here! Install home-brew for mac. ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” python2.7 usually comes installed in macOS, if not brew install python add openCV to the search using the tap argument in home brew brew tap homebrew/science install openCV with the obvious command for installing opencv-2.4.12_2 brew install opencv but we want to install opencv 3.0 which means, we have to compile from source. hit the terminal with the following, cd ~/Documents/dev git clone https://github.com/opencv/opencv.git cd opencv git checkout 3.0.0 cd~/opencv mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D PYTHON2_PACKAGES_PATH=~/.virtualenvs/cv/lib/python2.7/site-packages -D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/bin -D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv/modules .. now make with the number of jobs, i like to put the number of cores in your PC. when you don’t know, hit this to find out in a macOS sysctl -n hw.ncpu make -j4 make install when permissions are a problem, do the obvious sudo make install to check if it installed on your python path, hit the python shell python >>> import cv2 >>> cv2.__version__ ‘3.0.0’ if you want this to be installed in your python path of your virtual environment, you need to create a symbolic link of the installed openCV library in your brew installed python into your site packages of the virtual environment venv next step of the project… Read more