Dave Deriso, pre: Medical Scientist
Image from Wetsand.com’s surf forecaster. December 2009. The color indicates wave height, and the blobs indicate massive storms the size of the Australian continent.
I dont know if this is normal. But if global warming continues, I have a feeling these little red dots are only going to get bigger and bigger, and hurricane katrina was only the beginning.
Until then, surfs up.

Image from Wetsand.com’s surf forecaster. December 2009. The color indicates wave height, and the blobs indicate massive storms the size of the Australian continent.

I dont know if this is normal. But if global warming continues, I have a feeling these little red dots are only going to get bigger and bigger, and hurricane katrina was only the beginning.

Until then, surfs up.

This was the best gift I could have asked for. I perfected my matrix conversion function in R, now with dynamic variable assignment!! You can tell it works because it goes from FALSE to TRUE, as indicated by the screenshot. Sweet.
Been up all night workin on Dr. Marc Wittmann’s data. Sleepy.
Spent 2 hours today playing with Paulus site’s css. css can suck. Im compensating for its weaknesses with some javascripting.. 1 week in, and IT madness is going strong
Site:2 hours Marc’s Data: 7 hours!

This was the best gift I could have asked for. I perfected my matrix conversion function in R, now with dynamic variable assignment!! You can tell it works because it goes from FALSE to TRUE, as indicated by the screenshot. Sweet.

Been up all night workin on Dr. Marc Wittmann’s data. Sleepy.

Spent 2 hours today playing with Paulus site’s css. css can suck. Im compensating for its weaknesses with some javascripting.. 1 week in, and IT madness is going strong

Site:2 hours
Marc’s Data: 7 hours!

Paulus Lab Website Coded!

Whew! This is my first fully php website. Its way cleaner and more efficient to use php. Each page renders the entire “theme” (all the links, images, css, html) in only 5 lines!! Now thats lightweight coding. I need to make the flash part next.

http://research.davidderiso.com/paulusweb/index.php

Worked on it over the past 2 days, which is about 10 hours..

Woooooo hoooooo! Irrefutable proof that this site is useful. Sweet.

Woooooo hoooooo! Irrefutable proof that this site is useful. Sweet.

This is a video on how body parts are grown with stem cells. There are 2 strategies:

  1. Build a part from scratch (using a mold)
  2. Make the body regrow its own parts (with a chemical that fetuses use to regrow parts before birth)

I highly recommend watching this. It is the future of medicine as we know it.

Props to Robert Koehler for sharing this!

That’s an esoteric question of “why do we do art?” Commerce. I picked graphic design because I wanted a job where i could wear heels to work like my sister.

Memory. This is a subject that’s near and dear to my heart, and because its also my job, its near and dear to my pocketbook.

Bonnie Tanaka (my Typography professor at SMC)

Dr. Douglas Nitz (my Systems Neuroscience professor at UCSD)

Before I took up science, I was pretty sure that I wanted to do art. I eventually decided that it wouldn’t pay the bills so I thought a business career might. Realizing that this was a soul-less endeavor, I went into psychology and though about medicine. After discovering that biology was a painful subject I decided to take a year off and go back into art.

During this year off, I asked a lot of deep questions, and in this case, even questioned art. Bonnie Tanaka was one of the only professors cool enough to give me a straight answer. We do art professionally for commerce.

A lot of friends had told me that art school was lame. That they made you sell your soul. For whatever that meant, I felt like it was a bad idea to try and sell a product of your emotions and creativity. Science seemed immune to such problems.

Tonight, just before bed, I dawned on me that science is not immune. I remembered the first few words of one of Dr. Douglas Nitz’s brilliant systems neuroscience lectures, which I have quoted above. Like graphic design, we do science professionally as commerce.

At the end of the day, I guess there is a difference between truth-seeking and doing professional research just as there is a difference between artistic expression and professional graphic design. Commerce. But does this take away its soul? I don’t know.

IT Madness continues.
Here, I have spent the day designing the feel of the new website. It looks bad ass.
The chemical structures are for methamphetamine, lorazepam, and cocaine. Sweet.
The font is Agrafa-hairline. Its free at myfonts.com
…hundreds of revisions. Simple is difficult to achieve.
13 hours!

IT Madness continues.

Here, I have spent the day designing the feel of the new website. It looks bad ass.

The chemical structures are for methamphetamine, lorazepam, and cocaine. Sweet.

The font is Agrafa-hairline. Its free at myfonts.com

…hundreds of revisions. Simple is difficult to achieve.

13 hours!

Sensation Seeking Application Finished!!!

Thats right, I stayed up all night. 839 lines of code later, I finished the php script that scores Zuckerman’s Sensation Seeking Scale (SSS). The SSS is a neat inventory that basically quantifies how gnarly you are. Zuckerman (1979) has a different percentile distribution because he had a different sample size, it was a different era, and he was in Europe. Dr. Paulus has resampled his inventory with 3000 people, in this era, and in California! So, the results that you get from this application are actually VERY good!!!!

Enjoy!

http://research.davidderiso.com/survey/SSS.html

By the way, I’m apparently off the deep end of Sensation Seeking, I am in the 99.4th percentile. Swweet!

Here’s my data:

This took 9 hours and knocks off the second project I have completed for IT Madness!!

Super Simple AS3 Webcam Uploader

This here script does what everybody’s been looking for. A simple flash webcam app that uploads images from your webcam to the web. It also lets you download the image you just took.

Here’s a working demo.

Here’s the source files.

Here’s how it works:

  1. The flash code creates the camera and takes the picture as bitmapdata
  2. This bitmapdata is fed into a jpeg encoder (in the flash app)
  3. The encoded jpeg is then pushed out of flash into a php script on your server
  4. The php script saves a copy on the server and then pops up a download link

Here is the code:

AS3:

	package  {

		import fl.controls.Button;
		import fl.controls.TextArea;
		import flash.display.LoaderInfo;
		import flash.display.BitmapData;
		import flash.display.Bitmap;
		import flash.display.MovieClip;
		import flash.display.Stage;
		import flash.display.StageAlign;
	        import flash.display.StageScaleMode;	
		import flash.events.MouseEvent;
		import flash.events.StatusEvent;
		import flash.geom.Matrix;
		import flash.media.Camera;
		import flash.media.Video;
		import flash.net.navigateToURL;
		import flash.net.URLRequest;
		import flash.net.URLLoader;
	        import flash.net.URLRequestHeader;
	        import flash.net.URLRequestMethod;
		import flash.utils.ByteArray;
		import com.adobe.images.JPGEncoder;


		public class WebCamUploader extends MovieClip {

			// public Properties:
			public var spinner:Spinner;
			public var video:Video;
			public var camera:Camera;
			public var bitmap:Bitmap;
			public var bitmapData:BitmapData;
			public var snapShot:BitmapData;
			public var xVar:Number;
			public var yVar:Number;
			public var inventoryName:String;

			public function WebCamUploader() { 
				configUI();
			}

			public function configUI():void {
				stage.scaleMode = StageScaleMode.NO_SCALE;
				stage.align = StageAlign.TOP_LEFT;

				inventoryName_txt.text = "enter part # here";

				spinner = new Spinner();
				spinner.x = 214 - spinner.width >> 1;
				spinner.y = 255 - spinner.height - 40 >> 1;

				uploadPic.addEventListener(MouseEvent.MOUSE_UP, uploadPhoto, false, 0, true);
				deletePic.addEventListener(MouseEvent.MOUSE_UP, deletePhoto, false, 0, true);
				takePic.addEventListener(MouseEvent.MOUSE_UP, takeSnapShot, false, 0, true);

				connectCamera();
			}

			public function connectCamera():void {
				camera = Camera.getCamera();
				camera.setQuality(0, 100);
				camera.setMode(500, 500, 5, true);

				xVar = (500 - camera.width)/2;
				yVar = 26 + (500 - camera.width)/2;

				if (camera != null) {
	                video = new Video(camera.height, camera.width);
					video.attachCamera(camera);
					video.x = xVar;
					video.y = yVar;
					addChild(video);

					camera.addEventListener(StatusEvent.STATUS, onCameraStatus, false, 0, true);

					size_txt.text = "h: "+ camera.height + " w: " + camera.width + " fps: 5";
	            } else {
	                //handleError(false, "Error, You need a camera.");
	            }
			}

			public function onCameraStatus(p_event:StatusEvent):void {
				camera.removeEventListener(StatusEvent.STATUS, onCameraStatus);

				switch (p_event.code) {
					case "Camera.Muted":
						//handleError(false, "Error, Camera not found or denied. Unable to use Application. \nTo allow the Camera, reload the page.");
					case "Camera.Unmuted":
						// Camera accepted and Successfull;
						break;
				}
			}

			public function takeSnapShot(event:MouseEvent):void {

				snapShot = new BitmapData(video.width, video.height);
				snapShot.draw(video, new Matrix());
				bitmapData = snapShot;
				bitmap = new Bitmap(snapShot,"auto", true);

				bitmap.x = xVar;
				bitmap.y = yVar;

				addChild(bitmap);			
			}

			public function deletePhoto(event:MouseEvent):void {
				removeChild(bitmap);
			}

			public function uploadPhoto(event:MouseEvent):void {
				showSpinner(true);
				uploadPhotoPhp();
			}

			public function uploadPhotoPhp():void {

				var jpgEncoder:JPGEncoder = new JPGEncoder(85);
				var jpgStream:ByteArray = jpgEncoder.encode(bitmapData);
				var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");

				if (inventoryName_txt.text == "enter part # here")
				{
					inventoryName = "part";
				}else
				{
					inventoryName = inventoryName_txt.text;
				}

				var jpgURLRequest:URLRequest = new URLRequest("jpg_encoder_download.php?name="+inventoryName+".jpg");

				jpgURLRequest.requestHeaders.push(header);
				jpgURLRequest.method = URLRequestMethod.POST;
				jpgURLRequest.data = jpgStream;
				navigateToURL(jpgURLRequest, "_blank");
				showSpinner(false);
				removeChild(bitmap);
			}

			public function showSpinner(p_loading:Boolean):void {
				if(p_loading) {
					addChild(spinner);
					spinner.play();
				} else {
					removeChild(spinner);
					spinner.stop();
				}
			}


		}
	}

PHP:

<?php

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
	
	date_default_timezone_set('PST');
	$today = date("M-j-Y-H-i-s");
	
	$filename = $_GET['name'];
	
	if ($filename == "part.jpg")
	{
		$filename = "part-".$today.".jpg";
	}
	
	$filepath = "../parts/".$filename;
	
	// get bytearray
	$im = $GLOBALS["HTTP_RAW_POST_DATA"];
	
	// add headers for download dialog-box
	header('Content-Type: image/jpeg');
	header("Content-Disposition: attachment; filename=".$filename);
	
	$fd = fopen($filepath,"w");
	fputs($fd,$im);
	fclose($fd);
	
	echo $im;
	
}  else echo 'An error occured.';

?> 

Credits:

Webcam AS3 code adapted from GK Sinner and Adobe: link

Encoding and passing the bitmap data to PHP for download adapted from Henry Jones: link

The rest was figured out by experimentation.

IT Database Finished!

Sweeeeeeeet!!! Just fixed a ton of bugs and made it look awesomer.

Improvements:

  1. Wrote a flash webcam image uploader that automatically save the image from your webcam to the proper item in the database (AS3 kicks ass!!). This addressed the issue of how to allow anyone to put images in the database. This is sustainable, so when Im gone, the next guy can keep the database strong
  2. Resized columns, such as the Description column, so I can record more stuff, like IPs
  3. Improved the database updater GUI so its more user friendly
  4. Created an Iframe link on the lab’s site so people have access

Total of 13 hours!

Here’s the webcam uploader:

heres the actual database browser

heres the database updater (i designed it to look like a spreadsheet):