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
// | |
// 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
// | |
// 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
// 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
sc_require('controllers/mailboxes'); | |
sc_require('controllers/messages'); | |
SC.mixin(OI, { | |
registerStatechartObservers: function() { | |
var fun = this.folderSelectionDidChange ; | |
OI.foldersController.addObserver('selection', this, fun) ; | |
this.__mailboxesControllers__ = {} ; |
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
messages: SC.RecordAttribute.create({ | |
toType: function(record, key, value) { | |
var ary = record._messages ; | |
if (!ary) { | |
console.log('creating a messages query for Mailbox[%@]'.fmt(record.get('guid'))); | |
CoreOI.Record.messages++ ; | |
ary = record._messages = record.get('store').findAll(SC.Query.create({ | |
recordType: 'CoreOI.Message', | |
conditions: "mailbox = %@", | |
parameters: [record], |
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 Bindings | |
this.bindings = []; // will be filled in by the bind() method. | |
if (keys = this._bindings) { | |
for(loc=0, keysLen = keys.length; loc < keysLen;loc++) { | |
// get propertyKey | |
key = keys[loc] ; value = this[key] ; | |
propertyKey = key.slice(0,-7) ; // contentBinding => content | |
this[key] = this.bind(propertyKey, value) ; | |
} | |
} |
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
# An ordered list of files in ../src that are concatenated to produce hub.js, | |
# one file per line. Lines beginning with # are skipped. On node.js, the | |
# index.js file uses the contents of this file to assemble hub.js dynamically | |
# during development. | |
# | |
# To generate a custom build of hub.js, modify this BUILD file to include the | |
# list of files you need/want in the correct order. | |
# | |
# NOTE: In a production build, lines matching /^development[/].*/ will be | |
# skipped, and calls to hub_assert(), hub_precondition(), hub_postconditon(), |
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). | |
// ========================================================================== | |
function Program(str){ | |
var tbl=[],pos=0,l=str.length+1;while(l--)tbl.push([]);l=str.length; |
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
/* PEG → JavaScript parser generator, with its dependencies. | |
* See http://inimino.org/~inimino/blog/peg_first_release */ | |
var sys = require('sys') ; | |
;(function(exports){ | |
exports.generateParser=generateParser | |
exports.generateParserThrowing=generateParserThrowing |