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 class DataHandler extends EventDispatcher { | |
private static var _instance:DataHandler; | |
private static var allowInstantiation:Boolean; | |
private var xmlPath:String; | |
private var xml:XML; | |
private var xmlLoader:URLLoader; | |
private static var _xmlpath:String; | |
public function setXMLPath (thisXML:String) : void { | |
_xmlpath = thisXML; |
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 class DataHandler extends EventDispatcher { | |
private static var _instance:DataHandler; | |
private static var allowInstantiation:Boolean; | |
private var xmlPath:String; | |
private var xml:XML; | |
private var xmlLoader:URLLoader; | |
private static var _xmlpath:String; | |
public function setXMLPath (thisXML:String) : void { | |
_xmlpath = thisXML; |
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
class Recipe < MongoRecord::Base | |
collection_name :recipes | |
fields :name, :directions, :words | |
def to_s | |
"recipe: #{name} directions: #{directions[0..20]}..." | |
end | |
def Recipe.make collection, name, directions | |
collection.insert({:_id => Mongo::ObjectID.new, :name => name, | |
:directions => directions, | |
:words => (name + ' ' + directions).split.uniq}) |
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
if(strcasecmp(get_class($id), "mongoid")) { | |
$_id = $_id->{'$id'}; | |
} | |
$this->data=Db::$tours->findOne(array('_id'=>new MongoId($_id))); |
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
E.add('loan-calculator-flash', 'click', function (event) { | |
E.preventDefault(event); | |
swfobject.embedSWF("/assets/calc/calculator.swf", "flashcontentLoan", "870", "540", "8.0.0", "expressInstall.swf", { | |
'url': "/assets/calc/loan.swf", | |
'calc': "Loan", | |
'LowAPR': C.getLowAPR(), | |
'HighAPR': C.getHighAPR(), | |
'LoanAmount': C.getLoanAmount(), | |
'term': C.getTerm(), | |
'debtList': C.getCreditorAmount(), |
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
class RC4(object): | |
#initilization- take in the key and assign it | |
def __init__(self, key): | |
self._key = key | |
def _setKey(self, key): | |
self._key = key | |
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
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#define MAX_DATA 512 | |
#define MAX_ROWS 100 | |
struct Address { |
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
global quit_after, check_every | |
set quit_after to 900 | |
set check_every to 10 | |
display dialog "Check is performed every " & check_every & " seconds. Adium will be quit after " & quit_after & " seconds of system inactivity." | |
on reopen | |
display dialog "Check is performed every " & check_every & " seconds. Adium will be quit after " & quit_after & " seconds of system inactivity." | |
end reopen |
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
//from inside the view | |
undelegateEvent: function(event) { | |
this.undelegateEvents(); | |
var events = _.clone(this.events); | |
delete events.event; | |
this.delegateEvents(events); | |
} |
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
p.hitPoint = function (tX, tY) { | |
return this.hitRadius(tX, tY, 0); | |
} | |
p.hitRadius = function (tX, tY, tHit) { | |
//early returns speed it up | |
if (tX - tHit > this.x + this.hit) { | |
return; | |
} |
OlderNewer