Aaron Newton's blog http://blog.pegasusdigitalmedia.com Web Design, 3d & More - Aaron Newton posterous.com Sat, 03 Apr 2010 05:29:32 -0700 Flare - a nifty tool for creating data visualisations http://blog.pegasusdigitalmedia.com/flare-a-nifty-tool-for-creating-data-visualis http://blog.pegasusdigitalmedia.com/flare-a-nifty-tool-for-creating-data-visualis
Flare

In my day-to-day, I stumbled on the 'Flare' project. Quoting their website:

"Flare is an ActionScript library for creating visualizations that run in the Adobe Flash Player. From basic charts and graphs to complex interactive graphics, the toolkit supports data management, visual encoding, animation, and interaction techniques. Even better, flare features a modular design that lets developers create customized visualization techniques without having to reinvent the wheel."

I've seen a lot of Flash graph engines, but this definitely takes the prize in terms of originality. If you're sick of the same old histogram, I'd suggest checking it out. I reckon you could generate some pretty cool art with this as well.

Go and check out the site (along with the demos) over at http://flare.prefuse.org/

Permalink | Leave a comment  »

]]>
Thu, 11 Mar 2010 22:09:06 -0800 How To Make a Bookmarklet For Your Web Application | BetterExplained http://blog.pegasusdigitalmedia.com/how-to-make-a-bookmarklet-for-your-web-applic-2 http://blog.pegasusdigitalmedia.com/how-to-make-a-bookmarklet-for-your-web-applic-2

How To Make a Bookmarklet For Your Web Application

Browser buttons (bookmarklets) are shortcuts that act like a simple browser plugin. Their advantages include:

  • Fast installation: Just add a link to your bookmarks
  • Convenient: Use features while on your current page
  • Easy to write: Bookmarklets are just like making a webpage; there’s no need to write a whole browser plugin
  • Cross-browser: The same bookmarklet can work in IE, Firefox, Opera and Safari.

Here’s a few bookmarklets I use regularly:

Anyone got any cool ideas for a bookmarklet they want me to build?

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Thu, 04 Mar 2010 04:09:00 -0800 Fixing Missing Folders in my Subversion (SVN) Repository http://blog.pegasusdigitalmedia.com/fixing-missing-folders-in-my-subversion-svn-r http://blog.pegasusdigitalmedia.com/fixing-missing-folders-in-my-subversion-svn-r

Sounds almost dirty, doesn't it?

I've been working some more with the Wordpress PODs CMS plugin this week, and I'm really begining to appreciate just how good it is. I am now at the point where I'm having more difficulty customizing the Wordpress pages then theming my own PODs CCK.

Something unusual did happen to me though - folders went missing from my subversion project! 

I was transferring SVN dump files between machines, and the whole site collapsed. My Zend CE log told me this was becuase the PODs plugin was missing - what the hell?

Here's what went wrong.

I copied my PODs plugin from another Wordpress plugin that was part of a checked-out repository. This included the .svn files from the other project. The result? Subversion got confused and didn't include these files in the project. I have also noticed that if you move folders inside the same project that are under versioning (contain the .svn folder) you get the same problem.

It is a simple problem to address.

First of all, try using a GUI like Tortoise SVN. This tool provides a 'move here' function which understands and adjusts versioning (thank you Daniel for this pointer). If the folder is outside the project but under versioning, you can also use 'export' (again using Tortoise SVN) to move an unversioned copy of the folder to the desired location.

If you have already made this mistake, try deleting the .svn folder inside your versioned folder. This may give you errors about unversioned files. In this case, rename the folder, clear out any .svn folders inside, then commit. This will delete the old folder reference, and then create the new one. You would then rename the folder and commit again. If this doesn't work, you may have to run the cleanup script.

This last solution is pretty messy, but it will let you fix the problem quickly and get on with your work.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Mon, 15 Feb 2010 06:02:14 -0800 Debugging PHP $_POST arrays using var_dump for "PHP Notice: Undefined index:" http://blog.pegasusdigitalmedia.com/debugging-php-post-arrays-using-vardump-for-p http://blog.pegasusdigitalmedia.com/debugging-php-post-arrays-using-vardump-for-p

I forgot to set my name attributes in a form today (deeeeer!), and was scratching my head a bit when this error started coming up for all my form elements:

"PHP Notice:  Undefined index:"

This is an easy enough problem to fix. Depending on your DTD, adding name attibutes in addition to id attributes will make the form post the data correctly. Here is a bit of a test you can try for yourself.

<form action="send.php" method="POST" id="contactForm" enctype="multipart/form-data">

<fieldset>                           

<label for="Name">Your Name </label>

<input id="Name" type="text" />

 <input id="sendMail" type="submit" name="submit" />

</fieldset>

</form>

Here is your basic form. In the page 'post.php' we add the following:

<?php var_dump($_POST); ?>

If we then posted our form, we would get the "PHP Notice:  Undefined index:" error in our debugger, and you would get the following array from var_dump

array(1) { ["submit"]=> string(12) "Submit Query" }

Notice that the array has one key "submit". Some forums suggest using if(isset($_POST['submit'])) {} to solve this error, but obviously since this key exists this is not necessarily the best solution. Another solution would be to experiment with the form to see which attributes cause the input values to show up in the $_POST array. Modify your "Name" input element to include:

name="Name"

Post the form again and we get...

array(2) { ["Name"]=> string(5) "Aaron" ["submit"]=> string(12) "Submit Query" }

Ah! That's better. This time I can see my "Name" input value has been set to Aaron and successfully posted, which is what I want to happen.

This may seem like an overkill solution to this problem, but consider that var_dump may be useful to debug forms with a lot of post values; as an alternative to writing a whole heap of if statements to test which values are set in form post. Once we see that $_POST is an array/array like object (?) we can use the regular array syntax to get the post value, e.g. $_POST['Name']

I hope that made someone's day a little less frustrating ;)

 

P.S. Jayne said she'd bring me a cookie if I posted this duck -enjoy!

,----,   ___.`      `,   `===  D     :     `'.      .'        )    (                   ,       /      \_____________/|      /                          |     |                           ;     |               _____       /     |      \       ______7    ,'     |       \    ______7     /      \       `-,____7      ,'   jgs^~^~^~^`\                  /~^~^~^~^  ~^~^~^ `----------------' ~^~^~^ ~^~^~^~^~^^~^~^~^~^~^~^~^~^~^~^~

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Wed, 10 Feb 2010 20:40:51 -0800 Using body_class() in PODS CMS for Wordpress http://blog.pegasusdigitalmedia.com/using-bodyclass-in-pods-cms-for-wordpress http://blog.pegasusdigitalmedia.com/using-bodyclass-in-pods-cms-for-wordpress

 

I have been playing around with a CMS plugin for Wordpress called PODS. Here is a function for functions.php which might come in useful if you want to add POD page URL variables and page pod types to your body class:

 

 

function pods_body_class($classes)

{

    global $pods;

    if ( is_pod_page() )

    {

        $classes[] = "pod";

        if( is_object($pods) )

        {

            $classes[] = "pod-".$pods->datatype;

        }

 

        $classes[] = ' '.pods_url_variable(-2).' '.pods_url_variable('last');

    }

    return $classes;

}

 

add_filter('body_class','pods_body_class');

 

 

The body_class function is a useful built in Wordpress function that prints the page_id, blog post category etc. to the class names for the body element. It can be implemented like so:

<body <?php body_class(); ?>>

When implemented with the above code, this will return the last two URL variables, i.e. for the rewritten URL example/parent/child/. If the POD was 'cars' this would return body class names like this:

pod  parent child

If you assign corresponding class names to your sub-navigation elements (e.g. <ul class="parent">) you can then use CSS to highlight active menus like so:

.parent .parent { font-weight:bold };

Enjoy!

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sun, 07 Feb 2010 00:44:20 -0800 Vector Rabbit http://blog.pegasusdigitalmedia.com/vector-rabbit http://blog.pegasusdigitalmedia.com/vector-rabbit I've been playing around with vectors a lot in Photoshop lately. Here is the before:

Media_httpwwwyorkblog_pcgma

and after:

Vector-bunny

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Tue, 02 Feb 2010 17:56:04 -0800 Prevent Client-Side iframe Hotlinking with Javascript http://blog.pegasusdigitalmedia.com/prevent-client-side-iframe-hotlinking-with-ja http://blog.pegasusdigitalmedia.com/prevent-client-side-iframe-hotlinking-with-ja

I thought frames went out of style a decade ago but apparently everyone feels the need to duplicate the Digg Bar. I don’t trust these framed services so I choose to use a javascript snippet that prevents my site from being in someone else’s frame.

The Javascript

if (top.location != self.location) {
        top.location = self.location;
}

This comes in very handy if you want to prevent people from hotlinking your content with iframes.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Mon, 01 Feb 2010 21:47:00 -0800 Adding a newline (i.e. 'carriage-return' or 'line-break') in MySQL statements http://blog.pegasusdigitalmedia.com/adding-a-newline-ie-carriage-return-or-line-b http://blog.pegasusdigitalmedia.com/adding-a-newline-ie-carriage-return-or-line-b

There was suprisingly little information on how to insert a newline character into a MySQL script. Here is what I found:

 

SET @newline=CHAR(10);

 

Set a user variable for the (unix) newline character. You can then use it like so:

 

select @newline;

 

(returns a newline)

 

select concat('something,', @newline, 'something', @newline, 'darkside...') as emperor_dialogue;

 

something,

something,

darkside...

 

Enjoy!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sun, 27 Dec 2009 05:50:00 -0800 Making seamless texture tiles in Illustrator for use in Maya or Photoshop http://blog.pegasusdigitalmedia.com/making-seamless-texture-tiles-in-illustrator http://blog.pegasusdigitalmedia.com/making-seamless-texture-tiles-in-illustrator

There have been a couple of situations in the last few weeks where I have needed to generate a seamless texture for use on a 3d model or Photoshop composition. While this sounds like a simple task, it can actually be extremely frustrating to get it right unless you know the correct technique to begin with.

Here is a decent tutorial for generating resolution independent, seamless texture tiles in Illustrator for use in Maya or Photoshop:

http://www.bittbox.com/illustrator/how-to-make-a-perfect-seamless-vector-pattern

To get this into Maya, you will need to export the pattern out to a jpg file, which can be created directly from illustrator using the 'file' > 'save for web and devices' dialogue (N.B. I saw this under the assumption that you will be using Mental Ray for Maya, which seems to struggle with formats like PSD). Once you have created your Maya file texture node, you can tweak the 'UV Texture settings' under the attribute editor to change the scale of the texture tessellation.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Tue, 22 Dec 2009 22:45:00 -0800 Spring IDE plugin for Eclipse - correct download location http://blog.pegasusdigitalmedia.com/spring-ide-plugin-for-eclipse-correct-downloa http://blog.pegasusdigitalmedia.com/spring-ide-plugin-for-eclipse-correct-downloa

I have been having a lot of trouble today trying to find the Eclipse plugin for Spring. I eventually found it here:

http://springide.org/updatesite/

This URL should work with the Eclipse install/update GUI. Enjoy!

P.S. according to some forums you will need to uncheck the 'Spring IDE Dependencies' options for versions earlier than Eclipse 3.2.x.

Update:

You may get errors like the following:

 

Cannot complete the install because one or more required items could not be found.

  Software being installed: Spring IDE AJDT Integration (optional) 2.3.0.200912170948-RELEASE (org.springframework.ide.eclipse.ajdt.feature.feature.group 2.3.0.200912170948-RELEASE)

  Missing requirement: Spring IDE AOP Visualiser UI 2.3.0.200912170948-RELEASE (org.springframework.ide.eclipse.ajdt.ui.visualiser 2.3.0.200912170948-RELEASE) requires 'package org.eclipse.contribution.visualiser.core 0.0.0' but it could not be found

  Cannot satisfy dependency:

    From: Spring IDE AJDT Integration (optional) 2.3.0.200912170948-RELEASE (org.springframework.ide.eclipse.ajdt.feature.feature.group 2.3.0.200912170948-RELEASE)

 

 

To fix this, you need to add the Apache AspectJ tools for Eclipse. AspectJ is an Aspect Oriented Programming framework which is very popular, and can be used within Spring. If you check all of the options for the Spring download, you may want to download all of the AspectJ dependencies first. 

Under 'Help' > 'Install New Plugins' go to 'Add' and use http://download.eclipse.org/tools/ajdt/35/update as the download site (you may need to adjust for your version of Eclipse, see: http://eclipse.org/ajdt/downloads/).

Once you have installed all the plugins/dependencies that you want, try installing Spring again using http://springide.org/updatesite/ inside Eclipse.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sat, 12 Dec 2009 06:18:15 -0800 nickelwound.com - MySQL: Join Tables from Different Databases http://blog.pegasusdigitalmedia.com/nickelwoundcom-mysql-join-tables-from-differe http://blog.pegasusdigitalmedia.com/nickelwoundcom-mysql-join-tables-from-differe

If you should need to access tables from multiple databases, or even JOIN tables from multiple databases, you can (provided the user you're connecting with has sufficient privileges):

SELECT
    c.customer_name,
    o.order_date
FROM
    db1.tbl_customers c LEFT JOIN
    db2.tbl_orders o ON o.customer_id = c.id

I needed to inner joing two geo-data tables across a MySQL database using only a single connection.

I should add that both users need the same permissions for this to work.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sat, 12 Dec 2009 06:14:00 -0800 GI_Joe - Free Misc Rendering Scripts / Plugins Downloads for Maya http://blog.pegasusdigitalmedia.com/gijoe-free-misc-rendering-scripts-plugins-dow http://blog.pegasusdigitalmedia.com/gijoe-free-misc-rendering-scripts-plugins-dow

GI_Joe 2.1 (maya script)

This script is great for faking GI (Global Illumination) using the Maya Software renderer.

It creates a hemi-sphere of lights which simulate environmental 'light-bounce' and give 3d rendered objects a more realistic volume.

Click here to download the file from Creative Crash. You will need to login to download the file, but I'd recommend Creative Crash as a site anyway.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sat, 12 Dec 2009 06:12:58 -0800 zap's mental ray tips http://blog.pegasusdigitalmedia.com/zaps-mental-ray-tips http://blog.pegasusdigitalmedia.com/zaps-mental-ray-tips

Fire and Ice - rendering Diamonds and Gems in mental ray

Sweet Mental Ray tutorial for rendering diamonds with caustics.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Wed, 25 Nov 2009 15:48:44 -0800 How do I tell what version of Linux is running on my VPS or dedicated server http://blog.pegasusdigitalmedia.com/how-do-i-tell-what-version-of-linux-is-runnin http://blog.pegasusdigitalmedia.com/how-do-i-tell-what-version-of-linux-is-runnin
uname -a && cat /etc/*release

Run this command to see detailed information about your linux distribution, e.g.

root@dev:~# uname -a && cat /etc/*release
Linux dev.demonzmedia.net 2.6.18-028stab064.7 #1 SMP Wed Aug 26 13:11:07 MSD 2009 i686 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sun, 22 Nov 2009 21:25:18 -0800 ImJustCreative - Cool Designer's Blog with Lots of Free Fonts http://blog.pegasusdigitalmedia.com/imjustcreative-cool-designers-blog-with-lots http://blog.pegasusdigitalmedia.com/imjustcreative-cool-designers-blog-with-lots

Aldo Open - Free Font

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Wed, 18 Nov 2009 16:20:19 -0800 Really awesome architecture http://blog.pegasusdigitalmedia.com/really-awesome-architecture http://blog.pegasusdigitalmedia.com/really-awesome-architecture

Check out these absolutely amazing designs:

http://www.specifier.com.au/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Sat, 14 Nov 2009 04:38:45 -0800 The Associated Press: Splash! NASA moon crash struck lots of water http://blog.pegasusdigitalmedia.com/the-associated-press-splash-nasa-moon-crash-s-0 http://blog.pegasusdigitalmedia.com/the-associated-press-splash-nasa-moon-crash-s-0

This image provided Friday, Nov. 13, 2009 by NASA shows the ejecta plume created by the LCROSS Centaur upper stage rocket about 20 seconds after after impact Oct. 9, 2009. It turns out there's plenty of water on the moon- at least near the lunar south pole, scientists said Friday. (AP Photo/NASA)

I'm gonna get me some of that moon water!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Tue, 10 Nov 2009 20:36:41 -0800 Giant robot in Tokyo http://blog.pegasusdigitalmedia.com/giant-robot-in-tokyo http://blog.pegasusdigitalmedia.com/giant-robot-in-tokyo

Check out this real, 59 story robot which was constructed in North Shiokaze park (Tokyo).

Life size gundam robot

Just awesome…

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Wed, 04 Nov 2009 23:07:07 -0800 Good Facebook website integration tutorial from Sitepoint http://blog.pegasusdigitalmedia.com/good-facebook-website-integration-tutorial-fr http://blog.pegasusdigitalmedia.com/good-facebook-website-integration-tutorial-fr

I have been somewhat successfully developing some Drupal based Facebook applications in my spare time. The Facebook API documentation is like a bottomless pit, and I've just found this Sitepoint article which explains the process well:

http://articles.sitepoint.com/article/developing-facebook-platform

Enjoy.

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton
Tue, 03 Nov 2009 18:53:36 -0800 Presentations from the 2009 Tokyo Game Show http://blog.pegasusdigitalmedia.com/presentations-from-the-2009-tokyo-game-show http://blog.pegasusdigitalmedia.com/presentations-from-the-2009-tokyo-game-show

Here are some great game software presentations from the 2009 Tokyo Game Show:

http://expo.nikkeibp.co.jp/tgs/2009/en/visitor/sown.html

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/169379/milk.jpg http://posterous.com/users/4avCCuwy1eCt Aaron Newton aaronnewton Aaron Newton