Jan
17

Fun With ASDoc and DITA

Using ASDoc with a codebase library can be a real pain. Use Tweener in your classes? Papervision? Anything from the fl.* packages? You don't want to include all of that in your documentation. ASDoc provides a flag exclude-dependencies. That's fantastic but it doesn't play nice with the doc-sources command which accepts a path/package as a parameter for what you want to document. This means that you have to use the doc-classes param – and list every single class you want to document. Well, I have about 130 classes in my library, so that's a bit of a pain. Enter the AIR app DITA. Dita gives you a GUI for selecting ASDoc paths and then spits out a asdoc.sh (shell script) that lists all your classes in the target path. Here's my final bash script for generating my documentation (note that I've removed the big class list and some other options for brevity):

#!/usr/bin/env bash
asdoc
    -source-path ./src
    -doc-classes typeoneerror.utils.StageManager
    -external-library-path ./lib
    -package typeoneerror.buttons "Contains abstract button implementations"
    -exclude-dependencies=true
    -main-title "Typeoneerror Documentation"
    -window-title "Typeoneerror Documentation"
    -footer "Copyright Typeoneerror Studios"
    -output docs
    -warnings=false
    -strict=false
    -show-binding-warnings=false
    -show-actionscript-warnings=false
Dec
30

Liquid Hacynth Volume 19

Final drum and bass mix of the year. Look for change-ups in 2010; more dubstep and house mixes as well as the continuation of the Liquid Hacynth series. 2009 (MMIX!) was a great year for drum and bass. Right-click the link below to download the .mp3 from dropbox:

Download Liquid Hacynth Volume 19

01. Minimized - Kantyze
02. The Merry Dancers - Fatal Forms
03. Mokum Circle - Desperate
04. Creme Brulee - Amp, Derrick, Tonika
05. Come Back Home - Netsky
06. First Is Forever - Operon
07. Fever Pitch - Kabuki
08. Days Of Rage - Artificial Intelligence
09. Just For A Moment - Ultima C
10. Red - XRS Land
11. Freerun - X-plorer & Dee'Pulse
12. The 215 - Ross D
13. Task Master - Furlonge
14. Spoons - ATP
15. Darling Heart - Well Being
16. Better Place [MIST Remix] - 4Hero
17. Touchin' You - Enea
18. Reflect feat. Faden Baloglu - X-Plorer & Dee'Pulse
19. Rock This Style - Kabuki, Jenna G
20. Testimony feat. Riya - Total Science, S.P.Y.
21. I Don't Smoke [Ed Solo, System Remix] - Deekline
22. Mr. Freeze - Zodiac
23. 4 Points - SpectraSoul
24. Top Shelf feat. Spikey T - Zero T, Mosus
25. Out There - Bal
26. Rise - Greg Packer, Big Bud
27. Nothing Better - Vortex Involute

Dec
21

Simple Rounded Buttons in Opera with SVG-infused CSS

One of the important considerations of the new typeoneerror.com was that I'd not care as much cross-browser rendering issues or, more pointedly, "how things look in IE." That being said, I used many fun CSS3-style techniques such as border-radius:

-moz-border-radius:8px;
-webkit-border-radius:8px;

Safari (and Google Chrome, being both based on Webkit) and Firefox render my buttons and highlighted navigation buttons with rounded edges beautifully, and the rest of you get squares – it degrades pretty nicely. I did want to know whether Opera had any support for these "hacks." I'd heard of -opera-border-radius and -o-border-radius but they didn't work for me. The latest alpha version of Opera has full support for border-radius, but here's how you can achieve the exact same effect using simple SVG and pointing to those files in your CSS.

Our goal is to approximate the look created by our navigation button in browsers that support border-radius:

/* part of our navigation button definition **/
#nav ul li a {
    background-color:#03FFC1;
    border-radius:8px;          /* CSS3 */
    -khtml-border-radius:8px;   /* Some linux-based browsers */
    -moz-border-radius:8px;     /* Firefox > 3.1 */
    -webkit-border-radius:8px;  /* Safari */
}

Using XML-defined SVG, you can define a shape that you can use as a background image in CSS. Here, for example, is the definition of an SVG shape for the highlighted navigation button. Here's what the file I created (nav.svg) looks like:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
    <rect x="0" y="0" rx="8" ry="8" height="100%" width="100%" fill="#03FFC1" />
</svg>

Quite simply, this defines a rectangle that will scale (width/height 100%) to fill our background and has a corner radius (rx/ry) of 8. Now if I wanted to apply this to my nav buttons above:

/* use css "hacks" to target opera */
@media all and (-webkit-min-device-pixel-ratio:10000),not all and (-webkit-min-device-pixel-ratio:0){
    #nav ul li a {
        background:url(../img/nav.svg);
    }
}

You simply have to point the background of the element to the svg file just like you would an image. Won't be long now until all major browsers support border-radius; won't that be nice. I also looked in to getting something going for Internet Explorer and found this behavior script for IE that works really well. I'd only recommend it if you only have a few elements that need round edges. On the pages where I have a lot of buttons that have round corners, it took up to 10 seconds to process. Interesting idea though.

Nov
15

PHPUnit Follow-up: Code Coverage with Xdebug on Mac

It took me considerable amount of time to figure out the correct file to edit in order to have Xdebug work from the command line with PHPUnit's --report flag. This flag generates HTML files that look something like the following image:

code coverage of ASRA 2.0 with Xdebug

This displays the number of lines that have been run in the process of unit testing; and in a lovely readable format (see Xdebug's normal format to see how much more useful this is). To get PHPUnit and Xdebug working, start by following the tutorial in the previous article. Then to get Xdebug running, check out this post by Felx Geisendörfer. Follow steps 1 + 2. If you are using regular-old MAMP, 3 + 4 should get you going just fine. The problem I had was I am using MAMP Pro, so I was editing my "template" .ini file thinking that was where the lines needed to go. Xdebug was loaded as a browser module, but was not loaded when I ran the coverage report in PHPUnit. So, in Pro, you have to add the config options to /Applications/MAMP/conf/php5. This is the ini file that the CLI version of PHP uses.

Here are the lines I added to get it working. Note that you may also need to disable the ZendExtensionManager and the zend_optimizer extension for it to work..in MAMP just uncheck the box. Check the compatibility section on the install page for more.

[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.3
;zend_optimizer.version=3.3.3
;zend_extension=/Applications/MAMP/bin/php5/zend/lib/ZendExtensionManager.so

[xdebug]
zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20050922/xdebug.so
xdebug.remote_enable = 1

If you completed the other article, PHPUnit should be using MAMP's php, which should now have Xdebug rocking and you can do something like:

# 'report' is the name of the folder the html will output to
$ phpunit --report report My_Test 
Aug
21

Ignoring Files in TextMate's TODO Plugin

Lately, as I’ve been working on a huge Zend Framework library for rapid website development and content management, as well as the second version of my ASRA framework, I’ve been very into using Soryu’s TextMate TODO plugin. Trouble is, when you have the entire Zend library in your project (or any other huge library), you’re bound to have a ton of todo’s in your list that you don’t really “care” about.

Anyway, I just learned a super easy way to speed up and make things easier to maintain. Simply open the TextMate preferences menu and go to Advanced > Shell Variables. Add a new entry called TM_TODO_IGNORE and give it a value of Zend* (or even just Zend should work). The TM_TODO_IGNORE value just specifies a regular expression for files paths to ignore within your project, so basically this just ignores everything in the Zend library. Yay! Concise to-do list!

prev 1 2 3 4 next

Products

Goodies

T1EOS

Content Management System T1EOS: Content Management System

Our customized content management framework T1EOS manages articles, blogs, categories, events, tagging, images & galleries, a Facebook Connect integrated commenting system, and more — all out-of-the-box.

github

ASRA

A Simple Restful API

ASRA is a lightweight package that assists in the rapid development of simple APIs for exporting data for Flash, Flex or other applications.

Download

Plum Dumb

A Typeoneerror TextMate Theme Plum Dumb