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
(ns motive.visual.Viewport | |
(:import (com.jme.app BaseSimpleGame) | |
(com.jme.bounding BoundingBox | |
BoundingSphere) | |
(com.jme.math Quaternion Vector3f) | |
(com.jme.scene.shape Box Sphere)) | |
(:gen-class | |
:extends com.jme.app.BaseSimpleGame | |
:init ctor | |
:constructors {[] []} |
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
(ns motive.visual.Viewport | |
(:import (com.jme.app BaseSimpleGame) | |
(com.jme.bounding BoundingBox | |
BoundingSphere) | |
(com.jme.math Quaternion Vector3f) | |
(com.jme.scene.shape Box Sphere)) | |
(:gen-class | |
:extends com.jme.app.BaseSimpleGame | |
:init ctor | |
:constructors {[] []} |
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
;;; In your gen-class: | |
:exposes-methods {update superUpdate | |
render superRender | |
doDebug superDoDebug} | |
;;; Your subclasses update that calls the super's update method which was mapped to | |
;;; superUpdate | |
(defn -update | |
[this #^Float/TYPE interp] | |
(.superUpdate this interp) |
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
(defn domap | |
"A map for side-effects. The argument order is the same as map, but | |
unlike map the function results are not retained. Takes a function | |
followed by any number of collections and applies the function to the | |
first item in each coll, then the second etc. Returns nil." | |
[fn & colls] | |
(let [num-colls (count colls)] | |
(doseq [args (partition num-colls (apply interleave colls))] | |
(apply fn args)))) |
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
// | |
// FileUpload.j | |
// Editor | |
// | |
// Created by Francisco Tolmasky on 03/04/08. | |
// Copyright 2005 - 2008, 280 North, Inc. All rights reserved. | |
// | |
import <Foundation/CPObject.j> | |
import <Foundation/CPValue.j> |
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
;;; Not too bad for a :once fixture | |
(defn test-ns-hook | |
[] | |
(init-db (fn [] (get-tests) | |
(put-tests)))) | |
;;; Gets ugly fast for :each fixtures | |
(defn test-ns-hook | |
[] | |
(init-db (fn [] (get-tests)) |
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
- (void)setSelected:(BOOL)isSelected | |
{ | |
[self setBackgroundColor:isSelected ? [CPColor colorWithPatternImage:[[CPImage alloc] initWithContentsOfFile:"Resources/screen-selection.png" size:CGSizeMake(1.0, 24.0)]] : nil]; | |
} |
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 re | |
test = '<a href="http://m.twitter.com/" rel="nofollow">mobile web</a>' | |
p = re.compile("\<.*[a|A].*\>(.*)\<.*/[a|A].*\>") | |
m = p.match(test) | |
print m.groups()[0] |
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
(defn set-log-level! | |
([level] | |
(set-log-level! [(org.apache.log4j.Logger/getRootLogger)] level)) | |
([loggers level] | |
(let [loggers (map (fn [l] (if (string? l) | |
(org.apache.log4j.Logger/getLogger l) | |
l)) | |
loggers)] | |
(doseq [l loggers] | |
(.setLevel l (case level |
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
;;Steps toward pulling otu composiiton strategy. need to do same for input so calcs ca be push through or pill through. | |
(defn async [f task out] (f task out)) | |
(defn sync [f task out] (out (f task))) | |
(defn in-pool | |
[p f] | |
(fn [& args] | |
(.submit p (fn [] (apply f args))))) | |
;;TODO; unable to shutdown pool. seems recursive fns are not responding to interrupt. http://download.oracle.com/javase/tutorial/essential/concurrency/interrupt.html |
OlderNewer