This file contains hidden or 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
// Add this to your custom view or render delegate (see comment below for the rest). | |
update: function(jquery) { | |
var fn, key, displayProperties = this.getChangedDisplayProperties() ; | |
for (key in displayProperties) { | |
if (!displayProperties.hasOwnProperty(key)) continue ; | |
if (fn = this[key+'Update']) fn.call(this, jquery, displayProperties[key]) ; | |
} | |
} |
This file contains hidden or 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
// | |
// core_main.c | |
// FOHR | |
// | |
// Created by Erich Ocean on 11/10/10. | |
// Copyright (c) 2010 Erich Atlas Ocean. All rights reserved. | |
// | |
#include "core.h" | |
#include <string.h> // strcmp |
This file contains hidden or 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
// | |
// core_main.c | |
// love | |
// | |
// Created by Erich Ocean on 11/10/10. | |
// Copyright (c) 2010 __MyCompanyName__. All rights reserved. | |
// | |
#include "core.h" | |
#include <Block.h> |
This file contains hidden or 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
typedef void (^myblock)(); | |
myblock[10] makeblocks() | |
{ | |
__block double foo; | |
myblock[10] = malloc(sizeof(myblock) * 10); | |
for (int i = 0; i<10; ++i) { | |
myblock[i] = Block_copy(^{ | |
foo = foo + 1; |
This file contains hidden or 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
/** | |
Invokes the callback for each index. Otherwise works just like regular | |
forEach(). | |
@param {Function} callback | |
@param {Object} target | |
@returns {SC.IndexSet} receiver | |
*/ | |
forEachIndex: function(callback, target) { | |
var content = this._content, |
This file contains hidden or 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
didUpdateLayer: function() { | |
var elem = this.$('canvas'), | |
ctx = elem[0].getContext("2d"), | |
width = this.$().width(), | |
height = this.$().height(), | |
loc = this.get('anchorLocation'), | |
ploc, color, x, y, tmp; | |
// adjust size as needed... | |
if (Number(elem.attr('width')) !== width) elem.attr('width', width); |
This file contains hidden or 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
From 43ed2e9f37751e8ab43a4036186638f19fdcdf7e Mon Sep 17 00:00:00 2001 | |
From: Erich Ocean <[email protected]> | |
Date: Thu, 12 Aug 2010 15:25:52 -0700 | |
Subject: [PATCH] initial ptex support | |
--- | |
src/liboslexec/master.cpp | 8 ++++ | |
src/liboslexec/optexture.cpp | 95 ++++++++++++++++++++++++++++++++++++++++++ | |
src/liboslexec/osl_ptex.h | 66 +++++++++++++++++++++++++++++ | |
src/liboslexec/oslexec_pvt.h | 25 +++++++++++ |
This file contains hidden or 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
// ========================================================================== | |
// Project: hub.js - cloud-friendly object graph sync | |
// Copyright: ©2010 Erich Ocean. | |
// Portions ©2006-2009 Sprout Systems, Inc. and contributors. | |
// Portions ©2008-2009 Apple Inc. All rights reserved. | |
// License: Licensed under an MIT license (see license.js). | |
// ========================================================================== | |
/*global hub */ | |
/** |
This file contains hidden or 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
hub.attr = hub.Record.attr ; | |
hub.toOne = hub.Record.toOne ; | |
hub.toMany = hub.Record.toMany ; |
This file contains hidden or 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
Created by | |
---------- | |
In our schema, we'd like to know who created a specific ``Task``. In hub.js, | |
users are represented as instances of the ``hub.User`` class (or a subclass), | |
and there is an API call to get the ``hub.User`` that created a particular | |
record, so we'll create a computed property that calls that:: | |
TaskList.Task = hub.Record.extend({ | |
isDone: hub.attr(Boolean, { default: false }), |