<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pixxid</title>
	<atom:link href="http://pixxid.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixxid.com</link>
	<description>development journal</description>
	<lastBuildDate>Tue, 19 Apr 2011 07:14:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>CSS Tips and Making Efficient Web Interfaces</title>
		<link>http://pixxid.com/css-tips/2011/04/11/</link>
		<comments>http://pixxid.com/css-tips/2011/04/11/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 19:57:36 +0000</pubDate>
		<dc:creator>Joe Kelly</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=236</guid>
		<description><![CDATA[I was recently asked to find a somewhat comprehensive listing of CSS tips. Instead I decided to start pouring it all down in a post for later reference. I won&#8217;t really go over the basics, but a decent resource to get started in HTML and CSS can be found at http://htmldog.com/. I found them to [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked to find a somewhat comprehensive listing of CSS tips. Instead I decided to start pouring it all down in a post for later reference. I won&#8217;t really go over the basics, but a decent resource to get started in HTML and CSS can be found at <a href="http://htmldog.com/">http://htmldog.com/</a>. I found them to be a decent starter kit for people. Now onto some ways to improve the way you write CSS.</p>
<p><span id="more-236"></span></p>
<h2>Avoid Unnecessary Chaining</h2>
<p>For example if a style references the id of an element, be sure to not add unnecessary information about its ancestry.</p>
<p>#page #header #navigation {} could just be #navigation{}</p>
<p>Since we&#8217;re already using an id for the element, there is no point to give an ancestry.</p>
<p>Caveat: When I want to change the navigation on a particular page I could do the following.</p>
<p>#home_page #navigation{}</p>
<h2>Use Specific Class names</h2>
<p>The further down the DOM tree you get the more specific the class naming should get to avoid possible conflict. I have adopted chaining the tree inline as it involves fewer lookups. Also, the style declarations are read in reverse order from right to left, having  just one class reduces the amount of pruning involved.</p>
<p>Instead of using something like #header #navigation .button we can describe the item using one class: .header_navigation_button</p>
<h2>Use relative then absolute positioning, more than you&#8217;d like to</h2>
<p>A lot of browser conflicts or oddities can be resolved using absolute positioning. Instead of relying on placements using floating or margins often times positioning an element in a relative block will fix spacing issues that might arise across browsers.  Examples of this are buttons with set icon sizes, header content, etc&#8230; Since placing things absolutely takes it out of the flow of that element, you don&#8217;t have to worry about how it will affect the other sibling elements. Then those siblings can be &#8220;fixed&#8221; using proper padding or margin.</p>
<h2>Allow Block Elements to Fill Their Space Naturally</h2>
<p>A huge problem for a lot of people when it comes to layout is how different browsers treat their width/height and their padding and border. Sometimes the border and padding are considered internal or sometimes external to the block element. To avoid this on elements where you need to set the width, do not use padding or border on the left or right, and vice versa for the top and bottom. Often times this will destroy your layout. Make sure that layout blocks retain the size you want them to and avoid overloading them with styles that will cause them to generate various widths and heights on different browsers. A blocks natural inclination is to fill the space available (e.g. width: auto;) much like a liquid.</p>
<p>Another situation you won&#8217;t want get in when styling a layout is to use percentages with a child element, where the parent has padding. For example setting the width of the child to 100% width and the parent to having a padding of 20px all around, might lead you to think that the child element will fill the area inside the padded area to 100%. However, what this actually means is that the child element will be 100% of the width of the parent and start from the (20, 20) mark of the parent element, and spilling outside of the parent block. A better solution would be to just let the child block default to automatically assign its width and height.</p>
<h2>Speed Considerations</h2>
<p>It is also important to consider the efficiency of your CSS, and the point behind using less verbose selectors and specific class names. For speed, it is important to keep in mind that the more selectors you use in the style declaration the less efficient the selector is. The best you can do is to avoid large chaining. It is also important to redcuce the number of elements on the screen at a given time, thus making the DOM faster to traverse. The less steep the tree the faster the interface will be. The practice of having to keep everything simple is in a constant struggle to meet the needs of the design, as sometimes the design will require more elements on the screen than is practically needed; creating more overhead.</p>
<p>Other ways to improve speed are to add inline styles to elements. Inline styles will override any styles in a stylesheet with the exception of styles with the !important declaration. A good example of inline styles are elements that either require dynamically generated placement, such as the slickgrid or its spiritual derivatives.</p>
<h2>Garbage Collection</h2>
<p>This is related, but not exactly on topic. But it is important to have a rudimentary form of garbage collection for your DOM elements. Make sure that when you&#8217;re done with an interface you take it off the view. If it&#8217;s more work to update the styles and content than to re-render a scene than it is advisable to just start from scratch and redraw it. This problem is a lot more obvious on sites that rely on ajaxian interfaces. For example, I was visiting twitter the other day and had left Firefox on overnight. The next day my computer was running insanely slow, and I traced it to twitter&#8217;s site. I counted how many DOM elements they had on the screen and it came out to roughly 200,000. I then refreshed the site and counted the number of elements on the page this time: approx. 600. Good websites can typically show their entire front page in about 500 &#8211; 600 elements.</p>
<p>On load Grooveshark uses about 550 elements. The real killers are content dedicated to displaying both large amounts of data and large amounts of &#8220;visual&#8221; data. To avoid that, things like the queue, pages, and lightboxes are all in charge of their own garbage collection. If it&#8217;s not going to be used or seen in the foreseeable future, kill it!</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/css-tips/2011/04/11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Development: LLVM</title>
		<link>http://pixxid.com/web-development-llvm/2011/03/31/</link>
		<comments>http://pixxid.com/web-development-llvm/2011/03/31/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 18:25:18 +0000</pubDate>
		<dc:creator>Cugini</dc:creator>
				<category><![CDATA[expo]]></category>
		<category><![CDATA[interests]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[llvm]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=37</guid>
		<description><![CDATA[Web development, i.e. HTML/JS/CSS kinda sucks. Really it does. While on the server side you have free range; we can use nice languages and frameworks (or any of these for anyone of a more lambda persuasion).  We can use scripting languages where they make sense, and opt to use a fully compiled and typed language when and [...]]]></description>
			<content:encoded><![CDATA[<p>Web development, i.e. HTML/JS/CSS kinda sucks. Really it does.</p>
<p>While on the server side you have free range; we can use <a href="http://www.python.org/" target="_blank">nice</a> <a href="http://www.ruby-lang.org" target="_blank">languages</a> <a href="http://rubyonrails.org/" target="_blank">and</a> <a href="http://www.djangoproject.com/" target="_blank">frameworks</a> (or <a href="http://happstack.com/" target="_blank">any</a><a href="http://liftweb.net/" target="_blank"> of</a> <a href="http://github.com/weavejester/compojure" target="_blank">these</a> for anyone of a more <a href="http://paulgraham.com/arc.html" target="_blank">lambda</a> <a href="http://common-lisp.net/project/cl-weblocks/" target="_blank">persuasion</a>).  We can use scripting languages where they make sense, and opt to use a fully compiled and typed language when and if the situation calls for it.</p>
<p>On the client side we have&#8230; well, just javascript.  JavaScript is a great little language to quickly hack something up, and make some nifty gadgets. I even enjoy making them.  The problem is that we&#8217;re no longer using javascript as that little bit of glitter to make websites shiny.  <a href="http://jquery.com/" target="_blank">JQuery</a>, <a href="http://www.prototypejs.org/" target="_blank">Prototype</a>, and other AJAX libraries provide a small extension to our honeymoon period with javascript, but now we&#8217;re wondering if he can still provide for our family.  We&#8217;ve been using it to build full fledged applications, and this is where it gets gross.</p>
<p><span id="more-37"></span>Software development is not a solved problem by any means.  We have learned quite a bit over the years, and modern languages and platforms have evolved to make development an easier and more maintainable endeavor.  Javascript was really never meant to be a full featured, cross platform language, and it shows.  Google, who you might have heard is in the business of web apps, realized that javascript alone would not fit the bill for creating these massive, long-term projects, so they created <a href="http://code.google.com/webtoolkit/" target="_blank">GWT</a>.  Others followed suit and we now have frameworks like <a href="http://cappuccino.org/" target="_blank">Cappuccino</a> and <a href="http://pyjs.org/" target="_blank">Pyjamas</a>.  These are impressive projects, but again, we&#8217;re dealing with the symptoms by patching over javascript.  They hide all the ugly cross-browser compatibility problems and lend us more maintainable languages and tools, but at the cost of <a href="http://mir.aculo.us/2010/06/04/making-an-ipad-html5-app-making-it-really-fast/" target="_blank">performance</a>.</p>
<h3>So what can we do?</h3>
<p>For now, frameworks like GWT, and libraries like JQuery can help make your life easier (and maybe help save the sanity of the next developer to take over your project).  In the long term, I propose that we begin moving away from javascript.  I&#8217;m not going to endorse my favorite fad language of the hour, but rather suggest that we look at ways to embed the <a href="http://common-lisp.net/project/cl-weblocks/" target="_blank">LLVM</a> into browsers.  This would allow developers to use any language supported by the LLVM, and by extension any libraries written in those languages (maybe a return to picking, &#8220;the right tool for the job&#8221;).  Client-side code would be distributed as LLVM bytecode, allowing fast JIT compilation (this also has the added bonus of opaqueness for <a href="http://blog.hulu.com/2010/05/13/pardon-our-dust/" target="_blank">those</a> <a href="http://www.netflix.com">services</a> which may require it).</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/web-development-llvm/2011/03/31/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advertising and being OPEN</title>
		<link>http://pixxid.com/advertising-and-being-open/2011/03/31/</link>
		<comments>http://pixxid.com/advertising-and-being-open/2011/03/31/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 10:32:15 +0000</pubDate>
		<dc:creator>Joe Kelly</dc:creator>
				<category><![CDATA[.self]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=201</guid>
		<description><![CDATA[I&#8217;ve been thinking a lot lately: about two differing methodologies that sometimes by chance, sync up. That is, the free and the not-so-free. Everyone wants to say the web is free, but what are the top sites? Aren&#8217;t they really basking in the power of advertising dollars. Technology is free as long as its funded [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking a lot lately: about two differing methodologies that sometimes by chance, sync up. That is, the free and the not-so-free. Everyone wants to say the web is free, but what are the top sites? Aren&#8217;t they really basking in the power of advertising dollars. Technology is free as long as its funded by Doritos! That&#8217;s a tasty chip right there. Hold on, I&#8217;ll be back, I have to get some, and some pringles without principles while I&#8217;m at it&#8230;</p>
<p>Ok, back&#8230; nom nom nom&#8230;</p>
<p>As much as we&#8217;d like to not sell out or be sustainable by the viewers like you; it&#8217;s just not economical. There is always going to be some amount of whoring in order for us to pay the bills. What is putting the money in our pocket is someone not concerned about whether or not they can loan us money for a cup of coffee once in a while (payed subscriptions), but someone that&#8217;s concerned about a return on investment: monetary obligations. We all want someone to take us out to a nice restaurant and treat us right, but at the same time they&#8217;re trying to push their products on us&#8230; hard.  So what&#8217;s wrong with everyone? Just because you say you&#8217;re open, doesn&#8217;t mean you are. You praise it like a religion, and then peddle your wares.</p>
<p><span id="more-201"></span></p>
<p>So what I think everyone needs to understand is that solutions to problems are dependent on the PROBLEM. We can all bitch and moan about our fan-boy tendencies, but what matters is getting the job done as fast and be as fruitful as possible.  Advertising is one of those cases that merits quick turn-around and the widest range of tools. We want to shock our customer into buying our product, leaving a lasting memory when the time comes and they&#8217;re at the check out line or being sure they have an incentive to pull your product from the shelf. This truth has made it from television to its spiritual successor, and will remain a large factor for much of the web.</p>
<p>Will the web standards ever catch up to advertisers expectations? In a sense it is trying; it&#8217;s constantly catching up. There will always be the cheap solutions to people&#8217;s advertising dollars. But, at the same time advertising will always push the market and create demand for high quality advertisements.  I work on web advertisements all the time (approaching ~1 million in ad revenue), and the open and free solutions to the problems for advertising barely exist; they are always raising the bar, and it always needs to be done yesterday (the deadlines are literally missed by a day or two).  Recently I was asked to animate all our advertisements in JavaScript, with nice slide in effects that are coordinated effortlessly. The reason to make it in JavaScript: it would be really cool if we could make it in JavaScript.</p>
<p>Coolness factor aside, the dev time needed to make all that work and not suck in everything besides Chrome (please get chrome, for the love of god) within a time window of two weeks, would&#8217;ve meant me wanting to kill myself from lack of sleep. Instead, I said, &#8220;yeah that would be cool, but I am going to be realistic, and work on that in flash inside a few days&#8221;. And we all won, because</p>
<ol>
<li>I was happy because no one died</li>
<li>I nor my coworkers did not end up being placed through a life-debilitating wringer that left them scarred for life from choosing hard drugs to stay up</li>
<li>Most importantly the client was happy!!</li>
</ol>
<p>In advertisement the most important thing is turn around time (and does it blur or rather poop smear). It&#8217;s important to know the limitations of the tools at your disposal especially when you do not have the time to mess up and switch course in the middle, when the middle means only a few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/advertising-and-being-open/2011/03/31/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perfecting Imperfection</title>
		<link>http://pixxid.com/perfecting-imperfection/2010/06/22/</link>
		<comments>http://pixxid.com/perfecting-imperfection/2010/06/22/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 07:04:24 +0000</pubDate>
		<dc:creator>Melanie Richards</dc:creator>
				<category><![CDATA[.self]]></category>
		<category><![CDATA[imagery]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=166</guid>
		<description><![CDATA[&#8220;Oh, you&#8217;re an art major?&#8221; This question makes me panic. After the fleeting moment of pride in doing what I love, that windpipe-crushing anxiety sets in. In about two seconds, one of two things will usually happen: 1) the person will follow up with a condescending &#8220;that&#8217;s fun,&#8221; and I&#8217;ll have to attempt to legitimize [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://pixxid.com/wp-content/uploads/2010/06/nonobad.jpg" alt="" />&#8220;Oh, you&#8217;re an art major?&#8221; This question makes me panic. After the fleeting moment of pride in doing what I love, that windpipe-crushing anxiety sets in. In about two seconds, one of two things will usually happen: 1) the person will follow up with a condescending &#8220;that&#8217;s fun,&#8221; and I&#8217;ll have to attempt to legitimize my career choice, or 2) I will be pressured to draw a dragon on the spot. If I cannot produce a fire-breathing beastie upon command, I risk losing many respect points. The person will give up on me and later tell someone, &#8220;oh, yea, she&#8217;s an <em>art major</em> now.&#8221;</p>
<p>It is this panic-stricken conversation that drives many young art/illustration students—and hobbyists—into a manic pursuit of photo-realistic drawing skills. We think that in order to be respected by our peers, by our professors, by the &#8220;non-creatives,&#8221; we need to be able to produce a carbon copy of a pineapple. While skills like this are incredibly useful in any art practice, young and budding creatives often lose so much in attempting to chase down realism. When we could be developing our creative process, our imaginations, our risk-taking, we are instead painstakingly copying strands of hair.</p>
<p><span id="more-166"></span></p>
<p>But you know what? Photo-realism for the most part is really boring. We all know that person who can draw celebrities in stunning likeness. Their drawings are amazing at first, but it gets old really fast. If your work looks like something out of a Lee Hammond how-to-draw book, you should be very worried. Your best hope is to get a job in caricature, because very likely, your art lacks personality, voice. And in an increasingly technological world, people respond to a sense of humanity, not automaton-like reproduction. It is for this reason that I ask us all to stop screwing around with perfectionism and start experimenting with what we can tell the world in our own unique way.</p>
<p>Out of kindness, I won&#8217;t call out anyone working from a yawn-evoking style, but I do want to present a few illustrators who are incredibly successful in working from an imperfect style.</p>
<p>Our first Imperfectionist is <a href="http://www.gemmacorrell.com/" target="new">Gemma Correll</a>:<br />
<img class="aligncenter" src="http://pixxid.com/wp-content/uploads/2010/06/4607774084_a04ec0e004_o.png" alt="" /></p>
<p>I would classify her work as little more than doodles, but Gemma is keeping busy, and I&#8217;m following her across several social media sites. Why? She&#8217;s <a href="http://www.society6.com/gemmacorrell/?show=posts">funny</a>, there&#8217;s a big market for &#8220;cute,&#8221; and her drawings really capture her subjects. It&#8217;s weird to see a picture of a person after you&#8217;ve seen one of her &#8220;doodles&#8221; of them; you realize how closely she examined their behaviors or physical attributes.</p>
<p><img class="aligncenter" src="http://pixxid.com/wp-content/uploads/2010/06/3576071237_105240c7e9_b.jpg" alt="" width="80%" /><br />
I can&#8217;t wait to see new work from <a href="http://davidfullarton.com/">David Fullarton</a> (above). His handwriting is downright messy, but his images are so visceral, often scathing, so full of texture that they seem tactile. It looks like he just dumps his office supply drawer on his desk and goes to town.</p>
<p><img class="aligncenter" src="http://pixxid.com/wp-content/uploads/2010/06/1666289__h450-.jpg" alt="" width="100%" /></p>
<p><a href="http://www.mikeperrystudio.com/">Mike Perry&#8217;s</a> work will look familiar to anyone following illustration. Mike has been crazy-big in the illo world for the past few years; he is one of the most-imitated illustrators out there right now. He has doodled on an EAMES chair for goodness sake. This guy is making bank off of his doodle-esque style because he loves it. He invests passion, and he has certainly benefited from being sincere (and kind, and humble; rarer than you&#8217;d think in creative fields).</p>
<p><strong>So, what&#8217;s the difference between quirky and just messy?</strong><br />
There&#8217;s no formula, obviously. Quirky seems to happen when the illustrator/artist has a strong point of view. When they have a profound sense of self, that gift of capturing the &#8220;essence&#8221; of a subject, or the ability to truly make you laugh, that&#8217;s a successful Imperfectionist. It helps to know the rules too, in order to break them beautifully. Sloppy work happens when we borrow song lyrics and second-guess our composition. Don&#8217;t do that. Get your own ideas.</p>
<p><strong>A challenge:</strong><br />
If you are passionate about art, and would love to design/illustrate/make personal art for a living, keep practicing. Keep honing your craft. But above all, work from a place that is honest, that is unique to who you are. People gravitate to sincerity. It serves the artist, the client, the viewer best when a touch of humanity is held in highest regard. Don&#8217;t let anyone sass you because you don&#8217;t draw exactly the way Joe Muscle-Cars does. Take a deep breath, return to your brushes or pens, and feel sorry for all the self-loathing haters.</p>
<p><em>All images used under the principles of <a href="http://www.copyright.gov/fls/fl102.html">Fair Use</a>. Artists, please let me know if you wish to have your work removed.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/perfecting-imperfection/2010/06/22/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Annoyances with Android: MediaPlayer [Part 1]</title>
		<link>http://pixxid.com/annoyances-with-android-mediaplayer-part-1/2010/06/21/</link>
		<comments>http://pixxid.com/annoyances-with-android-mediaplayer-part-1/2010/06/21/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 04:24:45 +0000</pubDate>
		<dc:creator>Skyler Slade</dc:creator>
				<category><![CDATA[interests]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=151</guid>
		<description><![CDATA[For the past six months I&#8217;ve been a member of Grooveshark&#8217;s Android team. Before working on the Android project I was a Flash and Flex developer, working on the main Grooveshark web application and was moved to Android to, as I recall, help fix some of the problems with the 1.0 version of the application. [...]]]></description>
			<content:encoded><![CDATA[<p>For the past six months I&#8217;ve been a member of <a href="http://www.grooveshark.com">Grooveshark&#8217;</a>s Android team. Before working on the Android project I was a Flash and Flex developer, working on the main Grooveshark web application and was moved to Android to, as I recall, help fix some of the problems with the 1.0 version of the application. Soon after joining the Android team my team member and I decided that the best way to fix 1.0 was to completely scrap it and start over. Many of the problems in the first version were because of some fundamental design decisions that did not fit well with the Android platform and to fix these problems would almost necessitate  a complete rewrite either way.</p>
<p><span id="more-151"></span></p>
<p>Around this time others in the mobile group began planning the next versions of all the mobile applications so my teammate and I rushed to begin work on the 2.0 release of Grooveshark for Android. My primary responsibilities were with the player and its various systems&#8211;the player cache, offline cache, and other related things.</p>
<p>I learned Java and the Android framework at the same time and along the way encountered what I consider to be several annoyances and shortcomings with and of the Android platform. While on the whole I find both Java and Android a pleasure to work with, some things need improvement.</p>
<p>I initially wanted to compile a <em>Top n</em> list of problems but after writing the first few I found that I had too much for a single post so I&#8217;ve chosen to spread these out across multiple entries. Of any of my complaints I&#8217;m more than willing to admit to ignorance if it turns out that I&#8217;m just doing it wrong. So find fault if you can.</p>
<ol>
<li>
<h2>MediaPlayer doesn&#8217;t accept an InputStream</h2>
<p>Grooveshark for Android does much more with music than just play it. We save to cache recently-played songs, pre-buffer enqueued songs, and allow users to save songs to an explicit &#8220;offline&#8221; cache for listening when they&#8217;re not connected to a high-speed data network. Two of these, saving to a recent cache and saving to an offline cache require that we do more things with an MP3 than simply play it. The Android <a href="http://developer.android.com/reference/android/media/MediaPlayer.html">MediaPlayer</a> object accepts only three sources of audio data, or rather, supports only three ways to play an audio file. One can give the MediaPlayer a URL to a file, open a local file, or use a <a href="http://developer.android.com/reference/android/content/ContentProvider.html">ContentProvider</a>, which is useful if the audio data is embedded into the application&#8217;s installation package (APK).</p>
<p>It would seem that the first two methods, that of playing from a URL and from a file would suit the Grooveshark application&#8217;s needs well: for playing live streams we would provide a URL to the song on one of Grooveshark&#8217;s stream servers, and for playing offline cached songs we&#8217;d simply direct MediaPlayer to open a file on disk. However in both scenarios these input sources do not provide for everything we require.</p>
<p>In the first instance we can play from a URL without problem but once this song is played, we cannot access the downloaded data in order to save it to a recently-played cache. Doing this is necessary because if a user has a few songs enqueued, plays one, skips to the next song, then skips back to a previously listened-to song, we do not want to download this song again. Users do not expect that we&#8217;d need to download the song again, having just listened to it. When skipping back there would be a noticeable lag as the song buffered again and we&#8217;d be unnecessarily transferring data that we&#8217;ve already downloaded. Not everyone has an unlimited data plan and it seems that in the near future unlimited data plans may <a href="http://www.businessweek.com/news/2010-06-17/verizon-may-follow-at-t-s-iphone-to-tiered-pricing-update1-.html">become unavailable</a> anyway.</p>
<p>Because there&#8217;s no way to access the MediaPlayer&#8217;s data once downloaded, we could use a URL <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html">InputStream</a> to download the file and pipe the stream both into the MediaPlayer and out to the disk. This would allow us to both play the song and save it for later use. But because MediaPlayer does not accept an InputStream, this cannot be done. The only thing you can do with a URL is to play it.</p>
<p>In the other instance, that of saving a file to disk for offline playback, we could download the file then pass a <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileDescriptor.html">FileDescriptor</a> to the MediaPlayer. MediaPlayer does allow for this. However we need to encrypt the file because we wouldn&#8217;t want users to simply be able to mount their phones on their computer and copy their offline songs elsewhere. If MediaPlayer accepted an InputStream, we could wrap the File&#8217;s InputStream in a <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/FilterInputStream.html">FilterInputStream</a> which would decrypt the file as it is played. But again we cannot do this. Arguably we could first decrypt the file to a temporary file, then play this file, but this would make available an unencrypted MP3 for a time and on older phones would produce a noticeable lag as the file was decrypted and written-out to disk before playback could begin.</p>
<p>Others have found this MediaPlayer deficiency to be a problem and a <a href="http://code.google.com/p/android/issues/detail?id=739">bug was filed</a> with a supposed fix. InputStreams can now be played with the new <a href="http://developer.android.com/reference/android/media/AudioTrack.html">AudioTrack</a> object first made available in Android 1.5, but AudioTrack can only play raw PCM data, not an MP3 source, and as far as I can tell, to play an MP3 using AudioTrack the MP3 would need to be decoded in software as no hooks to the underlying MP3 hardware is provided (if there even is any, I really don&#8217;t know).</p>
<p>A proposed solution to this shortcoming is to run a local HTTP server which can manipulate the incoming and outgoing data in any way it likes. Ultimately this is what I ended up implementing. The application runs a thread which downloads a song, encrypts it as it writes it out to disk, and passes it along to the MediaPlayer object, sending the necessary HTTP headers as it connects to localhost. A stupid fix but it works.</li>
<li>
<h2>There&#8217;s a major bug in OpenCORE</h2>
<p><a href="http://www.opencore.net/">OpenCORE</a> is the underlying media framework on Android. It&#8217;s what the MediaPlayer and other objects use to play audio and video data. Like other parts of the Android API it ships with the phone and save firmware upgrades and patches from Google (assuming Google sends patches over-the-air, which I don&#8217;t even know if they do, and they probably do not), what comes on the phone is what you get.</p>
<p>Unfortunately there&#8217;s a major bug in OpenCORE that prevents high-bitrate files from playing.</p>
<p>The MediaPlayer object has several states that it enters into and leaves when it is directed to play audio data. When you provide a data source to the MediaPlayer, it enters into its &#8220;preparing&#8221; state. At this state it buffers data until it detects that it has enough to play the data source, audio or video, uninterrupted. Or rather, that it has buffered enough data that it can start playback without playing past its buffered amount and then pausing while it fetches more data.</p>
<p>When trying to play certain high-bitrate MP3s, MediaPlayer never leaves its preparing state, never enters into the &#8220;prepared&#8221; state, and so playback never begins. The song will appear to buffer forever. In some instances it will buffer the song almost completely but it never believes it has enough data. This is a <a href="http://code.google.com/p/android/issues/detail?id=7186">documented bug</a> and I don&#8217;t know if there&#8217;s any way around this.</p>
<p>The Grooveshark &#8220;Now Playing&#8221; screen shows buffer progress and player progress and when this bug exhibits itself, to the user the application just looks broken. It&#8217;s infuriating, embarrasing, and unfortunately seemingly out of our control. This seems to affect upwards of fifty percent of high-bitrate files, but the most frustrating part is that this problem cannot be reliably reproduced for any given file. You can usually stop and start playback (by pressing pause and play) a few times and the song will eventually play. If the problem was because of how the MP3 is encoded, I could possibly manipulate the MP3 data as it comes across the wire before it is sent to the MediaPlayer, but I can&#8217;t seem to find a pattern or a trigger for this problem. So I&#8217;m stumped.</p>
<p>In the eleventh hour before the release of Grooveshark 2.0 for Android I added a &#8220;prefer low-bitrate files&#8221; option, defaulted to enabled, to the application&#8217;s settings. This is only a band-aid of course, but it at least diminishes the problem. Unfortunately all songs on Grooveshark aren&#8217;t yet transcoded, so the problem still manifests itself from time to time. One possible fix is to run a watcher thread that monitors bytes downloaded and MediaPlayer state, and if the file is high-bitrate and a threshold percentage of the total file is downloaded but the MediaPlayer has never entered the prepared state, to start and stop playback until it does.</li>
</ol>
<p>More to come in part two.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/annoyances-with-android-mediaplayer-part-1/2010/06/21/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>User Expectations: Flash</title>
		<link>http://pixxid.com/user-expectations-flash/2010/06/07/</link>
		<comments>http://pixxid.com/user-expectations-flash/2010/06/07/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 04:24:10 +0000</pubDate>
		<dc:creator>Joe Kelly</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=98</guid>
		<description><![CDATA[This little gem popped up in my inbox not to long ago. VIP users of grooveshark are able to provide feedback and get to complain or file bug reports, which I randomly check (it would be a full-time job if I answered them). Most of the time it&#8217;s either feature requests, complaints that they spent [...]]]></description>
			<content:encoded><![CDATA[<p>This little gem popped up in my inbox not to long ago. VIP users of grooveshark are able to provide feedback and get to complain or file bug reports, which I randomly check (it would be a full-time job if I answered them). Most of the time it&#8217;s either feature requests, complaints that they spent about a cup of coffee&#8217;s worth of money, or in this case telling us how awesome we are.</p>
<p>Here&#8217;s the guts of the email (obviously removed some content for privacy):</p>
<blockquote><p>mood: Impressed<br />
feedback report:<br />
Nothing too contributary to say to be honest.</p>
<p>Just that your product is AMAZING.</p>
<p>It&#8217;s literally changed my entire view that every flash application is buggy and unreliable, you guys have done an absolutely stunning job. It&#8217;s so bug-less it&#8217;s suspicious!</p>
<p>Keep up the great work!</p></blockquote>
<p><span id="more-98"></span></p>
<p>So, what are we supposed to take away from this? That we&#8217;re really good at what we do. Or maybe there&#8217;s something else we can glean from this comment. Users expect flash to be <em>&#8220;buggy and unreliable&#8221;. </em>Let&#8217;s review some common complaints that people (including myself)<em> </em>have thought about flash.</p>
<h3>It takes forever to load</h3>
<p>Typically a lot of flash <em>applications</em> have these front and center. But the problem is the typical programmer makes this dead simple and almost pummels the user visually with the &#8220;holy-shit-this-is-a-loading&#8221; screen. With the user unable to even perceivably able to interact with the site, the wait is made more apparent. I think primarily the difference between flash and other web applications is that the user already gets an instant layed-out interface and they see the page loading in, therefore it feels more responsive.</p>
<p>Realistically that up front cost of loading things in makes the application feel more responsive later in the applications session lifetime. If you were to compare the actual loading times between flash sites and normal sites I think you might be surprised if you used a stop-watch (or firebug).</p>
<h3>It has annoying intros, with not a lot of content</h3>
<p>I have to agree that this is super annoying. I simply loathe sitting through a preloaded intro with no perceptible way to skip only to be taken to a sub-par website. Intros have more or less faded in time, but watching horribly animated, boring segues has weighed on peoples perception of flash. There is a certain level of taste to be considered. Let&#8217;s not blame flash for others&#8217; poor taste. Moving on.</p>
<h3>It&#8217;s always Glitchy / Buggy</h3>
<p>Pretend I am told to make a desk and I am provided with all the equipment I need and then some: hammers, screwdrivers, nice oak wood, etc&#8230; The problem is I have never made a desk and not a very good carpenter, so I hack it together. The desk I make turns out ok, is functional, but not quite what I wanted, and now the varnish is chipping off.</p>
<p>So, instead I buy a desk from IKEA, and have to assemble it. The desk is packaged in a really cool way (I recently bought a chair from their in a stair-case package) and it takes me a couple hours because it comes with dead simple instructions.</p>
<p>What I&#8217;m getting at is that Flash is a great set of tools. If I&#8217;m a great carpenter (hire me) the desk is going to come out better than something I bought, because I got to make the desk I wanted to from the beginning.  Heck, if I wanted to I could&#8217;ve made a matching bookcase and hutch, and with the scraps a stylish spice rack for my girlfriend. Sweet!</p>
<p>But, if you&#8217;re a bad carpenter, you&#8217;re going to have a horribly buggy misshapen turd. You have way more points of failure. IKEA is that package (e.g. wordpress) people get when they want a quick fix, and not a lot of customization. There are fewer ways to screw it up.</p>
<p>So, maybe what we need to take away from this is that programmers and not their tools which are &#8220;buggy and unreliable&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/user-expectations-flash/2010/06/07/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML Eats Babies and Spits Hot Fire</title>
		<link>http://pixxid.com/html-eats-babies/2010/06/05/</link>
		<comments>http://pixxid.com/html-eats-babies/2010/06/05/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 19:32:42 +0000</pubDate>
		<dc:creator>Joe Kelly</dc:creator>
				<category><![CDATA[expo]]></category>
		<category><![CDATA[interests]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=39</guid>
		<description><![CDATA[HTML5 is fast becoming the new hot thang that all the guys want to fuck.  But, like the hot girl:  she&#8217;s a raging bitch, requires a ton of maintenance, actually is just so-so  in bed, and you cannot protect your investment (because she&#8217;s open, but remember she has standards). And all the boys want to [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 is fast becoming the new hot thang that all the guys want to fuck.  But, like the hot girl:  she&#8217;s a raging bitch, requires a <a href="http://caniuse.com/">ton of maintenance</a>, actually is <a href="http://themaninblue.com/writing/perspective/2010/03/22/">just so-so  in bed</a>, and you <a href="http://blog.hulu.com/2010/05/13/pardon-our-dust/">cannot protect your investment </a>(because she&#8217;s open, but remember she has standards). And all the boys want to have their way with her:  Google is the new kid on the block, Microsoft the rich kid that <a href="http://ie.microsoft.com/testdrive/">wants to buy her</a>, her best friend Mozilla has been holding her hands when time was tough, and now Apple the bad boy because he wants to <a href="http://www.apple.com/html5/">prove to his gay lover</a> that <a href="http://www.apple.com/hotnews/thoughts-on-flash/">it&#8217;s really over</a>.</p>
<p><span id="more-39"></span></p>
<p>I on the other hand am totally gay for flash, but that&#8217;s because when I originally wrote for the web in HTML/JS/CSS it was slowly killing my soul.  I have and still consider myself pretty darn good at writing clean well-formed markup, making some custom components for jquery (I actually liked mootools for a time), and awesome at skinning sites in CSS.  But, all while doing this it never for once felt like real programming.  And, that&#8217;s what makes me think that this particular trio is really good at: creating sloppy, unmaintainable spaghetti code. But sometimes, that&#8217;s ok.</p>
<p>Heck, most of the time that&#8217;s ok.  The web (initially) is supposed to be open and easy for people to get their message out there, and that&#8217;s exactly why HTML began as a dumb way to publish data.  Not everyone has to make <a href="http://www.thefwa.com/">mind-blowing applications</a>.  HTML in its initial form never was about looking awesome or protecting content.  So what we have now is adding patches on top of a platform never intended to be commercial and flashy.</p>
<p>However, on the other side are the people that want to send a message, provide a product of content, and deliver a brand or platform.  It&#8217;s applications like these that defy the trend of openness and may never be able to reconcile with standards, which is what&#8217;s really funny about Apple: releasing a demo for HTML5, when it was more or less a demo for Safari.</p>
<p><em>I am not saying </em>HTML5 and JavaScript is a bad thing; <em>I&#8217;m saying</em> it&#8217;s not something good for production of commercial code.  If HTML5 and JavaScript is so great, then my friends shouldn&#8217;t have to bother writing applications for the iPhone or iPad in XCode (sorry Adobe), when I can have them develop for Safari.</p>
<p>Things about flash that make me shit rainbows:</p>
<ol>
<li>Compiled code</li>
<li>Object oriented</li>
<li>Distributed player with high market acceptance</li>
</ol>
<p>So what is it that I want from standards? How about something better than and more &#8220;well-formed&#8221; than JavaScript; maybe even be able to send byte-code to the client, which is exactly why flash has been thriving for years: its been filling in the gap that HTML and JavaScript was never equipped to serve.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/html-eats-babies/2010/06/05/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show Me More: Paging Array Collections</title>
		<link>http://pixxid.com/paging-array-collections/2010/06/02/</link>
		<comments>http://pixxid.com/paging-array-collections/2010/06/02/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 00:57:20 +0000</pubDate>
		<dc:creator>Joe Kelly</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=15</guid>
		<description><![CDATA[I have been working for a while recently on grooveshark&#8217;s newest feature: activity I needed to come up with a way for our array collections to only render or show a small set of what feeds actually have in them. [People stop listening to so much damn music.] What is great about array collections is [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working for a while recently on grooveshark&#8217;s newest feature: activity I needed to come up with a way for our array collections to only render or show a small set of what feeds actually have in them. [People stop listening to so much damn music.]</p>
<p>What is great about array collections is they handle all sorts of stuff for you, such as binding and updates. But what&#8217;s really great is the ability to differentiate a view from the underlying data, which allows you the use of filters for features like active searching on a collection.</p>
<p>So what I needed was a way to click show more and it would reveal the next set.</p>
<p>And <em>extend </em>and <em>implement</em>&#8230;</p>
<pre class="javascript" name="code">private var _pagesVisible:uint = 1;

[ChangeEvent("collectionChange")]
public function get pagesVisible():uint
{
     return _pagesVisible;
}

public function set pagesVisible(value:uint):void
{
     // allow it to be ready for soon to be populated data
     if (value &lt;= (pages+1)) {
           _pagesVisible = value;
           this.refresh();
     }
}

private function feedFilter(item:Object):Boolean
{
     var isIncluded:Boolean
          = (source.indexOf(item) &lt; PAGE_SIZE * pagesVisible);
     hasMorePages = !isIncluded;
     return (isIncluded);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/paging-array-collections/2010/06/02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Openness of Flash</title>
		<link>http://pixxid.com/the-openness-of-flash/2010/06/01/</link>
		<comments>http://pixxid.com/the-openness-of-flash/2010/06/01/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 03:30:59 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[interests]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://pixxid.com/?p=7</guid>
		<description><![CDATA[Thanks to Steve Jobs&#8217; Thoughts on Flash post, there&#8217;s been a whole new flurry of posts on the subject of flash vs html5, this time with some focus on the issue of openness, since Steve made such a point to bring that up. Some people have already pointed out that Adobe has been moving Flash [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to Steve Jobs&#8217; <a href="http://www.apple.com/hotnews/thoughts-on-flash/">Thoughts on Flash</a> post, there&#8217;s been a <a href="http://docs.google.com/View?id=dfw9fng6_2cscxq6hq">whole</a> <a href="http://www.osnews.com/story/23224/Jobs_on_Flash_Hypocrisy_So_Thick_You_Could_Cut_it_with_a_Knife">new</a> <a href="http://hooptyrides.blogspot.com/2010/04/searching-and-replacing-jobs-flash.html#">flurry</a> of <a href="http://benlog.com/articles/2010/04/29/the-genius-of-steve-jobs-he-makes-you-want-the-lock-in/">posts</a> on the <a href="http://jessewarden.com/2010/04/steve-jobs-on-flash-correcting-the-lies.html">subject</a> of <a href="http://www.fakesteve.net/2010/04/we-are-removing-flash-support-from-os-x.html">flash</a> vs <a href="http://www.minyanville.com/businessmarkets/articles/apple-steve-jobs-adobe-flash-closed/4/29/2010/id/28041?camp=syndication&amp;medium=portals&amp;from=yahoo">html5</a>, this time with some focus on the issue of openness, since Steve made such a point to bring that up.</p>
<p>Some people have already pointed out that Adobe has been moving Flash to be more and more open over time, including the open screen project, contributing tamarin to Mozilla, and Flex being completely open source. That&#8217;s all well and good, but people seem to be forgetting that historically, Flash had a very good reason for being closed. If one remembers back to the early days of the web, the wild west era as I do since it was such an exciting time for a young whippersnapper like me, one must only think back to what happened to Java to realize why making Flash closed was a very smart move.</p>
<p><span id="more-7"></span></p>
<p>For those who don&#8217;t remember or weren&#8217;t on the web back then, I&#8217;ll share what I remember which may be a bit off (that was quite a while ago now!). I&#8217;m talking about the hairy days when Netscape was revolutionizing the world and threatening to make desktop operating systems irrelevant and Microsoft was playing catch up. Java was an open and exciting platform to write once and run anywhere, promising to make proprietary operating systems even more irrelevant.</p>
<p>Of course, what ended up happening was that Microsoft created their own implementation of Java that not only failed to completely follow the Java spec, but added on some proprietary extensions, completely breaking the &#8220;write once, run anywhere&#8221; paradigm and helping to marginalize Java on the web, something it seems Java on the web has never fully recovered from, even though Microsoft has since settled with Sun and dropped their custom JVM after being sued.</p>
<p>This directly affected my personal experience with the language, when I took a Java class at the local community college while I was in high school. I wanted to write apps for the web, but even basic apps which compiled and ran fine locally would not work on IE, Netscape or both, the only solution being to spend hours fiddling and making custom versions for each browser. Needless to say, I quickly lost interest and haven&#8217;t really touched Java since I finished that class.</p>
<p>The atmosphere has certainly changed since those early days, and I don&#8217;t think it&#8217;s nearly as dangerous to &#8220;go open&#8221; now as it was back then, so Adobe&#8217;s choice to open up more and more of the platform now makes perfect sense, just as the decision to keep it closed until relatively recently also made sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://pixxid.com/the-openness-of-flash/2010/06/01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic (User agent is rejected)

Served from: pixxid.com @ 2012-02-08 18:00:50 -->
