This file contains 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
package org.dejay.javafx.example; | |
import javafx.animation.Transition; | |
import javafx.application.Application; | |
import javafx.collections.ObservableList; | |
import javafx.scene.Node; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Label; | |
import javafx.scene.layout.Region; | |
import javafx.scene.text.Font; |
This file contains 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
/* | |
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 |
This file contains 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
/** | |
* 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> |
This file contains 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
/* | |
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 |
This file contains 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
#include <IRremote.h> | |
/* | |
Send infrared commands from the Arduino to the iRobot Roomba | |
by probono | |
2013-03-17 Initial release | |
This file contains 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 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 | |
This file contains 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
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; |
This file contains 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
//viewDidload | |
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { | |
// iOS 7 | |
[self prefersStatusBarHidden]; | |
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; | |
} else { | |
// iOS 6 | |
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; | |
} |
This file contains 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
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; |
This file contains 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
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de> | |
-- licensed under the terms of the LGPL2 | |
-- character table string | |
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
-- encoding | |
function enc(data) | |
return ((data:gsub('.', function(x) | |
local r,b='',x:byte() |
NewerOlder