I have been reviewing some books from  Packt Publishing lately, and I’m now expecting a copy of PHP 5 E-commerce Development in a few days.  I have been looking forward to for a while, as I will be working on a similar project in the near future. Here is the lowdown:

Php 5 eCommerce Development Book Cover

Php 5 eCommerce Development Book Cover

This book will show you how to create your own PHP framework that can be extended and used with ease, particularly for e-commerce sites. Using this framework you will be able to display and manage products, customize products, create wish-lists, make recommendations to customers based on previous purchases, send email notifications when certain products are in stock, rate the products online, and much more.

You can check out the sample chapter Enhancing the User Experience now.

This article is a result of my experiences with streaming MP3 streams with AS3 on a ATOM-based device. After playing a stream for a given period of time the Flash Player kept crashing for no apparent reason. After some investigation I found a memory leak within my streaming application, and after further investigation I was able to narrow it down to the Sound class in AS3 (with good help from this blog post by Madarco). I quote:

“While you listen to an mp3 in streaming mode: snd.loadSound(url, true), flash will keep in memory the music played.”.

Now, when you have a continuous stream this means trouble. The memory used by the stream will not be released until the stream is closed.

Based on the info provided in Madarco’s post I spent some time working on a solution that would satisfy my needs. I ended up with an approach that initiates a second stream once the first has a buffer of a given size. Once the limit is reached I initiate the second stream at zero volume, then use GreenSock’s VolumePlugin tween to cross-fade the two streams. Once this is done, I free the memory reserved by the first stream and swap the references.

A complete working implementation can be found at PasteBin. For the sake of demonstration I’m swapping streams after 500kb, but this is clearly not an ideal limit for real world usage. This can also be tweaked to take the amount of used memory and / or time played instead of just looking at the buffer size when deciding when to swap streams. I still have quite some testing ahead before I feel comfortable using this, but it’s a good start. Hope this can help others faced with the same problem.

Book review: Papervision 3D Essentials (follow link to buy)
ISBN 1847195725
ISBN 13 978-1-847195-72-2
Publisher: Packt Publishing
Author: Paul Tondeur and Jeff Winder.
This review here is long overdue, but since work got a bit hectic, and I spent some time moving it got pushed back.

Papervision3D Essentials Cover

Papervision3D Essentials Cover

Short version: If you want to get started with Papervision 3D, get this book. It’s a well written, great introduction for people new to Papervision3D, as well as a good reference for more experienced developers. It covers everything from basics to filters, effects and performance topics.

Longer version: Before I started reading this book I had never used Pv3D except looking at some neat demos. I had some experience with OpenGL from way-back, so the basic 3d concepts were not new to me.  As I got started I found that most of what I knew from general 3d graphics development was covered pretty well in the first few chapters. From the basic building blocks, to coordinate systems and primitives. The book starts out with a chapter dedicated to setting up authoring tools for compiling the code created during the book. Both Flash CS3/CS4 and Flex/Flash Builder is covered. After that it deals briefly with some core AS3 concepts before moving on to fundamental 3D subjects. Everything is explained really well, and as the book progresses trough the rest of the chapters it details subjects as drawing primitives, adding materials, setting up cameras and loading external models, then going on with particle systems, external models, filters and effects. A chapter is also dedicated to performance optimization. The book offers a number of good examples, also available on-line.

The authors are clearly very comfortable with the subjects they are covering, and discussing pretty much every topic in a language that makes it easy to follow, also for less experienced developers. In my opinion this is a very well written book that I would not hesitate to recommend to beginning developers as well as experienced.

Book review: Flex 3 with Java (follow link to buy)
ISBN: 1847195342
ISBN: 13 978-1-847195-34-0
Publisher: Packt Publishing
Author: Satish Kore

Flex 3 with Java Cover

Flex 3 with Java Cover

Short version: If you are a Java / PHP developer seeking to get started with Flex, building on your skills as a server-side developer, this book will do you good. If you are new to software development, or just started out I would recommend you check out Essential ActionScript 3.0 by Colin Mook, then come back to this book when you have some experience doing applications with AS3.

Slightly longer version: Some time ago I reviewed Mastering phpMyAdmin 3.1 from Packt Publishing, and since they had some interesting books on Flash / Flex I volunteered to review a few more.
First out is Flex 3 with Java. It’s a 300 page book, dealing with Flex, Java and how you can build solutions using BlazeDS as a backend.
I first checked out Flex back when the Flex 3 beta came out. At that time I was doing PHP with the Prado Framework, and instantly felt like home within the Flex IDE. However, I never took the time to really get into Flex, and my knowledge of ActionScript was pretty limited at the time.
I’ve now been working with AS3 for six months, and I’ve got a pretty solid grip on it. Most of the work I’m doing is pure AS3 (no Flash IDE, no Flex SDK), but I’ve got some very interesting side-projects built on Flex in the works as well.

The book assumes you have no experience with Flex / Actionscript from earlier. Now, it is clearly written for a more tech-savvy audience. You do not need to be a experienced developer to follow the subjects covered, but it will most certainly help to have done some software development before picking it up. The author gets a bit ahead of himself on some topics in the book, but it’s not a big problem. However, I would have liked to see a “who is this book for” section at the beginning, stating that this books is well suited for developers wanting to pick up Flex.
As expected it spends the first few chapters dealing with installation on the Flex SDK / tools as well as a brief but good coverage of AS3 and the basics of MXML.

Going into this book I was expecting the majority of the contents to cover the actual interop between Java and Flex. The book clearly deals with much more than that. Given that I’ve been trough a number of Flex and AS3 books the last months I think I would have preferred a book that was focusing more of it’s energy on the core subject instead of peripheral topics such as styling, packaging and deployment and i18n support. I totally agree that these subjects are important to master, but I think it would have been better if the book focused more on the actual interops topics as mentioned above. For me the books falls a bit between two chairs, as it does not spend enough time on basics to give the complete beginner a deep enough intro to Flex and AS3, yet not enough on the heavier side for the more experienced developer.

Oh, the book is also available as PDF if you prefer that.

Download Chapter 5 – Working with XML

PS: Check back soon as I will have a review of Papervision3D Essentials ready!

Nov 062009

Tonight it’s time to get started on the Christmas beer. The Norwegian beer-club “Norøl” is hosting a Christmas beer festival tonight, which should be pretty good. Perfect warm-up for the Oslo Whiskyfestival tomorrow.  On a side-note, I picked up S.T.A.L.K.E.R. – Shadow of Chernobyl a couple of years back when it was first released. After playing the first mission I was so disappointed that I uninstalled it. Last week I decided to give it another go, and I came across a mod called STALKER Complete 2009 which improves everything from game mechanics to graphics. The game is now very playable, and a perfect substitute for Fallout 3. If you are into that kind of thing, go pick it up. Steam has a 5 euro special on it these days, so there is no excuse to not get it. Also, check out “the real STALKER“. Looks fun (if you don’t mind some radiation sickness).

Now, for some links:

Nov 052009

After some time of inactivity I’ve decided to breath some life into this blog. This post is the first under the category “Evening reading”, which contains rambling on current events and some good reads I’ve come across. Expect more of these. As for content in general I’ve got a couple of book reviews lined up, some notes on my experiences with Actionscript3 and Flex, and a post on setting up your own dump of Geonames / GeoIP.

On a side note, I’m moving by the end of the month. Hooray for a new place!

So, Adobe CS4 suite apparently does not support case sensitive file systems. In this day and age this is plain out retarded. I wish Apple would make case sensitive the default FS when installing OSX. That would probably light a spark for Adobe.

Following my review of Mastering phpMyAdmin 3.1 Packt Publishing was kind enough to send me a couple of more books to review. While I am waiting for these books to get here I have gotten my hands on some sample chapters. Check them out!

Papervision3D Essentials

Papervision3D Essentials Cover

Papervision3D Essentials Cover

Jeff Winder, Paul Tondeur
ISBN 13: 978-1-847195-72-2

Download Chapter 8 – External models

Flex 3 with Java

Flex 3 with Java Cover

Flex 3 with Java Cover

Author Satish Kore
ISBN 1847195342
ISBN 13 978-1-847195-34-0

Download Chapter 5 – Working with XML

Mastering phpMyAdmin 3.1 Cover

Mastering phpMyAdmin 3.1 Cover

Book review: Mastering phpMyAdmin 3.1
ISBN: 9871847197863
Publisher: Packt Publishing
Author: Marc Delisle

I had pretty much forgotten phpMyAdmin when I got a mail from Swati at Packt Publishing asking me to review this book. It’s been a very long time since I last used phpMyAdmin. When I first started out with web development (under Windows) and PHP I was hosted on a shared web host. They had phpMyAdmin installed as their main database management tool. With little to no knowledge on databases I was very happy to be able to do my basic list of operations to get stuff working. Needless to say I was a lightweight user.

Fast forward to today. I’ve moved on to Linux and the way of the command-line as many others, using the MySQL Gui Tools (Query Browser, Administrator) in addition. The tools from MySQL sure have their quirks and bugs, but they have mostly suited my needs for the last years. So, how does phpMyAdmin hold up, and is this the right book to get you started?

The book, written by Marc Delisle, clocks in at 326 pages, split into 18 chapters. The topics range from basic installation and database / table management to the “Multi-Table Query Generator” amd “The Relational System”.

The first few pages of the first chapter explains a bit background info on the software, which is pretty much skim-though-if-interested. More interesting, it covers installation for various platforms. The coverage on the installation parts can be a bit short for new users, but should be sufficient in most cases.

I especially liked chapters 2 and 3. Chapter 2 deals with authentication, which is pretty well covered, and the features are surprisingly extensive. Previously I was a bit reluctant to use phpMyAdmin in a production environment due to the lack of proper authentication, but these added features grants it a new evaluation. In chapter 3 the author spends time explaining the GUI itself and how it can be customized. Some parts of this section will definitely be interesting for people doing web hosting as it allows some branding of the software itself as well as laying down some ‘ground rules’ on the feature set to expose. In addition there are tips on user-centric adjustments for optimizing the work flow for the developer using the software. When using it on a regular basis this information is very nice to have.

Chapters 4 and 5 and 6 deals with database, table and data management. These chapters will probably be skim-trough material for most experienced developers, as the GUI is quite self-explanatory when it comes to these kind of actions. However, it’s worth mentioning that the author points out lots of configuration keys for controlling both the GUI, behavior and again features offered. Nothing is crucial for the lightweight user, but if phpMyAdmin is your main tool for the job you’d want to read these chapters in detail as well.

The coverage of exporting schemas and data is quite well done. Again I was surprised with the list of formats supported by phpMyAdmin. The author takes care to describe the various formats, as well as server-side requirements and how-to’s where applicable.

There is a chapter dedicated to searching, which I do not think needs a whole chapter on it’s own since it’s also very intuitive to use the GUI here. However, the chapter is quite short. The same goes for table and database operations which are also covered. Again I find the GUI clear enough for most of these tasks to be straight forward.

Chapter 11 deals with ‘The Relational System’, which I’ve never heard about. Turns out it’s pretty neat! The author does a good job of covering the tool and it’s features. It takes a bit of extra configuration to get it running (create the phpMyAdmin database). This is basically a tool that lets you work visually with your database, seeing relations between tables etc. I’ve mainly used MySQL Workbench when I’ve had to generate a model based on a database. This is a viable replacement. The chapter dealing with system documentation can come in handy if you like to document your schema.

There is also a chapter dedicated to MySql 5.0 and 5.1 features which may come in handy if you are up to date on that front.

I’ve learned that phpMyAdmin has evolved quite a bit, especially in terms of authentication features and installation scripts. I was quite happy to set up the config by hand, but I think the guided setup script is a quite nice feature to new developers. My impression of phpMyAdmin has definitely changed. I used to view it as a “hobby-developers-tool” for database access, but I’ve come to realize that it offers a wast selection of features that might reduce both time and complexity for database management. For shared web-hosting and development environments it’s a really nice tool to have.

The book does a very good job at documenting phpMyAdmin. Some parts of the application are really too basic to describe in detail in a book, however the author has tackled this nicely by adding references to configuration tweaks and settings which makes these chapters interesting to the more advanced users.If phpMyAdmin is your weapon of choice when it comes to database management you’d definitely want to read this book. If you want to take it for a spin first, check out this sample chapter.

I just finished the initial trial migration of a Discus v4.x based board over to vBulletin.

Now, I’d like to write a few words on Discus. I cannot see why anyone looking to set up a new board would choose this software. It’s actually file based (!). Yes, you heard me. The posts, users and threads are stored in (plain) text files. I was quite surprised the first time I got around to checking out what I was supposed to migrate. If you head over to their site and check out a demo-site or two you’ll notice that the whole board seems a bit … unprofessional. It currently sells for 149 USD, which is quite amazing when you can get vBulletin for 180USD, or even phpBB for free. I went with vBulletin because they supported (at least partial) import from Discus, as well as the email based service in case I got stuck.

Now, the data migration. Upon purchasing vBulletin I got a migration utility called ImpEx which supports quite a number of boards to import from. Discus is listed as a tier 3 board, meaning it’s not actively supported anymore.. not a good sign, but still worth a shot.

Here is a quick recap of the required actions:

1. Download vBulletin and ImpEx from vBulletin.com
2. Create a new database for vBulletin
3. Install vBulletin as described here.
4. Install the ImpEx tool as described here.
5. Configure ImpEx as described here.
6. Run the ImpEx tool for Discus

Now, in step 6 there are some modules to import. Some of them runs in a matter of seconds, while others takes up to 10 minutes in my case. I’m not sure if the script actually refreshes, so one might want to up maximum execution time for PHP to be safe.

To my surprise everything went absolutely fine. Not a single hickup in the migration scripts. After the data was imported I followed the post-migrate instructions and did some data verification. Everything seemed to be present, but I was not able to see any threads in the forums. I could find them with searching, and when I opened a thread it clearly stated that it was belonging in the correct forum. After looking around for some time I discovered that the forums from Discus was now configured to act as categories. I solved this by going to Edit Forum -> Act as Forum and set it to Yes for each forum. When I got back to the forum listing everything was in order.

The only things left is to move the forums around some, get a proper language pack and some other minor adjustments. All in I’m quite satisfied with the whole process. Kudos to vBulletin.