Full frontal JavaScript conference in Brighton

Posted on November 27th, 2011 by thiswayup.
Categories: Development.

Full Frontal is a JavaScript conference focused predominately on the front end, this is a jumble notes and reflection on it. After missing it last year, I made it a point to get a Full Front conference as early as possible and join in the early bird tickets, an absolute bargain at £120. 

Warm up at asynch.js meetup

Having lived in Brighton for a few years in my Uni years, I was quite keen to get down there as soon as I could and get a nice bit of sea air. I travelled down the night before so I can attend the local javascript meetup, Asynch.js which is run by the rather nice chap Prem. The night was a lightning talk type setup for a show and tell session. I got there late so only saw half the talks but I managed to see a couple of interesting things including:

  • An AR app built with my fave development platform Titanium
  • A Phonegap based framework
  • Json library implementing the extended verbs of REST. 

Since there was over 70 people signed up on Lanyard, there was quite a few people who ditched the idea and went straight to the pre-conf social (ok get drunk at the pub).

The conference setup

The venue was the Duke of York Picturehouse and it was pretty damn cool. Very handy having it at a cinema with comfy seats and a gigantic screen behind the speaker. There was the one main track and everything ran really smoothly from what I can tell. I'm always impressed when I attend events like this with so much co-ordination involved and having it go off without any major hitches. Well, at least I didn't see any :) Ofcourse there was the issue with the Wifi, but we were told well advance of the issue. Maybe they should look at multiplexing a load of usb wifi dongles :)

 

Presentations

I was amazed by the quality of the speakers, the content was overall nothing short of spot on. I felt I wasn't really disappointed by any of them. The range of topics covered ranged across the spectrum from very technical to architectural and ones which left you a nice warm feeling inside. As a quick round up on the ones that were my fave of the day.

CoffeeScript deign decisions (Jeremy Ashkenas)

A very good speaker and great intro to Coffeescript by non other then the guy who created it. I really like this talk as he stepped through the construction of the language through a deconstruction of javascript and also sanitising it, resulting in the output that is coffeescript.  The examples was really easy to follow as he went through all the basic stuff to more intermediate subjects. It was very interesting showing the coffee script followed by the "compiled" js output. Only downside was I would have probably taken more of it in if it wasn't the first talk and I was just waking up! Note to self, need extra shot of expresso next time.

     memorable tweet: "Intense and great talk on #coffeescript "hunger gotted""

Scalable Java Script Applications Architecture (Nicholas Jakas)

As I get (slightly) more mature as a developer, I am starting to think about the bigger issues of approaching builds in a sustainable and robust manner, I sometimes wonder about this thing called architecture. I was really looking forward to this talk and as a fellow attendee commented "This guy knows his sh*t". Nicholas outlined an approach which essentially decoupled your components with a three tier layer along with guidelines on what each layer should be comprised of. Good stuff and really enjoyed it. Hoping to have a chance to use some of the ideas in an upcoming project

 

Beyond the page

Glenn gave a talk on using the built in state of the various types of drag/drop things you can do within and between browsers. It was really interesting to see a the demo of the current integration between applications (ie between different browsers and desktop) and the ability to interact at different levels. His practical example was an online social address book through dropping in urls into (and between different!) browsers which automatically brought up user information from various sources. This type of interaction automatically created profiles on the user through sources from social graphs and I think linkedin . 

I kept on thinking about the Microsoft nirvana of data integration across it's various desktop applications A source of some of the worse viruses and worms sure, but wouldn't it be so good to have your data free and the "intent" realised by such a casual action of drag and drop? All achievable without manual bumming around by the user? He rounded the talk nicely with a bit of history from the old Lotus 1-2-3 days. Discussing briefly the point of how the accountants gained creative independence, data ownership, and portability which was the reason why Lotus became so successful.

Memorable tweet: 

Having a "how the hell do you do that?!!?!" moment with the beyond the page talk #awesome #fullfrontalconf"

 

Beyond the Planet of the Geeks (Brendan Dawes)

A bit more "airy fairy" non-technical section where Brendan gave a very entertaining talk on experimenting and playing with ideas with a strong sense purpose and iterative/evolutionary development. He used a real client project as a case study on the ways in which continually iterating a basic idea can lead to some interesting results. I felt he was drumming into us the idea that passion and playing ultimately leads to a satisfactory outcome. However from my perspective, only possible providing you can afford to keep chucking enough resource at it. It was interesting to note how he decided to drop his Flash skills and step out of his comfort zone to build the case study project completely in HTML5. I now know more about pencils and paper clicks then before as well.

Memorable Brendan line: "whoever said a bad workman blames his tools was a moron and I want to smash his head in with a beautifully made hammer"

 

You gotta do what you gotta do (Marcin Wichary)

The last talk was a really fun and quite inspirational talk from one of the user experience designers at google talking about google doodles. What grabbed me about the talk was the amount of time, effort and detail they go into each one as it only essentially lasted a day! To give a sense of the effort involved with relation to the number of lines of code:

 

  • 2009: 1
  • 2010: 5000
  • 2011: 13000

One of the doodles mentioned was the famous pac man doodle. I hadn't known that Pac Man was actually a deterministic game, I had always thought it was random. So Marcin decided to program it as the original. What was quite surprising was that people had figured that out through reverse engineering the code and created a counter algorithm to it. Remember these things are on for less then a day!

He then went through the design iterations of various other ones, one of the ones which stuck out was the celebration of Martham Gratham doodle. Pushing the boundary of sprite animation to a whole new level! I wish I could find a picture of the overlay of the different sprites on top of each other, it was rather cool. What was built wasn't a complete bed of roses mind you. It's nice to see the humbleness of individuals such as Marcin when he showed examples of how he had to build things in an often less then optimal way (sometimes often broken code), just to get the main point across "If you code doesn't feel a bit nasty, you are probably behind".

 

In Conclusion

The conference turned out to be a lot more fun and beneficial then I imagined. As I mentioned before the quality of the speakers was superb. The in between random chats and networking fun was one of the main reasons to come to these things, the free bar after was an absolute bonus! The size of the conference was good but I feel that the temptation to make it bigger is going to make it hard for it to stay this small, this could easily be twice the size! I hope it stays at this size for next year.

I felt there was a really strong sense of community from talking to all sorts of people from a range of different backgrounds and doing different things. All willing to dive deep into what they're doing. In the space of a fairly short conference I was talking to js developers in various industries building different things from mobile native, mobile web, games and embedded systems. It just goes to show how diverse js is and where it touches.

Though I think I could be breaking some kind of taboo to quote my own tweet, I think overall I had described the experience it best in less then 140 characters:

"Today I feel inspired, learnt something new, amazed, down trodden(how little I know) and more driven. thank u #fullfrontalconf and @rem"

0 comments.

Titanium.UI.currentTab is null?

Posted on November 18th, 2011 by thiswayup.
Categories: Mobile Dev.

For some reason Titanium.UI.currentTab sometimes returns null and you need a work around by defining it on a focus event on the tabGroup as a work around.

http://developer.appcelerator.com/question/98501/titaniumuicurrenttab-is-null

One of the pains with Titanium is the rather random situations when the built in properties for certain objects aren't set. Spent another hour looking at this same bug again and as soon I figure it out the saying ""Fool me once, shame on you; fool me twice, shame on me" rang loudly in my poor head.

This time I thought it best to write this down, to remind myself (and anyway one else). 

0 comments.

Titanium Mobile App development and london web cruise

Posted on September 22nd, 2011 by thiswayup.
Categories: Mobile Dev.

I had an absolute ball at the London Web Meetup annual cruise where we set sail from Westminster, going back and forth between Putney and Greenwich on a nice river cruise. Always a blast having a bunch of geeks, booze and pizza whilst chatting over a range of subjects.

On the subject of talks, there was a chance of some lightning talk spots and I decided to give it a go with a very rushed presentation of my current fave platform, Titanium from Appcelerator. Titanium is a platform that allows you to build Iphone, Android and Blackberry mobile apps using javascript. Unlike Phonegap, it translates the UI elements into native controls which gives it a more native feel and generally faster response. I also feel that the offering though has a few annoying bits, will have a great future for knocking up apps in record time.

My talk can be found here on Slideshare here (be warned, may contain lots of mistakes).

Passing by Big Ben whilst I do my lightning talk Titanium presentation

Doing my talk as I'm passing by London Bridge
Courtesy of @gelle

0 comments.

Symfony 1.4 – Creating old sql tables when running build command

Posted on July 31st, 2011 by thiswayup.
Categories: Development.

Dear future self (and whoever it may concern).

You may recall that Symfony has a rather nifty feature to build your models and db from the YML file. If you rename any of the tables through YML, the old model classes are not deleted (see "flushed") from the "lib\model\doctrine" directory. Symfony's process seems to be create sql from the base classes existing in the above directory.

To solve this run the "symfony doctrine:delete-model-files" or just delete the files in "lib\model\doctrine". They really should have added the deleting of model files in "symfony doctrine:build --all"

0 comments.

mysql stupid errors – ERROR 1005: Can’t create table {table name} (errno: 121)

Posted on July 21st, 2011 by thiswayup.
Categories: Development.

So I've spent at least half a day trying to figure out a stupid error when synching (creating) between my mysql workbench schema to a mysql database. I was receiving an error :

ERROR 1005: Can't create table {table name} (errno: 121)

I worked out that the issue was the foreign keys but had no idea why it was tripping out! Turns out that you need to name the actual foreign keys uniquely themselves. Therefore Ive taken to adding the table name in front of the foreign key name ie

BAD = "FK_title" if there is another table with the same foreign name, you'll get the above unhelpful message!

GOOD = "actor_FK_title" as you cant have two tables with the same name, you;re safe in the knowledge that you wont have a dupe FK.

0 comments.

Writing PDO prepared statements in Modx to import CSV files

Posted on June 12th, 2011 by thiswayup.
Categories: Development.

Here's a small note for myself (and anyone who just wants to knock up a quick query using XPdo and Modx Revolution). Xpdo is the ORB (Object-relational bridge) or ORM that Modx Revolution has adopted as its standard way to abstract all the data access. It also provides a thin wrapper around the standard php PDO class.

I myself like writing SQL, especially when you have to write slightly more complicated sql which an ORM just becomes a hindrance in certain situations. Recently I've had to deal with uploads of CSV files directly into Modx, here is my code for the csv file read and using the handy PDO prepared statements bit.

Some points to note when using PDO :

  • Outputting the actual query used is not possible by normal methods (ie you cant dump the string value) , you have to log the queries used on mysql. This is because the actual query is prepared in mysql with values being passed to mysql after.
  • I recommend using the colon place holders eg ":dataValue" as this aids in readability.
  • You do not need to escape the query as prepared statements doe this for you.
  • Remember in the bindValue call to add the third and possible forth parameter. This defines the data_type and length of the datatype, otherwise mysql will not know how to type the value during the query being run. I always forget this after an extended period of not writing prepared statements and its a pain in the ass to debug, ref : "what the hell is wrong with this insert statement !?!?!?"

Here is some sample code for :

$file ="var/someplace/file.txt";
$handle = fopen($file, "r");
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $stmt = $modx->prepare(
                "INSERT INTO modx_pews_buffer (event_group, month,event_date,event_descrption,event_start_time)
                VALUES (:grp, :month,:date,:des,:time)");
        $stmt->bindParam(':grp', $data[0],PDO::PARAM_STR,200 );
        $stmt->bindParam(':month', $data[1],PDO::PARAM_STR,50);
        $stmt->bindParam(':date', $data[2],PDO::PARAM_STR,200);
        $stmt->bindParam(':des', $data[3],PDO::PARAM_STR,30);
        $stmt->bindParam(':time', $data[4],PDO::PARAM_STR,11);
        $stmt->execute();
    }

Also read up :

Was listening to this whilst writing this post.

0 comments.

reading about eval in js – why not to use

Posted on November 21st, 2010 by thiswayup.
Categories: Development.

I've been reading through and slowly digesting some of the points on tutsplus.com post on "The Essentials of Writing High Quality JavaScript". One of the many interesting parts is the point about Eval and some common anti-patterns. This can be sumarised as :

  • Potentially unsafe security wise - can you trust the string you are eval() on, especially if it comes from an outside source
  • passing to setInterval(), setTimeout() and new Function() is essentially an eval
  • You limit the potentially var declaration scope using new Function() and putting the eval into an enclosure

I encourage people to read it!

0 comments.

Quick speed up on javascript loops

Posted on November 16th, 2010 by thiswayup.
Categories: Development.

I have heard that one of the ways to speed up js is how you define your criteria on the number of iterations in a loop. Reading an article on Javascript best practices, you should cache the look up of an array length into a separate variable then use that rather then consistently look up the length. So rather then do :

for (var i = 0, i < myarray.length; i++) {
   // do something with myarray[i]
}

The above example  of i < myarray.length does a look up on every iteration. Instead you should do something like :

var max = myarray.length;
for (var i = 0, i < max; i++) {
   // do something with myarray[i]
}

Do the above apparently increases the speed by twice in Safari 3 and 190 times in IE7! Definitely worth knowing!

0 comments.

Learn Visual basic instead of Objective-C

Posted on November 13th, 2010 by thiswayup.
Categories: Mobile Dev.

I thought this was both hilarious and interesting, I just discovered Objective-basic! I've been playing around with Objective-C on and off for the past year ("I have that great app idea!") but I've also been thinking about whether its a bit pointless and we should just learn to use Phone Gap, Titanium or Grapple Mobile if you want to build Iphone apps (and not games). Objective-basic seems to be quite a good alternative, if you just want to build an Iphone App. Visual Basic is so straight forward, I think anyone can learn it. Plus I use to do a bit of visual basic "back in the day", this would be a great way to knock up an app quickly for most people!

PS A great post on the comparison on some of the ways to build mobile apps on stackoverflow

0 comments.

weekend of coding at secret london

Posted on April 25th, 2010 by thiswayup.
Categories: Development, London gems.

I've had this post sitting in my draft posting for the past couple of months and had completely forgotten about it until recently, so I thought it best to commit some thoughts down for future prosperity..or something.

It was back in February when I noticed a call from secret london for developers to help build a website and so looking for a small project at the time to sink my teeth into, I thought I'll come down. I head to where they had a small cozy office off oxford circus to meet the small gang of 4. After chatting a bit with a slightly shy girl who I thought was called Georgia (for some bizare reason) go through the website concept. This girl turned out to be Tiffany, the creator of the facebook group! At the time with my tired mind I was unawares of this! (sorry Tiffany if you are reading this)

Anyways...walking through the site idea, I had commented how I could possibly offer a few hours of my time a week over the next few months. Obviously Tim (the main dev guy) had thought about scalability and having a fast backend from the start. It was a shame he had decided to do it in Django and some weird data engine called Solr but I was enthusiastic working with people who knew what were doing. The real kicker or as Greg (who I considered the energetic and charismatic "ideas man") came out with the punch line... they were planning to create the whole thing in a weeks time! I was a bit stunned but said I will try get back to them (but still enthusiastic to try help out). I left thinking decisively "These people were slightly mad.", my favorite type of people :)

Moving onto the following weekend with some great planning and scheduling done through gdocs, the "guerrilla style" site build was underway starting on the Friday near Farringdon. Unfortunately I could not attend from the start and joined them on the Saturday. My php skills would be slightly rubbish for this project but decided to help out as best can with the javascript side of things.

I met some fantastic peeps on the day, chatting mainly to Ruth and Andy The setup was was very fun with a large area to accommodate the gang of designers, developers, editors and content people with booze and food around. I found it amazing to see so many people spending their weekend pushing forward something they believed in and credit is due to Demetrios for keeping the atmosphere positive, making sure everyone was happy! The content people had a very arduous task of transferring as much of the information from the facebook website to the site database. There was then the 4-5 developers  nd roughly same amount of designers do the front end work.

It was a bit of a shame on my part as I had a couple of bday do's to attend on that particular weekend, I wanted to hang around a bit longer to polish off my section! After spending a few hours here and there, trying to play around with the google maps local search api, I managed to offer a small contribution in the form of a google map showing the secrets for the first version of the website. I finally left late on the sunday after the design team had did the initial load of the site on a beta domain, at that point it truly struck me how an amazing feat they had achieved with the number on the posters indicating how much data they had loaded and the functionality they managed to squeeze in!

Secret London contributors on the sunday

The experience was definitely a positive one and it made me realise how doing coding for projects like this is really good fun. I should do more of these! I had a chance to learn some new stuff that I wouldn't otherwise expose myself to and got a tasty curry and beer for my troubles! Would I do this again? Definitely.

Further links

0 comments.