Skip to content

Instantly share code, notes, and snippets.

BoundingSphere bounds = new BoundingSphere(new Point3d(), Math.MAX_DOUBLE) //
Background backg = new Background (c)
backg.setApplicationBounds (bounds)
scene.addChild (backg)
TextumlParser.start_return r = parser.start();
if (!parser.messages.isEmpty ())
@header {
import java.util.Vector;
}
@members {
private Vector <Configuracion> configuraciones = new Vector ();
private Vector <Geometria> geometrias = new Vector ();
//Aqui tambien puedes declarar funciones
<div class='rtMatcher'><a href='http://www.ringtonematcher.com/co/ringtonematcher/02/noc.asp?sid=WILWros&amp;artist=MGMT&amp;song=Kids' target='_blank'><img src='http://images.wikia.com/lyricwiki/images/phone_left.gif' alt='phone' width='16' height='17'/></a> <a href='http://www.ringtonematcher.com/co/ringtonematcher/02/noc.asp?sid=WILWros&amp;artist=MGMT&amp;song=Kids' target='_blank'>Send "Kids" Ringtone to your Cell</a> <a href='http://www.ringtonematcher.com/co/ringtonematcher/02/noc.asp?sid=WILWros&amp;artist=MGMT&amp;song=Kids' target='_blank'><img src='http://images.wikia.com/lyricwiki/images/phone_right.gif' alt='phone' width='16' height='17'/></a></div>You were a child
Crawling on your knees toward it
Making Mama so proud
But your voice was too loud
We liked to watch you laughing
You picked the insects off plants
No time to think of consequences
Control yourself
Take only what you need from it
case class Ray( origin:Point3d, direction:Vector3d )
public class Image {
int width;
int height;
Point3i [][] image = null;
public Image(int width, int height) {
this.width = width;
this.height = height;
image = new Point3i[width][height];
for (int i = 0; i < width; i++) {
public class Image {
int width;
int height;
Point3i [][] image = null;
public Image(int width, int height) {
this.width = width;
this.height = height;
image = new Point3i[width][height];
for (int i = 0; i < width; i++) {
sealed case class Sphere (center:Vector3d , radius: Double) extends Geometry
{
def intersect (r:Ray, h:Hit, range:Range,material:Color3f): Option [(Hit,Range)]=
{
var v = new Vector3d ( r.origin.x - center.x , r.origin.y - center.y,r.origin.z - center.z);
var discriminant = pow (v.dot (r.direction),2.0) - (pow (v.dot(v),2) - pow (radius,2));
if (discriminant >= 0 )
{
//var t1 = -(v.dot(r.direction)) + sqrt (discriminant);
qs (x:xs) = filter (\x -> x < xs) xs ++ x ++ (filter (\x -> x > xs))
Point Free
qs = ap (liftM2 (++) (filter =<< flip (<)) . (. (filter . flip (>))) . (++) . head) tail
perm :: MonadPlus m => [a] -> m [a]
perm [] = return []
perm (x:xs) = do ys <- perm xs
zs <- insert x ys
return zs
insert :: MonadPlus m => a -> [a] -> m [a]
insert x xs = (return (x:xs))
`mplus` case xs of
[] -> mzero