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)
| /* | |
| 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 |
| /** | |
| * 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> |
| /* | |
| 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 |
| #include <IRremote.h> | |
| /* | |
| Send infrared commands from the Arduino to the iRobot Roomba | |
| by probono | |
| 2013-03-17 Initial release | |
| /* | |
| 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 | |
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 |
| import javafx.application.Application; | |
| import javafx.collections.FXCollections; | |
| import javafx.event.EventHandler; | |
| import javafx.geometry.Insets; | |
| import javafx.geometry.Pos; | |
| import javafx.scene.*; | |
| import javafx.scene.chart.*; | |
| import javafx.scene.control.Label; | |
| import javafx.scene.input.MouseEvent; | |
| import javafx.scene.layout.VBox; |
| //viewDidload | |
| if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { | |
| // iOS 7 | |
| [self prefersStatusBarHidden]; | |
| [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; | |
| } else { | |
| // iOS 6 | |
| [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; | |
| } |
| package org.dejay.prism.opengl; | |
| import com.sun.glass.ui.Screen; | |
| import com.sun.javafx.geom.Rectangle; | |
| import com.sun.javafx.geom.transform.BaseTransform; | |
| import com.sun.javafx.logging.PlatformLogger; | |
| import com.sun.prism.CompositeMode; | |
| import com.sun.prism.RenderTarget; | |
| import com.sun.prism.Texture; | |
| import com.sun.prism.camera.PrismCameraImpl; |