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
float ticker = 0f; | |
public PerspectiveCamera camera; | |
public Scenario(myGame _game, GameScreen _game_screen) { | |
camera = new PerspectiveCamera( 46.596f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); | |
camera.rotate(180f, 0f,1f,0f); | |
camera.position.set(scene.camera[0], scene.camera[1], scene.camera[2]); | |
public void render(){ |
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
public ShaderProgram MakeShader(){ | |
String vertexShader = | |
"attribute vec4 " + ShaderProgram.POSITION_ATTRIBUTE + ";\n" | |
+ "attribute vec4 a_color ; \n" | |
+ "varying vec4 v_color ; \n" | |
+ "uniform mat4 u_worldView;" | |
+ "void main() \n" | |
+ "{ v_color = a_color; \n" | |
+ " gl_Position = a_position * u_worldView; \n" |
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
def do_magic(context): | |
lights = [] | |
for o in context.scene.objects: | |
if o.type == "LAMP": | |
lights.append(o) | |
print(lights) | |
obj = context.active_object | |
bm = bmesh.new() | |
mesh = obj.data | |
bm.from_mesh(mesh) |
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 calc-socket [proxy] | |
(let [direction (state proxy :tag) | |
weight (state proxy :weight) | |
node (GET-N (:parent proxy)) | |
value (state node :value) | |
inputs (state proxy :in) | |
outputs (state proxy :out)] | |
(cond | |
(= :in direction) (dorun |
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
; Problem 1 WRONG ANSWER | |
(defn accept-n [n] | |
(cond (== 0 (mod n 3)) n | |
(== 0 (mod n 5)) n | |
:else 0)) | |
; First used inc 0 and take 999, off by one :( | |
; Not sure why it's still messing up | |
(apply + (map accept-n (take 1000 (iterate inc 1)))) |
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 ticker2 [data owner] | |
(reify | |
om/IInitState | |
(init-state [_] {:s 0}) | |
om/IRender | |
(render [_] | |
(let [state (om/get-state owner)] | |
(dom/ul #js {:onClick #(om/transact! data :t inc)} | |
(dom/li nil (str "data: " (:t data )) ) | |
(dom/li nil (str "state: " (:s state )) )) )))) |
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 examples.events.core | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true])) | |
(enable-console-print!) | |
(defn ticker [data owner opts] | |
(reify | |
om/IInitState | |
(init-state [_] |
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 examples.events.core | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true])) | |
(enable-console-print!) | |
(defn ticker [data owner] | |
(reify | |
om/IInitState | |
(init-state [_] |
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
"will-mount: get-state: " {:s 0} " get-render-state: " {:s 0} core.cljs:55 | |
"render-state: get-state: " {:s 0} " get-render-state: " {:s 0} core.cljs:55 | |
"should-update: get-state: " {:s 0} " get-render-state: " {:s 0} core.cljs:55 | |
"render-state: get-state: " {:s 0} " get-render-state: " {:s 0} core.cljs:55 | |
"did-update: set-state!" core.cljs:55 | |
"did-update: get-state: " {:s 1} " get-render-state: " {:s 0} core.cljs:55 | |
"------------------" core.cljs:55 | |
"should-update: get-state: " {:s 1} " get-render-state: " {:s 0} core.cljs:55 | |
"render-state: get-state: " {:s 1} " get-render-state: " {:s 1} core.cljs:55 | |
"did-update: set-state!" core.cljs:55 |
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
(sug/defcomp report | |
[data owner] | |
{:render-state | |
(fn [_ state] | |
(dom/li nil (prn-str (str (rand-int 100)) data) ))}) | |
(sug/defcomp button | |
[data owner] | |
{:render-state |
OlderNewer