Skip to content

Instantly share code, notes, and snippets.

View debreuil's full-sized avatar

Robin Debreuil debreuil

View GitHub Profile
var td:TypeDescriptor = new TypeDescriptor();
var s:String = getQualifiedClassName(_classType);
var xml:XML = describeType(s);
var t2:TypeDescriptor = td.fromXML(xml, loaderInfo.applicationDomain);
// t2.description.extendsClass.type == "Object"
// t2.superClasses == ["Object"]
override public function areObjectsEqual(accountVO1:AdminDataVO, accountVO2:AdminDataVO):Boolean
{
var result:Boolean = false;
if( (accountVO1.password == accountVO2.password ) &&
(accountVO1.email == accountVO2.email ) &&
(accountVO1.serverID == accountVO2.serverID ) &&
(accountVO1.dataSetID == accountVO2.dataSetID ) &&
(accountVO1.pluginMixID == accountVO2.pluginMixID ) &&
(accountVO1.adminPluginMixID == accountVO2.adminPluginMixID ) &&
private function compareData(editedVO:AdminDataVO):void
{
var currentStoredVO:AdminDataVO = editingModel.itemBeingEdited;
if(!comparator.areObjectsEqual(currentStoredVO, editedVO))
{
var keepHandler:Function = function():void { editingModel.updateItem(editedVO) };
var discardHandler:Function = function():void {};
@debreuil
debreuil / SevenSegmentDisplay.cs
Created October 30, 2010 21:46
Simulated 7 segment display for Swf2XNA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDW.V2D;
using V2DRuntime.Attributes;
using Microsoft.Xna.Framework.Graphics;
using HeadGame.Screens;
using DDW.Display;
@debreuil
debreuil / gist:724337
Created December 1, 2010 22:19
moveToTL.jsfl
// move all elements selected in the library to 0,0
fl.outputPanel.clear();
var trace = fl.trace;
fl.showIdleMessage(false);
var doc = fl.getDocumentDOM();
var lib = doc.library;
package
{
import Components.KeypadButton;
import DDW.Components.DefaultButton;
import DDW.Screens.Screen;
import flash.display.DisplayObject;
import flash.display.Sprite;
public class Calculator extends Screen
{
void loop()
{
if (Serial.available())
{
char ch = Serial.read();
switch(ch) {
case '0'...'9':
serialReadNum = serialReadNum * 10 + ch - '0';
#include <AFMotor.h>
#include <ServoTimer1.h>
//#define DEBUG 1
int analogPin = 0;
int sensorPin = 2;
int servo1Pin = 9;
AF_Stepper motorX(48, 2);
@debreuil
debreuil / Mario's prime day
Created January 25, 2011 00:32
Seems like I have reached a prime age in a prime year. That's the 5th time in my life. I guess smart people could calculate my age now.
#define TEST
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public class Program
@debreuil
debreuil / papilioAnimatedLEDs.VHD
Created February 27, 2011 05:57
VHDL Papilio LED animation - pattern, speed, direction
-- File: Blink.VHD -------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Blink is
Port (
PB : in STD_LOGIC_VECTOR(7 downto 0);