<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>im a premed going for an md/phd in neuroscience. this is my research blog. best enjoyed while wearing a lab coat and goggles

</description><title>Dave Deriso, pre: Medical Scientist</title><generator>Tumblr (3.0; @deriso)</generator><link>http://davidderiso.com/</link><item><title>FSL rotate_bvec</title><description>&lt;p&gt;This script was bothering me.&lt;/p&gt;
&lt;p&gt;Its designed to modify your b-values after your correct your DTI data for eddy currents. Really simple script, yet I couldn’t get it to work! It was sitting there between me and my data. Nothing survives that position for long.&lt;/p&gt;
&lt;p&gt;So, I took it apart and found weird syntax errors and mismatched storing (ie. the files it created in one function were given an address, and the next function used a different address to find the files… non-existant file errors galore). The mismatched storing was the main problem. I also noticed that the if statements weren’t always properly terminated with “fi”, but were ended with “done.” I dont know if that makes a difference, but I found it odd and fixed that too.&lt;/p&gt;
&lt;p&gt;So, I spent a few hours cleaning it up and now it works great! I also added a few touches:&lt;/p&gt;
&lt;p&gt;-file type protection (checks file extensions, so you dont run the wrong file type)&lt;br/&gt;-better naming system (labels the file you just modified -&gt; data_rot.bvec instead of renaming the old file to data.bvec_old)&lt;br/&gt;-cleaner temporary file creation and storage (the main issue)&lt;br/&gt;-progress indicators so you know that its doing something&lt;br/&gt;-tells you that its done, so your not left guessing “did it work?”&lt;/p&gt;
&lt;p&gt;FSL is a great toolkit. Im glad I could contribute, and I will be sure to again!! I hope I didnt screw anything up :)&lt;/p&gt;
&lt;p&gt;Sweeet&lt;/p&gt;</description><link>http://davidderiso.com/post/436559018</link><guid>http://davidderiso.com/post/436559018</guid><pubDate>Tue, 09 Mar 2010 01:31:00 -0800</pubDate></item><item><title>Wireless EEG Part 2</title><description>&lt;p&gt;So, after my last (lengthy) post on why the older NeuroSky headset is no good, I contacted the VP of R&amp;D and explained the problem. A newer version should be in the mail shortly. I’ll let you know how it goes. Looks like the company has good support :)&lt;/p&gt;
&lt;p&gt;I also managed to convince the Ramachandran lab that the new 14 channel Emotiv Epoc is the way to go. We will be ordering the research edition. I’ll post my review of that as well.&lt;/p&gt;
&lt;p&gt;Dr. Pineda and I spoke this morning, and it looks like a 3rd company with a 16 channel wireless EEG will enter the testing arena shortly. This one sounds promising as it is aimed at the medical sector. We’ll see if that makes a big difference or not.&lt;/p&gt;
&lt;p&gt;I have a meeting with a well known researcher at the Swartz Institute tomorrow morning to discuss a new project that I just got funds for… a new better than the rest wireless EEG.&lt;/p&gt;
&lt;p&gt;I guess this will be a fun summer :)&lt;/p&gt;</description><link>http://davidderiso.com/post/436553047</link><guid>http://davidderiso.com/post/436553047</guid><pubDate>Tue, 09 Mar 2010 01:25:47 -0800</pubDate></item><item><title>SO, this one is a little more fun than usual. Its a...</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_kyotrwTmWW1qatecqo1_500.png"/&gt;&lt;br/&gt; my software screenshot&lt;br/&gt;&lt;br/&gt; &lt;img src="http://26.media.tumblr.com/tumblr_kyotrwTmWW1qatecqo2_400.jpg"/&gt;&lt;br/&gt; NeuroSky 'MindSet'&lt;br/&gt;&lt;br/&gt; &lt;img src="http://25.media.tumblr.com/tumblr_kyotrwTmWW1qatecqo3_500.jpg"/&gt;&lt;br/&gt; what it looks like to wear&lt;br/&gt;&lt;br/&gt; &lt;img src="http://25.media.tumblr.com/tumblr_kyotrwTmWW1qatecqo6_r1_500.jpg"/&gt;&lt;br/&gt; what a real eeg looks like to wear&lt;br/&gt;&lt;br/&gt; &lt;img src="http://24.media.tumblr.com/tumblr_kyotrwTmWW1qatecqo7_r1_500.jpg"/&gt;&lt;br/&gt; emotiv 'epoc' headset (intense!)&lt;br/&gt;&lt;br/&gt; &lt;p&gt;SO, this one is a little more fun than usual. Its a single-channel EEG headset called the NeuroSky ‘Mindset’ and its an interesting concept. The idea is to use the ‘mindset’ as a BCI (brain-computer-interface) for video games. Mattel has taken off with the idea, and according to some rating system, was given toy of the year for it. As a neuroscience student, i am happy to see people interested in this area, but i have to put out a warning, this thing has its limitations -and they are significant.&lt;/p&gt;
&lt;p&gt;There are apparently several versions of the ‘mindset’ floating around and not all of them are compatable with the latest software. My headset was given to me by the Ramachandran Lab and the Pineda Lab to develop off of. I guess its an older version, so it doesnt work so well with the newer drivers. So, Im limited to 1Hz resolution of already fast-fourier transformed data (power levels for 8 different ranges: delta, theta, high alpha, low alpha, high beta, low beta, high gamma, low gamma). Not so useful for research that generally uses raw data at 100-120Hz. Although it is possible to get the raw data at a decent frequency, I am still not to keen on the fact that its a single electrode and theres no real way to measure impedence. The labs have their own ideas though, we’ll see how they turn out.&lt;/p&gt;
&lt;p&gt;Theres apparently a few pre-processing steps that abstract the data coming from the device from anything natural. Its best explained below.&lt;/p&gt;
&lt;p&gt;Taken from the NeuroSky website:&lt;/p&gt;
&lt;p&gt;“&lt;i&gt;Typically, power spectrum band powers would be reported in units such as Volts-squared per Hz (V^2/Hz), but since our values have undergone a number of complicated transforms and rescale operations from the original voltage measurements, there is no longer a simple linear correlation to units of Volts. Hence, we do not try to label them with any conventional unit. You can think of them as ASIC_EEG_POWER units, if you must.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;The reason we say they are only meaningful compared to each other and to themselves is primarily due to the fact they have their own units as described above. It would not necessarily be meaningful nor correct to directly compare them to, say, values output by another EEG system. In their currently output form, they are useful as an indication of whether each particular band is increasing or decreasing over time, and how strong each band is relative to the other bands.&lt;/i&gt;”&lt;/p&gt;
&lt;p&gt;The bottom line is that while the headset may be cool and fun, its not a research tool. There are other headsets, particularly the emotiv epoch system, that are closer to a potential research apparatus. I really like the emotiv system. It has more electrodes, gyroscopes, has algorithms for decoding facial emotion, and seems to be a more rigorously tested piece of hardware as all of the specs are available - and they seem to translate into real units. Also it boasts Allen Snyder, a famous neuroscientist, as a co-founder. In addition, the research edition is compatible with the standard EEGlab matlab toolkit. Total cost for the research edition is $750 (the consumer version is only $299, but doesn’t include the cool software that comes with the research ed). The neurosky mindset is consumer-priced at $199. Ill probably use some of the money that i earned developing for this project to either buy an emotiv or build my own ‘better than the rest’ version.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;However&lt;/b&gt;. This marks the very first neuro-feedback application I have ever written. I plan to design and build my own wireless eeg headset with active dry electrodes and get the whole 10-20 system in. Once this is built, I can come back to my software and make it better.&lt;/p&gt;
&lt;p&gt;My software currently does:&lt;/p&gt;
&lt;p&gt;connects to the port where the bluetooth is forwareded from&lt;br/&gt;does a handshake&lt;br/&gt;checks for errors&lt;br/&gt;if the data is good, parses the packets&lt;br/&gt;outputs each received data point into a csv file&lt;br/&gt;bar charts the power spectrum so you can see the values change&lt;br/&gt;allows you to scale the various frequencies to the window&lt;br/&gt;sweet&lt;/p&gt;</description><link>http://davidderiso.com/post/423418134</link><guid>http://davidderiso.com/post/423418134</guid><pubDate>Tue, 02 Mar 2010 19:59:00 -0800</pubDate></item><item><title>wow.
this would make a great logo for the us treasury...</title><description>&lt;img src="http://28.media.tumblr.com/p83ErimrGq8jn2boQAln84TWo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;wow.&lt;/p&gt;
&lt;p&gt;this would make a great logo for the us treasury department.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://movetofit.tumblr.com/post/387763222/elvendorkette-sunscorchx-cheekychen-via" target="_blank"&gt;movetofit&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://elvendorkette.tumblr.com/post/386215413" target="_blank"&gt;elvendorkette&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://sunscorchx.tumblr.com/post/256228318/cheekychen-via-veronicalikesyou-this-is-one" target="_blank"&gt;sunscorchx&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://cheekychen.tumblr.com/post/252271975/via-veronicalikesyou" target="_blank"&gt;cheekychen&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(via &lt;a href="http://veronicalikesyou.tumblr.com/" target="_blank"&gt;veronicalikesyou&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is one of the most awesome photos I have ever seen. Ever.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Oh. Woah.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;</description><link>http://davidderiso.com/post/411193635</link><guid>http://davidderiso.com/post/411193635</guid><pubDate>Thu, 25 Feb 2010 06:19:00 -0800</pubDate></item><item><title>My schedule for Winter 2010. This will change when the quarter...</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kwvmhtb7xp1qatecqo1_r1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;My schedule for Winter 2010. This will change when the quarter ends on March 20th.&lt;/p&gt;
&lt;p&gt;Courses:&lt;/p&gt;
&lt;p&gt;Advanced Research Methods 5&lt;br/&gt;FMRI Research Design and Analysis 4&lt;br/&gt;Intro to Counseling and Therapy 3&lt;br/&gt;Sensation and Perception (a certain NIH internship requires it) 3 &lt;br/&gt;Honors Thesis 4&lt;strike&gt;&lt;br/&gt;Natural Disasters (so I can graduate)&lt;/strike&gt; Petitioned out!!!&lt;br/&gt;American Literature (so I can graduate) 3&lt;br/&gt;International Politics  (so I can graduate) 4&lt;br/&gt;History of Cinema  (so I can graduate) 3&lt;br/&gt;Post-Restoration American History  (so I can graduate) 3&lt;/p&gt;
&lt;p&gt;Total: 32 units&lt;/p&gt;</description><link>http://davidderiso.com/post/354998468</link><guid>http://davidderiso.com/post/354998468</guid><pubDate>Tue, 26 Jan 2010 14:58:00 -0800</pubDate></item><item><title>About as useful as it gets. Basically an itunes for articles....</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kwq3g8Ldmn1qatecqo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;About as useful as it gets. Basically an itunes for articles. Tell anyone you know who wears a lab coat. They will love you.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mekentosj.com/papers/" target="_blank"&gt;http://mekentosj.com/papers/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks to Dr. Colm Connolly, a new postdoc in the Paulus lab who is amazingly knowledgeable about almost anything neuroscience!&lt;/p&gt;</description><link>http://davidderiso.com/post/349686669</link><guid>http://davidderiso.com/post/349686669</guid><pubDate>Sat, 23 Jan 2010 15:19:20 -0800</pubDate></item><item><title>This is pretty cool. Since CSS SUCKS at adjusting to screen...</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_kviyjvuIdp1qatecqo1_500.png"/&gt;&lt;br/&gt; home page&lt;br/&gt;&lt;br/&gt; &lt;img src="http://26.media.tumblr.com/tumblr_kviyjvuIdp1qatecqo6_r1_500.png"/&gt;&lt;br/&gt; content pages&lt;br/&gt;&lt;br/&gt; &lt;p&gt;This is pretty cool. Since CSS SUCKS at adjusting to screen size, I wrote a javascript app that basically forces certain divs to expand to the page size. Javascript is way more convenient for doing this because you can write functions to put specific constraints. As a result, the page is very flexible, and the home page behaves differently than the rest of the site. Check out the screenshots and look at the way the footer and body expand and contract. If the screen size is less than 730px, the body will contract a little. If the screen is bigger, as is the case these days, the footer fills the void. The home page drops the content down to the top of the footer, and again this relationship depends on the page size. The content pages, however, have a stable footer size, and the content is kept at the top of the page. Cool stuff, impossible though in CSS. Thank jeebus for java!&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;Here’s some example code of how flexible javascript can make CSS:&lt;/p&gt;

&lt;pre class="brush: js"&gt;var myHeight = 0;

if( typeof( window.innerHeight ) == 'number' ) 
{
	//gets the height of the screen
	myHeight = window.innerHeight;	
}

if (document.title == "Paulus Lab: Home")
{
	
	if (myHeight &gt; 730) 
	{
		//this is how you control CSS div properties with java 
		document.getElementById('footer').style.height = myHeight - 437 + 'px';
		document.getElementById('fLeft').style.height = myHeight - 437 + 'px';
		document.getElementById('fRight').style.height = myHeight - 437 + 'px';
		document.getElementById('footerBg').style.height = myHeight - 437 + 'px';
		
		myHeight = 730;
	}
}
&lt;/pre&gt;
&lt;p&gt;Credits for the window sizing script: &lt;a href="http://www.howtocreate.co.uk/tutorials/javascript/browserwindow" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;6 hours&lt;/p&gt;</description><link>http://davidderiso.com/post/309854800</link><guid>http://davidderiso.com/post/309854800</guid><pubDate>Thu, 31 Dec 2009 08:16:00 -0800</pubDate><category>Paulus IT</category></item><item><title>Woooo Finished the New Effort IRB!!!</title><description>&lt;p&gt;3 days, 20 hours, and 8 pages, its a beauty. I must have rewrote each sentence close to 3 times. When you write this sort of document, you are forced to clean and linearize all of your ideas. Doing this was not easy, and I was forced to face some deep theoretical issues that have escaped me in the past months. However, tonight I was able to tackle them head on and draw new distinctions that I would have never considered. Because of this, I even added a new condition to the battery of tests in my effort paradigm. Now there are 6 task conditions. I decided to build in some flexibility that will allow me to mix and match these conditions for each project to answer some brand new psychological questions and make some pretty compelling models with the data. Now, within these 3 projects, there can be multiple experiments as the batteries of tests can be analyzed for different relationships. Needless to say, I am excited and enthusiastic about the coming year, and my honors thesis is no longer worrisome.&lt;/p&gt;</description><link>http://davidderiso.com/post/309662691</link><guid>http://davidderiso.com/post/309662691</guid><pubDate>Thu, 31 Dec 2009 04:30:00 -0800</pubDate></item><item><title>Last night I finished Dr. Marc Wittmann’s analysis (8...</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kvgvfnuIFm1qatecqo1_r2_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Last night I finished Dr. Marc Wittmann’s analysis (8 hours). Learned how an ANOVA works and what the heck those asterisks mean in R. *** means really significant, * means weakly significant. 2/4 of the factors were pretty signifigant and had ***, 1/4 of them was weakly signifigant and only had one *, and the last factor of the 4 was not signifigant. Sweet.&lt;/p&gt;
&lt;p&gt;Tonight I worked on my IRB some more (5 hours). I added my 2 proposals and mixed it in with the 3rd. So there’s 3 projects in the study. The application looks really solid, but we’ll see what the chief says.&lt;/p&gt;
&lt;p&gt;I really want to work on the new website some more, but I’m forcing myself to finish the IRB and analysis program first. SO MUCH TO DO, SO LITTLE TIME!!!&lt;/p&gt;</description><link>http://davidderiso.com/post/307946210</link><guid>http://davidderiso.com/post/307946210</guid><pubDate>Wed, 30 Dec 2009 05:14:00 -0800</pubDate></item><item><title>"If history is any teacher, it teaches that when you get indifferent and you lose the will to fight,..."</title><description>“If history is any teacher, it teaches that when you get indifferent and you lose the will to fight, some other guy who has the will to fight will take you over.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Arthur_D._%22Bull%22_Simons" target="_blank"&gt;Colonel Arthur D. “Bull” Simons&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the guy who goes overseas and breaks people out of prison for rescue missions.&lt;/p&gt;
&lt;p&gt;In 1970, Simons was hand-picked to be the ground commander of Operation Ivory Coast, a joint special operations effort to rescue American prisoners of war from the Son Tay prison in North Vietnam.&lt;br/&gt;&lt;br/&gt;In late 1978, Simons was contacted by Texas businessman Ross Perot, who requested his direction and leadership to help free two employees of Electronic Data Systems that were arrested shortly before the Iranian Revolution. Simons organized a rescue mission and ultimately freed the two men from the Iranian prison. All involved returned safely to the United States.&lt;br/&gt;&lt;br/&gt;Simons’ nickname “Bull” was taken from a physical training game called the “bull pit,” whereby one Soldier climbs down into a pit in the ground, and other Soldiers engage in trying to pull the first Soldier from the pit. Simon’s large physical stature and great strength (even in his fifties, he did 250 push-ups every day) made him a formidable challenge to remove from the pit, and the name “Bull” stuck.&lt;/p&gt;&lt;/em&gt;</description><link>http://davidderiso.com/post/305465286</link><guid>http://davidderiso.com/post/305465286</guid><pubDate>Mon, 28 Dec 2009 19:41:00 -0800</pubDate></item><item><title>Image from Wetsand.com’s surf forecaster. December 2009....</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_kvd4d0Zz5t1qatecqo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Image from &lt;a href="http://swellwatch.wetsand.com/#place=0_179.296875_1_1092_height_none_Sat_-1" target="_blank"&gt;Wetsand.com’s surf forecaster&lt;/a&gt;. December 2009. The color indicates wave height, and the blobs indicate massive storms the size of the Australian continent.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Until then, surfs up.&lt;/p&gt;</description><link>http://davidderiso.com/post/304355597</link><guid>http://davidderiso.com/post/304355597</guid><pubDate>Mon, 28 Dec 2009 04:36:00 -0800</pubDate></item><item><title>This was the best gift I could have asked for. I perfected my...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kv9i7eHBo71qatecqo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This was the best gift I could have asked for. I perfected my matrix conversion function in R, &lt;b&gt;now with &lt;i&gt;dynamic variable&lt;/i&gt; assignment!!&lt;/b&gt; You can tell it works because it goes from FALSE to TRUE, as indicated by the screenshot. Sweet.&lt;/p&gt;
&lt;p&gt;Been up all night workin on Dr. Marc Wittmann’s data. Sleepy.&lt;/p&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;p&gt;Site:2 hours &lt;br/&gt;Marc’s Data: 7 hours!&lt;/p&gt;</description><link>http://davidderiso.com/post/301278088</link><guid>http://davidderiso.com/post/301278088</guid><pubDate>Sat, 26 Dec 2009 05:45:00 -0800</pubDate><category>Paulus IT</category></item><item><title>Paulus Lab Website Coded!</title><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://research.davidderiso.com/paulusweb/index.php" target="_blank"&gt;http://research.davidderiso.com/paulusweb/index.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Worked on it over the past 2 days, which is about 10 hours..&lt;/p&gt;</description><link>http://davidderiso.com/post/300005999</link><guid>http://davidderiso.com/post/300005999</guid><pubDate>Fri, 25 Dec 2009 07:33:00 -0800</pubDate><category>Paulus IT</category></item><item><title>Woooooo hoooooo! Irrefutable proof that this site is useful....</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kv5ncgafcE1qatecqo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Woooooo hoooooo! Irrefutable proof that this site is useful. Sweet.&lt;/p&gt;</description><link>http://davidderiso.com/post/298387070</link><guid>http://davidderiso.com/post/298387070</guid><pubDate>Thu, 24 Dec 2009 03:45:00 -0800</pubDate></item><item><title>This is a video on how body parts are grown with stem cells....</title><description>&lt;embed src="http://cnettv.cnet.com/av/video/cbsnews/atlantis2/player-dest.swf" flashvars="linkUrl=http://www.cbsnews.com/video/watch/?id=5975132n&amp;tag=api&amp;releaseURL=http://cnettv.cnet.com/av/video/cbsnews/atlantis2/player-dest.swf&amp;videoId=50080860&amp;partner=news&amp;vert=News&amp;si=254&amp;autoPlayVid=false&amp;name=cbsPlayer&amp;allowScriptAccess=always&amp;wmode=transparent&amp;embedded=y&amp;scale=noscale&amp;rv=n&amp;salign=tl" allowfullscreen="true" width="425" height="324" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is a video on how body parts are grown with stem cells. There are 2 strategies:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Build a part from scratch (using a mold)&lt;/li&gt;
&lt;li&gt;Make the body regrow its own parts (with a chemical that fetuses use to regrow parts before birth)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I highly recommend watching this. It is the future of medicine as we know it.&lt;/p&gt;
&lt;p&gt;Props to Robert Koehler for sharing this!&lt;/p&gt;</description><link>http://davidderiso.com/post/298375331</link><guid>http://davidderiso.com/post/298375331</guid><pubDate>Thu, 24 Dec 2009 03:29:01 -0800</pubDate></item><item><title>"That’s an esoteric question of “why do we do art?” Commerce. I picked graphic..."</title><description>“&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;Bonnie Tanaka (my Typography professor at SMC)&lt;/p&gt;
&lt;p&gt;Dr. Douglas Nitz (my Systems Neuroscience professor at UCSD)&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;&lt;/em&gt;</description><link>http://davidderiso.com/post/296525114</link><guid>http://davidderiso.com/post/296525114</guid><pubDate>Wed, 23 Dec 2009 00:36:00 -0800</pubDate></item><item><title>IT Madness continues.
Here, I have spent the day designing the...</title><description>&lt;img src="http://30.media.tumblr.com/tumblr_kv1xo6KU9m1qatecqo1_r3_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;IT Madness continues.&lt;/p&gt;
&lt;p&gt;Here, I have spent the day designing the feel of the new website. It looks bad ass.&lt;/p&gt;
&lt;p&gt;The chemical structures are for methamphetamine, lorazepam, and cocaine. Sweet.&lt;/p&gt;
&lt;p&gt;The font is Agrafa-hairline. Its free at myfonts.com&lt;/p&gt;
&lt;p&gt;…hundreds of revisions. Simple is difficult to achieve.&lt;/p&gt;
&lt;p&gt;13 hours!&lt;/p&gt;</description><link>http://davidderiso.com/post/294941594</link><guid>http://davidderiso.com/post/294941594</guid><pubDate>Tue, 22 Dec 2009 03:38:00 -0800</pubDate><category>Paulus IT</category></item><item><title>Sensation Seeking Application Finished!!!</title><description>&lt;p&gt;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 &lt;b&gt;VERY&lt;/b&gt; good!!!!&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://research.davidderiso.com/survey/SSS.html" target="_blank"&gt;http://research.davidderiso.com/survey/SSS.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By the way, I’m apparently off the deep end of Sensation Seeking, I am in the 99.4th percentile. Swweet!&lt;/p&gt;
&lt;p&gt;Here’s my data:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_kv0em5y1ms1qanilr.png"/&gt;&lt;/p&gt;
&lt;p&gt;This took 9 hours and knocks off the second project I have completed for IT Madness!!&lt;/p&gt;</description><link>http://davidderiso.com/post/293485162</link><guid>http://davidderiso.com/post/293485162</guid><pubDate>Mon, 21 Dec 2009 07:49:00 -0800</pubDate><category>Paulus IT</category></item><item><title>Super Simple AS3 Webcam Uploader</title><description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Here’s a &lt;a href="http://files.davidderiso.com/simpledb/webcamuploader/demo/" target="_blank"&gt;working demo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here’s the &lt;a href="http://files.davidderiso.com/simpledb/webcamuploader/sources.zip" target="_blank"&gt;source files&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here’s how it works:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The flash code creates the camera and takes the picture as bitmapdata&lt;/li&gt;
&lt;li&gt;This bitmapdata is fed into a jpeg encoder (in the flash app)&lt;/li&gt;
&lt;li&gt;The encoded jpeg is then pushed out of flash into a php script on your server&lt;/li&gt;
&lt;li&gt;The php script saves a copy on the server and then pops up a download link&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is the code:&lt;/p&gt;
&lt;p&gt;AS3:&lt;/p&gt;

&lt;pre class="brush: as3"&gt;	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 &gt;&gt; 1;
				spinner.y = 255 - spinner.height - 40 &gt;&gt; 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();
				}
			}


		}
	}
&lt;/pre&gt;
&lt;p&gt;PHP:&lt;/p&gt;

&lt;pre class="brush: php"&gt;&lt;?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.';

?&gt; 
&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;Credits&lt;/b&gt;:&lt;/p&gt;
&lt;p&gt;Webcam AS3 code adapted from GK Sinner and Adobe: &lt;a href="http://www.adobe.com/devnet/facebook/samples/index.html#webcam" target="_blank"&gt;link&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Encoding and passing the bitmap data to PHP for download adapted from Henry Jones:&lt;a href="http://henryjones.us/articles/using-the-as3-jpeg-encoder" target="_blank"&gt; link&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The rest was figured out by experimentation.&lt;/p&gt;</description><link>http://davidderiso.com/post/293012035</link><guid>http://davidderiso.com/post/293012035</guid><pubDate>Sun, 20 Dec 2009 23:11:00 -0800</pubDate></item><item><title>IT Database Finished!</title><description>&lt;p&gt;Sweeeeeeeet!!! Just fixed a ton of bugs and made it look awesomer.&lt;/p&gt;
&lt;p&gt;Improvements:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;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&lt;/li&gt;
&lt;li&gt;Resized columns, such as the Description column, so I can record more stuff, like IPs&lt;/li&gt;
&lt;li&gt;Improved the database updater GUI so its more user friendly&lt;/li&gt;
&lt;li&gt;Created an Iframe link on the lab’s site so people have access&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Total of 13 hours!&lt;/p&gt;
&lt;p&gt;Here’s the webcam uploader:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://media.tumblr.com/tumblr_kuzpn2FAmx1qanilr.png" target="_blank"&gt;&lt;img src="http://media.tumblr.com/tumblr_kuzpn2FAmx1qanilr.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;heres the actual database browser&lt;/p&gt;
&lt;p&gt;&lt;a href="http://media.tumblr.com/tumblr_kuzpnv0cwy1qanilr.png" target="_blank"&gt;&lt;img src="http://media.tumblr.com/tumblr_kuzpnv0cwy1qanilr.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;heres the database updater (i designed it to look like a spreadsheet):&lt;/p&gt;
&lt;p&gt;&lt;a href="http://media.tumblr.com/tumblr_kuzpo9RrxN1qanilr.png" target="_blank"&gt;&lt;img src="http://media.tumblr.com/tumblr_kuzpo9RrxN1qanilr.png"/&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://davidderiso.com/post/292987648</link><guid>http://davidderiso.com/post/292987648</guid><pubDate>Sun, 20 Dec 2009 22:50:00 -0800</pubDate><category>Paulus IT</category></item></channel></rss>
