Joe Lennon

Rants, Raves & Recommendations

Source Sencha Developer Conference – Day 1

with 5 comments

Day one of the Source Dev conference has been great – things kicked off bright and early this morning with an 8am keynote from Sencha’s James Pearce and an announcement from Aditya Bansod of Sencha’s new cloud services product line, Sencha.io. Some interesting points on the roadmap included:

  • ExtJS 4.1 will be released at some point this summer, with another 4.x release later this year
  • Sencha Touch 2 preview will be available at some point in the summer, with a final release targeted for Q3 2011

I get the impression that work has not started yet on Sencha Touch 2, but Sencha are gathering some ideas for changes and new features. It should be exciting to see what they come up with, especially given how amazing the first version of the product is!

The next session I attended was Ed Spencer‘s “Introducing ExtJS 4″ presentation. I have been following closely the progress with ExtJS 4, but this talk really cleared up some clear benefits of using the new version. Ed even went as far as to do some live coding in the session, illustrating how the new dynamic loading and MVC features make organizing and structuring an ExtJS application much more manageable. It was also great to see some Sencha SDK tools in action – these are going to make a huge difference when it comes to deployable high-performance production applications.

Following on from the Sencha.io announcement in the keynote, I had to attend Aditya’s session on the same topic to find out more. Right now, Sencha have made a commercial product from the tinySrc labs project, enabling developers to serve up much smaller image files to devices, without needing to create multiple versions of an image manually. More exciting was the announcement that freemium services for doing similar things with JavaScript and CSS files is on the way. This covers Sencha.io Src, but there is also the concept of Sencha.io Sync, which is in invite-only beta right now. It’ll be interesting to see how this evolves, but it seems to offer a means of storing data locally in an application to eradicate latency issues, sync’ing the data back to a central Sencha server when possible, and then replicating this data across devices. There was a cool demo of a crossword application, with changes made in a browser session updating immediately in a separate browser. Definitely one to watch, this!

The next session I attended was Jozek Sakalos (Saki from Sencha forums) speaking about how to write large applications. He had some good advice for developers regarding planning and organizing your projects before you start coding. I would have liked to see more ExtJS-specific and practical examples, but unfortunately time was pressing.

James Pearce was up again next for a talk on Theming and Sass. As someone who has done quite a bit of work with Sencha Touch recently, I am very familiar with Sencha’s use of Sass and Compass, and James’ presentation was very interesting. I learned some good tips about where to go to find all the different variables available for Sencha Touch theming, and it was great to find out about how theming works in ExtJS 4 and in the new ExtJS charts. I have to say James is a great speaker, very clear and to the point. At one point, James said that HTML5 is “a badge for the way the Web is changing”. With his permission, I might have to use that quote in HTML5 In Action, as I think it sums it up perfectly for me.

Went for lunch with my colleagues Darragh Duffy and Jonathan Reardon, and got to meet Martha Rotter, a developer from Dublin. Later at a coffee break I also got to meet Denis and Ian from EMC in Cork – great to see some Irish developers working with Sencha products. We’ll have to start a user group or something! Lunch was great, some really nice food – strangely enough coffee was not included though. Martha kindly sorted us out on that front though, so our caffeine needs were soon fulfilled!

After lunch, I attended Nils Dehl‘s talk on Ext.data and Ext.Direct. Nils uses Prezi for his presentations, and it really works well when showing large blocks of code samples.

The day wrapped up with Jay Garcia‘s presentation on creating extensions, plugins and components. I had an idea that Jay knew a lot about ExtJS (he wrote the book on it, after all) but I had really no appreciation for just how much knowledge of the underpinnings this guy has. He really cleared up a lot of things for me in relation to the differences between ExtJS 3 and 4 class systems and how loading works. I’m really looking forward to reading ExtJS 4 In Action and Sencha Touch In Action when they are published.

Looking forward to meeting more Sencha developers at tonight’s party, and hopefully day 2 of this conference will be as good as today was! If you’re at the conference and want to have a chat, send me a tweet or DM – I’m @joelennon on Twitter.

Written by Joe Lennon

May 5th, 2011 at 3:28 pm

Using Pydev for Google App Engine development on a Mac

with 5 comments

I’ve been experimenting with Google App Engine a bit recently and although it’s not without its problems, it fits really well with a couple of small projects I’m working on at the moment. Up until now, I’ve been mainly working with TextMate and the Google App Engine launcher, which is fine, but hardly an ideal development environment. That’s where Aptana Pydev comes in.

Pydev is an Eclipse/Aptana plugin for developing Python applications. It has great support for Django and other Python frameworks, and is a great all-round Python development tool. The feature that caught my eye the most was built-in support for Google App Engine development, but I ran into a few problems when I tried to get up and running with it on my Mac. In this post, I will walk through how I got it all working in the end.

There are several options for downloading Pydev. Eclipse developers can download it as a plugin, or if you don’t use Eclipse, Pydev comes bundled in Aptana Studio (an Eclipse-based IDE that is geared towards Web development). In this post I will cover the Aptana method, but it should be simple to extract the relevant parts if you are going down the plugin path.

Head to the Aptana Studio 3 download page (product in beta at time of writing) and download the disk image to your Mac. When you mount this image and open it, you should see a Finder window like the one in Figure 1.

Figure 1. Aptana Studio disk image

Figure 1. Aptana Studio disk image

Follow the simple instructions and drag the Aptana Studio 3 folder into the Applications directory shortcut. This will install Aptana in your Applications directory. You will see the files being copied from the image as shown in Figure 2.

Figure 2. Copying files

Figure 2. Copying files

When this is completed, you can open the Aptana Studio 3 folder in your Applications directory and launch Aptana by opening the AptanaStudio3.app file, as seen in Figure 3.

Figure 3. Finding AptanaStudio3.app

Figure 3. Finding AptanaStudio3.app

When you first launch Aptana Studio, you will see a blank workspace, as shown in Figure 4.

Figure 4. Blank Aptana Studio Workspace

Figure 4. Blank Aptana Studio Workspace

Now it’s time for the fun stuff. First, you need to create a new project. Press [Cmd] + N to open the New Project wizard. In the list of Wizards, you should see a folder named “Pydev”. Expand this folder and you will find an option “Pydev Google App Engine Project”, as shown in Figure 5.

Figure 5. New Project Wizard

Figure 5. New Project Wizard

Make sure you’ve selected the correct option, and hit the Next > button to continue. On the next screen, you will need to enter details about the project, including the name of the project, the type of project (Python, Jython or Iron Python), the grammar version to use and the interpreter. Before you fill out this form, you’ll notice that there’s a link “Please configure an interpreter” in the related preferences before proceeding. This is shown in Figure 6.

Figure 6. PyDev Project Wizard

Figure 6. PyDev Project Wizard

Click on this link and the main Aptana Preferences window will open, and you will be brought straight to the “Interpreter – Python” page of the Pydev preferences section. On the right-hand-side, there’s a list (currently empty) of Python interpreters, with two enabled buttons to the right of the list, New and Auto Config, as can be seen in Figure 7.

Warning: Don’t use Auto Config, on my system it found Python 2.6, and for Google App Engine development you’ll want to use Python 2.5.

Figure 7. PyDev Python Interpreter Preferences

Figure 7. PyDev Python Interpreter Preferences

Click the “New” button and Aptana will open the Select interpreter dialog. Enter the following values into the relevant fields:

  • Interpreter Name: Python 2.5
  • Interpreter Executable: /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5

If you prefer, browse to the location of the executable and select it. The dialog should look like Figure 8.

Figure 8. Select interpretor

Figure 8. Select interpretor

Press the OK button to add this interpreter. Aptana will do some preparation, and before long you’ll be presented with another dialog that needs your attention. This one looks like the screen grab in Figure 9.

Figure 9. Adding folders to the SYSTEM pythonpath

Figure 9. Adding folders to the SYSTEM pythonpath

In my case I simply accepted the default selections and pressed OK, but if you need to, you can select the other options. When you press OK, you should be back in the Aptana Preferences window, which should now look more like Figure 10.

Figure 10. Updated PyDev Preferences

Figure 10. Updated PyDev Preferences

You can now close this screen by pressing OK in the bottom right of the window. After you do this, Aptana will go off and do some work, and you’ll see a window like the one shown in Figure 11. This might take a minute or two to complete so be patient.

Figure 12. Aptana background work

Figure 12. Aptana background work

When this progress window closes, you’ll be back at the Pydev Project setup screen. Enter whatever project name you like, I’ve called mine “game-planner” which is the same as the application ID for my Google App Engine application. Make sure “Python” is selected as the Project Type, and change the Grammar Version to 2.5. If you only set up the Python 2.5 interpreter, you can leave the Intepreter set to “Default”, or alternatively you can change this to “Python 2.5″ if you are unsure. The completed project screen should look something like Figure 13.

Figure 13. Project dialog, filled out

Figure 13. Project dialog, filled out

Press the Next > button to move on to the next step of the Project Wizard. This step asks you to select the Google App Engine Directory. It is shown in Figure 14.

Figure 14. Google App Engine Directory

Figure 14. Google App Engine Directory

You can use the Browse button, but unless you downloaded the zip archive of the App Engine Python SDK, you will not be able to find the directory in Finder. This is because the SDK package that comes in the form of the “Google App Engine Launcher” is wrapped up in a .app archive, which can’t be explored in Finder. See Figure 15 for an example of this.

Figure 15. Cannot browse GoogleAppEngineLauncher.app

Figure 15. Cannot browse GoogleAppEngineLauncher.app

The location it is looking for is the location where the Google App Engine files dev_appserver.py, appcfg.py, the lib directory and so on are located. If you are using the launcher version of the SDK, this is usually in the following location:

/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine

 

If you paste this into the Google App Engine Directory field, however, you’ll notice that it results in an error. This error is shown in Figure 16.

Figure 16. Error finding django lib directory

Figure 16. Error finding django lib directory

The reason for this error is relatively straightforward – Google App Engine doesn’t have a directory named django at that path. Apparently this issue will be fixed in the next release of Pydev. However, as seen in Figure 17, there are two other directories that are very similar, django_0_96 and django_1_2.

Figure 17. django directories that are available

Figure 17. django directories that are available

To solve the problem, we can simply create a symbolic link named django, which will point to the django_0_96 directory. To do this, open Terminal (Applications > Utilities > Terminal) and issue the following commands:

$ cd /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/
$ ln -s django_0_96 django

 

If you issue the ls command after doing this, you should see that there is now what looks like a django directory. This is a soft link to the django_0_96 directory, and if any changes are made in django_0_96, they will automatically be reflected in the django directory. Sample Terminal output is shown in Figure 18.

Figure 18. Mac OS X Terminal Output

Figure 18. Mac OS X Terminal Output

Next, go back to Aptana and enter the directory path again (cut it and re-paste it back) to refresh the wizard. This time, you should see a much friendlier result, like the one shown in Figure 19.

Figure 19. No errors this time around

Figure 19. No errors this time around

Click Finish and the project will be created. You might be asked to switch to the Pydev perspective, as shown in Figure 20. It’s up to you whether you do this, I personally checked the Remember my decision field and pressed the Yes button.

Figure 20. Pydev Perspective

Figure 20. Pydev Perspective

You should now be in your Pydev Google App Engine project. From here you can create, run and debug your Google App Engine applications. The default Pydev workspace is shown in Figure 21.

Figure 21. Pydev Eclipse Perspective

Figure 21. Pydev Eclipse Perspective

If you have any questions about this post, or have comments, suggestions or improvements, please leave a comment. Thanks for reading!

 

Written by Joe Lennon

March 25th, 2011 at 1:25 pm

Beating Odin in Final Fantasy XIII

without comments

I’m playing Final Fantasy XIII at the moment and this evening I was playing and came up against the Odin Eidolon boss battle. The first time I started the battle, he killed me with about 2 moves. It was like the time I tried to fight the Midgar Zolom in Final Fantasy VII early in the game, I thought there must be a way to skip this battle. The next time I went in, I used Fortisol and Aegisol before the start and found it much more bearable. I kept swapping between the Dual Casting and Double Dose paradigms and the Gestalt meter filled up pretty quickly. But no matter what I did, I could never finish the battle, with Lightning being killed by the Doom counter over her head each and every time.

At this point I was getting frustrated so I went online for guidance, and the majority of people were suggesting strategies that were more or less what I was already doing, saying it was easy and they didn’t know why people had so much trouble with it. At this point I figured I must have made a mistake with my character leveling (of which there is very little really) up to this stage. Fortunately, before I decided to give up completely, I came across a blog post where a comment had the magical solution: when the Gestalt bar fills, you must press X (360) or Square (PS3) to “claim” the Eidolon. I had done this with the Shiva battle because the tutorial reminded me, but I completely forgot about this bit when it came to Odin.

Some people probably think I’m a blithering idiot (no worries, so did I), but hopefully someone who is having the same trouble as I did will find this and have the same “Duh!” moment when they realise what they’re doing wrong. When you know what you’re doing, this battle really should only take a minute or so and you should easily get the 5 star rating for it.

Some battle tips:

  • If you have them, use both a Fortisol and Aegisol shroud (press LB on 360, L1 on PS3, to bring up the shroud menu when you are in roaming mode, before you enter the battle. This will pre-protect your characters, so you don’t have to use the next tip.
  • If you don’t have any of these left, go into the battle with the Archmage paradigm applied and allow the Synergist character use the protective magic. It is absolutely essential that you do this at the start, Odin is vicious and will kill you very quickly if you don’t
  • Equip both characters with Spark Ring accessories if you have them (you should)
  • Make sure you’ve applied all the available Crystarium for both Lightning and Hope, to max out their HP, Strength and Magic stats as much as possible before the battle
  • Set the Battle Speed to “Slow” in Settings to give yourself some more time (you can change it back after the battle if you like)
  • When your characters’ health is near full, switch to Dual Casting and fire as much as you can at Odin to fill up his Gestalt bar
  • When your characters’ health dips into the yellow, switch to Double Dose to heal up
  • Keep an eye on the Gestalt bar at all times during the battle, as soon as it fills up, tap X (360) or Square (PS3) to finish the battle and claim Odin

Much thanks to the jkl, the person who left the comment on this post http://www.etftw.co.uk/blog/posts/183.

Written by Joe Lennon

March 21st, 2011 at 6:42 pm

What’s new in Lift 2.0?

without comments

Lift is a web application development framework that enables the building of web applications in the Scala programming language. Because it is powered by Scala, Lift can be deployed to any Java™ Servlet container such as Tomcat or Jetty, and can make use of both Java and Scala libraries and APIs. In June 2010, Lift 2.0 became available, and it boasts an impressive array of new features and highlights. This article describes many of these features and explains how they can benefit you in the development of your own web applications.

Lift is a free, open source web application development framework for building powerful, interactive, and dynamic applications using the Scala programming language. Scala is purely object-oriented, but, uniquely, it also has support for functional programming, giving you access to features such as anonymous functions, nested functions, curry functions, and higher-order functions. Scala runs in a Java Virtual Machine (JVM), making it compatible with Java applications and libraries. These traits mean that web applications powered by Lift can use both Scala and Java class libraries. In addition, Lift applications are packaged as Web Application Archive (WAR) files and can be deployed to any web application server that supports the Servlet 2.4 specification, including Apache Tomcat 5.5 and later.

Read the full article on IBM developerWorks at http://www.ibm.com/developerworks/web/library/wa-lift20/

Written by Joe Lennon

March 19th, 2011 at 3:38 pm

Build an Ajax application with the Dojo Toolkit

with 3 comments

The Dojo toolkit is a JavaScript library that makes the process of building large JavaScript-based Rich Internet Applications (RIAs) much simpler. With a wide range of features—from DOM querying and manipulation, Asynchronous JavaScript and XML (Ajax) request handling, excellent object-orientation support, and a full user interface widget library (Dijit)—Dojo is an excellent library to use to build a dynamic and interactive web application. In this tutorial, learn about many of the concepts of Dojo and the Dijit widget library through the development of a fully featured sample application, a contact manager system. This application lets a user browse, create, edit, and remove contacts (and contact groups) from a MySQL database. PHP is used on the server side to communicate with the database, with Dojo and the Dijit component library providing a rich, Ajax-powered user interface. The final result is a powerful web application that you can use as a foundation for your own RIAs.

Read the full tutorial on IBM developerWorks at http://www.ibm.com/developerworks/web/tutorials/wa-dojotoolkit/index.html.

Written by Joe Lennon

March 1st, 2011 at 6:45 pm