If you ever have an automatic update fail sometimes your WordPress install can get stuck in maintenance mode. I just had this happen to me and was able to find a quick solution.
Log into your server via FTP and look for a .maintenance file, delete it and you should be up and running again.
I just heard that my former employer Les Stroud is going to be doing more episodes of Survivorman – but this time for 10 days instead of 7.
If you’re not familiar with Survivorman you should be. It basically invented the Survival TV genre – and no not the reality TV, I can win a car crap – the real stuff where people are actually required to know how to do it.
I loved the show and am definitely looking forward to the new episode(s) both as a fan and a friend of Les’ and I wish him and the Les Stroud Productions team the best.
Another WordPress theme development project. This was a fun project which some unique challenges. The great layout was done by the very talented Luke Despatie
I have been creating a code base for a Screen Manager system that I am using for an iOS app I am building in AS3. I wanted to create a dynamic way to reference and instantiate classes that represent each of the Screens in the app so I can reuse this for other applications in the future and to make it a lot less code intensive.
I setup a series of static variables that held string names to represent each of the Screens in the application. Then when I want to create the screen and add it to the stage I use the getDefinitionByName() method and pass the string name of the class. Continue reading “getDefinitionByName”
I was writing a post about Events in AS3 and while explaining why in my opinion one approach to passing data is preferable to another I stumbled across the phrase “Set it and forget it” when it comes to programming. I think that this is a great way of describing how I like to write code and is a pretty good way of determining when a certain functionality should be abstracted into it’s own class or sub class.
The basic concept is that as a programmer I shouldn’t need to remember anything special about the class I have just written.
Obviously I’m not referring to things like a particular method or getters/setters but rather little gotchas that you won’t remember 6 months after writing the class.
For example, I was writing an ImageLoader utility class and added some functionality to create a thumbnail dynamically using the BitmapData class. I was pretty happy with the class and it worked very easily, once the data was available an Event was fired and a Getter method was called to return the bitmap. The only issue was that I was returning a Bitmap and MouseEvents are not triggered by Bitmaps so I was having to wrap the Bitmap in a Sprite and then assign listeners. As you can see, the extra step I have to remember is tedious and so I re-approached the class and wrapped the Bitmap in a Sprite before returning it. No fuss, no muss. Now I can just use the class without having to remember anything. I can “Set it and Forget it”
Garbage collection can be a big deal when writing complex programs in Actionscript. Not removing EventListeners is probably one of the biggest sources of AS holding onto memory it doesn’t need.
There is a very easy way to allow GC to handle your event listener clean-up for you when creating a new event listener – the useWeakReference argument.
Here is some standard code we’ve all done million times when creating a button:
var button:MovieClip = new MovieClip();
The two arguments are pretty straight forward the first is the event we’re listing for and the second is the function that is called once the event is fired, but there are actually 5 arguments that can be passed to addEventListener() here is the method definition:
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
the 5th argument (useWeakReference) is false by default but by setting to true, this eventListener will be automatically removed and freed for Garbage Collection when required.
Here is the new eventListener code updated to make use of useWeakReference.
3 Jewels in my Crown was a very fun WordPress theme to work on. It features many different custom image sizes based on a Featured Image and does all of the resizing work for the user. One really great feature is the ability to select certain posts as “Featured’ by using a custom taxonomy I set up. I could have used a category for this but wanted to avoid any duplicate content issues with search engines.
Overall this was a great learning experience for me and I really dove into the lower level features that WordPress has to offer.
I have been developing an AS3 library for the video publishing company Castfire on my own for the past little while and recently got in touch with them about continuing the endeavor. I thought it was a shot in the dark but they were more than willing to help out and so here is the first of, I hope, many articles on the Castfire API and the class library I am working with them to create for it.
The point of this library is to allow Flash devs like myself to easily access the Castfire API when creating custom video players.
I have been working on an update to my Easy Analytics plugin for WordPress and it’s almost ready. It’s a very big change in that I have added the ability to pull page stats and store them in a custom table in the WordPress database.
I have attempted to use the Google Analytics API before with limited success but this time around I used a very good PHP library called GAPI (Google Analytics PHP Interface). It is free to use and made the whole process of getting the data from GA very simple and is allowing me to focus on the plugin interface and programming options.
The catalyst for this addition to EA came from one of my clients. The project required a WordPress theme that pulled the most popular posts into a page. That in and of itself is not a big deal as there are plenty of plugins that will pull the most commented posts from the database but she wanted to use her Google Analytics stats as the basis.
I took a look around WordPress.org to see what options there were for plugins and I found that while many would connect to GA and pull the data in for use, the formatting options were limited to a sidebar widget or they would only output a list of links. I wanted more control over what each post looked like.
Currently I have the data being pulled in and displayed, There is a noticeable load time for the page so I am working on a way to cache the data in the database so the pull only happens once a day – which will reduce load times and since GA updates on a 24 hour delay anyway it’s extremely redundant to query the server every time a visitor hits the page.
I want to make the system as automated as possible so probably the first time someone hits either the Admin section or the page itself the pull will happen and the database will be updated. That way there is no need to manually hit a button to update the stats.
I will keep you posted on my progress!