Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| import eu.mihosoft.vrl.v3d.Cube as Cube | |
| #print dyio | |
| csg = Cube(20).toCSG() | |
| print "Result = ",csg |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| /* | |
| Algorithm is exponential - very bad. It is just meant to exercise the CPU a bit and | |
| to see what happens with different languages. Not representative of real code. | |
| Interesting that Java beats C, thanks to HotSpot. I expected Swift to be as fast as C | |
| at least. I also expected the compiled Swift to be faster than when run as a script. | |
| A bit disappointed, but more time needed to see where the bottlenecks are. Plus I | |
| need to run some real code for benchmarking. | |
| Update: swiftc -O improved the speed quite a bit to be about the same speed as Java | |
| #include <IRremote.h> | |
| /* | |
| Send infrared commands from the Arduino to the iRobot Roomba | |
| by probono | |
| 2013-03-17 Initial release | |
| /* | |
| A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba | |
| ---------------------------------------------------------------- | |
| Based on information found at: | |
| http://sites.google.com/site/irobotcreate2/createanirbeacon | |
| Uses "A Multi-Protocol Infrared Remote Library for the Arduino": | |
| http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html |
| /** | |
| * Unescapes a string that contains standard Java escape sequences. | |
| * <ul> | |
| * <li><strong>\b \f \n \r \t \" \'</strong> : | |
| * BS, FF, NL, CR, TAB, double and single quote.</li> | |
| * <li><strong>\X \XX \XXX</strong> : Octal character | |
| * specification (0 - 377, 0x00 - 0xFF).</li> | |
| * <li><strong>\uXXXX</strong> : Hexadecimal based Unicode character.</li> | |
| * </ul> |
| /* | |
| Truncated octahedron. | |
| */ | |
| module truncocta() { | |
| // octahedron based on code by Willliam A Adams | |
| octapoints = [ | |
| [+1, 0, 0], // + x axis | |
| [-1, 0, 0], // - x axis | |
| [0, +1, 0], // + y axis |