-
First, install the cpptools extension in studio code
-
Then add the include paths in the c_cpp_properties.json file.
If a small light bulb icon (💡) appears near the include statements on any of your source file, just click it in order to access the c_c_pp_properties.json file.
If there's no 💡 icon, then in the project directory create a hidden folder called vscode:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * SD card attached to SPI bus as follows: | |
| ** MOSI - pin 11 | |
| ** MISO - pin 12 | |
| ** CLK - pin 13 | |
| ** CS - pin 4 | |
| */ | |
| // PINS | |
| #define CS_PIN 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * SD card attached to SPI bus as follows: | |
| ** MOSI - pin 11 | |
| ** MISO - pin 12 | |
| ** CLK - pin 13 | |
| ** CS - pin 4 | |
| */ | |
| // PINS | |
| #define CS_PIN 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * SD card attached to SPI bus as follows: | |
| ** MOSI - pin 11 | |
| ** MISO - pin 12 | |
| ** CLK - pin 13 | |
| ** CS - pin 4 | |
| */ | |
| // PINS | |
| #define CS_PIN 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| @title : FUNCTIONAL. Initial study | |
| @date : 27/01/2018 | |
| @author: vvz3n | |
| /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ | |
| import peasy.*; | |
| import controlP5.*; | |
| PeasyCam cam; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # see https://en.wikipedia.org/wiki/Spherical_coordinate_system | |
| def spherical_to_cartesian(lat, lon, radius): | |
| latitude = math.radians(lat) | |
| longitude = math.radians(lon) | |
| x = radius * math.sin(latitude) * math.cos(longitude) | |
| y = radius * math.sin(latitude) * math.sin(longitude) | |
| z = radius * math.cos(latitude) | |
| return x, y, z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void ofApp::exportPlyCloud(ofMesh pcMesh, string filename){ | |
| ofFile ply; | |
| if(ply.open(filename, ofFile::WriteOnly)){ | |
| // write the header | |
| ply << "ply" << endl; | |
| ply << "format binary_little_endian 1.0" << endl; | |
| ply << "element vertex " << pcMesh.getVertices().size() << endl; | |
| ply << "property float x" << endl; | |
| ply << "property float y" << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| osascript -e 'display notification "Starting uTorrent from crontab" with title "Launching uTorrent"' && open -a "uTorrent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Everything is like before, we have only modified these 2 methods | |
| // 1. Method for generating a mitchell best candidate. v2 : NOW WITH DIFFERENT RADII INCLUDED! | |
| // PackedCircle is just a wrapper for a 2d point with a radius and the methods for drawing it | |
| PackedCircle ofApp::getMitchellBestCandidate(){ | |
| // The more time has past, the more I want to pick smaller radii | |
| float maxRunTime = 30 * 1000; // time in ms | |
| float randomMin = maxRunTime / ofGetElapsedTimeMillis() / 2; | |
| // If anything goes below 4, clamp it to 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Algorithm is divided in 4 parts | |
| // 1. Method for generating a mitchell best candidate | |
| // PackedCircle is just a wrapper for a 2d point with a radius and the methods for drawing it | |
| PackedCircle ofApp::getMitchellBestCandidate(){ | |
| float greatestDistance = 0.0f; | |
| PackedCircle winningSample; | |
| // Init at (0,0) with radius of 0 | |
| winningSample.setup(ofPoint(0,0), 0.0f); |