Useful links for getting started with web development

Every couple of years I go back to my old school to participate in a careers convention, where people from a range of industries get together to dish out tips and advice to pupils trying to make career choices. A great cause, especially with uni now being a more challenging prospect here in the UK due to the huge hike in tuition fees. Youngsters really need all the help they can get to make sure they pick the path that’s right for them.

I promised those I spoke to this year that I would post a list of links on my blog as a follow-up to find out more about web development. I should stress that this list is by no means exhaustive; I put it together quite quickly and there’s plenty more I could have included. For example, whilst I’ve tried to include links relating to a range of technologies, inevitably there’s more about the areas I have more experience with. Hopefully though it can still provide plenty of reading material and food for thought to help in evaluating whether web development is a subject worth investigating further as a potential career or perhaps just as a hobby.

I’ll try to update the list from time to time when I think of more (suggestions also welcome via the comments). I’m also hoping to follow this blog post up with some further thoughts on choosing web development as a career.

Without further ado, here are the links:

Programming Languages / Frameworks

  • HTML5/CSS/JavaScript – Open technologies at the heart of the web – learn these first!
  • Node.js – Increasingly popular serverside JavaScript platform
  • Ruby – Widely used
  • Ruby on Rails – One of the most popular web frameworks, built on Ruby
  • Python – A good starter language, often taught on uni courses etc.
  • PHP – Been around a long time and still widely used, though not considered too cutting edge these days
  • ASP.NET – Microsoft’s web platform, used a lot in the enterprise (see also http://asp.net/ and http://msdn.com/)
  • Java – Mostly found in the enterprise, not a good choice if you want to keep ahead of the curve!

Online video/interactive training

  • Treehouse – Web design & development
  • Codecademy – JavaScript courses (other subjects on the way)
  • CodeYear – Learn to program in a year (part of Codecademy)
  • TekPub – Screencasts on a range of topics, some of which are free
  • PluralSight – Large library of videos for a range of technologies (though with a bit of a Microsoft focus), not free but reasonably priced
  • appendTo – jQuery/JavaScript training
  • NodeTuts – Node.js screencasts
  • RailsCasts – Ruby on Rails screencasts

(e)Books

Look out for deals of the day from most of these – they tend to have an ebook or two available each day for around £7-£10 (see my Twitter list covering many of the ebook publishers).

Resources

  • Move the Web Forward – One stop shop for keeping abreast of web standards and getting involved in the community
  • jQuery – Most popular JavaScript framework for rapid web development
  • Twitter Bootstrap – UI framework that makes it really easy to get a good UI up and running very quickly
  • Google Reader – RSS aggregator – subscribe to blogs and news sites and have all articles brought together in one place to save having to check each site manually
  • TweetDeck – Useful Twitter client for monitoring topics and lists of accounts to help breakdown the wealth of information that flows through Twitter

Databases

  • MySQL – Most popular open source relational database server (free)
  • PostgreSQL – Another popular open source relational database
  • SQL Server – Microsoft’s SQL database, common in the enterprise (free cutdown editions available – Express and Compact Edition)
  • MongoDB – Popular open source “NoSQL” database (free) – an alternative approach to “traditional” databases (has pros and cons)
  • CouchDB – Another popular NoSQL database

News

  • Hacker News – Anything and everything of interest to a techie
  • Reddit Programming – As above – see http://reddit.com/r/LearnProgramming/ and other related sections also
  • DailyJS – JavaScript/Node.js news
  • Ruby Inside – Ruby news and tutorials
  • Techmeme – General tech news, usually one of the first places you’ll find the big stories
  • Twitter – One of the best ways of keeping on top of everything – many blogs tend to post on their Twitter feeds when new articles are posted, plus there’s an endless stream of useful links being shared

Help

  • StackOverflow – Q&A site for developers with specific problems, usually related to specific source code
  • Programmers – Q&A site for programmers with higher-level conceptual problems

Mailing Lists

Podcasts

Web Hosts

  • Heroku – For Ruby, Node.js, Python, Java and more (requires understanding of source control – see below)
  • AppHarbor – For .NET (requires understanding of source control – see below)
  • WebHostingTalk – Great forums to help find/discuss any type of web host

Jobs

Source Code / Version Control

  • Git – One of the most popular version control systems out there
  • Mercurial – Similar to Git, slightly easier learning curve
  • Github – The most popular source code host, based on Git
  • BitBucket – Supports Git and Mercurial
Posted in Careers | 1 Comment

Handling the proprietary CSS filter attribute in dotless

I’m a big fan of the LESS CSS library – a fantastic way of simplifying the process of writing CSS by offering a number of basic programming capabilities such as variables, functions and mixins.

There are a number of implementations available for different platforms, and the purpose of this blog post is to highlight a feature in dotless – the .NET implementation – which I’ve had to call on occasionally but often forget about in the interim, so I’m hoping this will stop me from forgetting :)

From time to time (when needs absolutely must) it’s necessary to use the proprietary filter attribute to accommodate IE (much better if you can use something like CSS3 PIE but like I say, sometimes needs must). For example:

.some-class {
    filter: progid:DXImageTransform.Microsoft.Shadow(Strength=15, Direction=0, Color='#000');
}

However, because of the abnormal syntax this involves, it causes parsing issues with dotless. I’ve read about a number of ways of working around this, but the only one I’ve found to be properly reliable (e.g. including the ability to use variables within the filter) is the use of dotless’ formatString function (which appears to be undocumented).

This has a similar signature to String.Format i.e. it takes as its first argument a string containing placeholders where values need inserting ({0}, {1} etc) followed by an argument for each value to be substituted. So using the above example, your CSS would look something like this:

.some-class {
    filter: formatString("progid:DXImageTransform.Microsoft.Shadow(Strength={0}, Direction={1}, Color={2})", @strength, @direction, @color);
}

Or perhaps more usefully, making use of a mixin:

.some-class(@strength = 15, @direction = 0, @color = '#000') {
    filter: formatString("progid:DXImageTransform.Microsoft.Shadow(Strength={0}, Direction={1}, Color={2})", @strength, @direction, @color);
}

Obviously formatString can be used for much more than this particular scenario, it’s usefulness isn’t restricted to working around annoying proprietary CSS attributes that really are way past their sell by date…

Posted in Tips | Tagged , , | Leave a comment

TeamCity unable to load changes from Git due to an existing remote

I’ve recently been doing a lot of work in TeamCity, including switching over from SVN to Git (more to come on that in future blog posts). I’ve just had to deal with an odd issue which was entirely my fault but took a bit of head-scratching to figure out.

I got the following exception (where <URL_TO_GIT_REPOSITORY> is a placeholder I’ve substituted for the original URL):

jetbrains.buildServer.VCS – Error while loading changes for root <URL_TO_GIT_REPOSITORY> #master {instance id=43, parent id=3}, cause: ‘git fetch’ command failed.
stderr: The repository at directory ‘D:\Development\Infrastructure\.BuildServer\system\caches\git\git-4D05D25B.git’ cannot be opened or created, reason: The specified directory D:\Development\Infrastructure\.BuildServer\system\caches\git\git-4D05D25B.git is already used for another remote <URL_TO_GIT_REPOSITORY> and cannot be used for others (<URL_TO_GIT_REPOSITORY> ). Please specify the other directory explicitly.

What this essentially seems to be saying is that it can’t checkout changes from my remote Git repository because its local repository is currently tracking a different remote repository… which just happens to have the same URL! This didn’t make any sense – why was it thinking there were two different URLs here when they were clearly the same?

Well the eagle-eyed amongst you may spot that there is actually a subtle difference between the two reported URLs – the one in brackets has a trailing space after it. Turns out that I was setting the VCS root URL via a build parameter and had accidentally left the trailing space in there for one of my build configurations, giving me two different values in theory, even though to a human eye they looked the same. Clearly TeamCity doesn’t trim whitespace from VCS root URLs, otherwise it would have normalised them and treated them as one and the same.

Needless to say, removing the trailing space prompted everything to spring back into life.

Posted in Fixes | Tagged , | Leave a comment

IO.FileNotFound_FileName exception when selecting a file in Silverlight

I don’t know how much this will help people – there’s only 7 results on Google for “IO.FileNotFound_FileName” at the time of writing so it’s clearly not a common problem – but one of our Mac users just reported an issue with selecting a file via a custom Silverlight control. They do this process day in, day out, but suddenly started getting the following error message:

Silverlight IO.FileNotFound_FileName exception

Silverlight IO.FileNotFound_FileName exception

I couldn’t find any evidence of people getting this problem before, the MS page it pointed me to was typically useless. The only suggestion I came across was that it might relate to diskspace having run out, but neither the Mac nor the external fileserver this file was being loaded from were low on space so that ruled that one out.

From a process of trial and error I managed to track the problem down to the folder these files were stored in which, whilst it appeared perfectly normal when viewed on a Mac, when accessed via Windows showed up as gobbledygook. Creating a new folder and copying all the contents over did the trick – the file could be selected and uploaded as before.

Clearly something went very screwy deep down in the OSX filesystem with that folder, though I have absolutely no idea what it might have been. Maybe I missed something really obvious (I have no experience with Macs to call on), but hopefully by bumping the number of Google results up to 8 I might one day save somebody a bit of time :)

Posted in Fixes | Tagged , | Leave a comment

Installing RVM on Ubuntu 11.04

I’ve been trying to install RVM on Ubuntu 11.04 and what, according to the installation instructions, should have been a fairly straightforward process turned out to be pretty frustrating. I’m no Linux expert, I’m still picking a lot up, but I couldn’t see any reason why, after each install attempt, I got the following error when attempting to run ‘rvm’:

No command 'rvm' found

I’d installed RVM as a single user using the following command:

bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )

The next step involves adding a line to your .bash_profile file (which in the case of Ubuntu is .profile, although the actual change needs to be made in .bashrc):

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

One thing I was warned about during installation was the presence of a return statement in the above file, which I was instructed to refactor into an if statement (I’m assuming this is standard on Ubuntu as my installation is fairly clean):

WARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc.
This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:
if [[ -n "$PS1" ]] ; then
... original content that was below the && return line ...
fi # <= be sure to close the if.
#EOF .bashrc
Even if you use zsh you should still adjust the .bashrc as above.

I duly made this additional change but eventually discovered I’d made a key mistake; the closing ‘fi’ statement needs to come before the new RVM line, not after it. Maybe this is a no-brainer to most people, and I know it does refer to the original content in the above instructions, but as somebody without a great deal of Linux experience, it wasn’t particularly clear to me which way round these lines should be, and the matter was further compounded by guidance I found on blog posts and forums that had the RVM line inside the if statement.

So if you’re having issues getting RVM to run, double check .bashrc and see if you’ve made the same mistake I did. Don’t forget to reload your profile after making any changes:

source .profile
Posted in Fixes | Tagged , , | 3 Comments

Git “broken pipe” error when pushing to a repository

This is one that’s caught me out on more than one occasion now, hopefully by blogging it I won’t forget about it again quite so soon…

When attempting to push to a git repository over HTTP, you may experience a “broken pipe” error along the lines of the following:

Counting objects: 14466, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3746/3746), done.
error: RPC failed; result=22, HTTP code = 400
fatal: The remote end hung up unexpectedly
Writing objects: 100% (14466/14466), 104.13 MiB | 31.34 MiB/s, done.
Total 14466 (delta 10927), reused 13812 (delta 10474)
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004�Ȍ/↓/Ɠyb��Nj}↑z��"#7‼.m���+x9`>��☼�uhh_������м5���§��z���W?�^&��͙mQM��a`Q�C���Z'

fatal: write error: Broken pipe

This error occurs when the amount of data you’re trying to push in one go exceeds git’s http post buffer which is defined in the docs as:

Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

Whilst most day to day pushes are likely to be under 1MB, if you’re pushing a large repository over HTTP for the first time, there’s a good chance you’ll exceed this limit, resulting in the above error.

Increasing the buffer is a simple config change to set the new size in bytes (a value which will obviously need to exceed the size of the push that’s erroring):

git config http.postBuffer 209715200

One more thing – even after increasing git’s buffer I was still getting fatal errors. If you also host the destination repository, you need to make sure the server it’s running on doesn’t have a limit to the size of POST requests it will accept – a configuration change may be required to that as well. After I bumped up my max request length, everything worked as expected.

Posted in Fixes | Tagged | 4 Comments

“Access denied” error when installing Orchard modules

I’ve recently started properly battling playing with Orchard and came across a gotcha which may simply have been down to a misunderstanding on my part, but I didn’t find much info when searching for it so figured I’d blog about it myself.

Having set up an initial instance, I switched on the multi-tenancy module so as to install a second instance alongside the first one rather than deploying another copy of Orchard in its entirety. When attempting to install some additional modules within the second instance, I ran into trouble – every time I clicked the “Install” link for a module in the gallery, or the “Install a module from your computer” link within the “Installed” tab of the Modules section, I got an “Access denied” error.

I started checking permissions in various places – my Orchard user account, filesystem ACEs, IIS configuration etc. In the end I had to dive into the code to see what conditions were in use.

Turns out that the problem lay with the fact I was using multi-tenancy – module installation (and possibly themes too though I haven’t checked) is only possible from the default instance, not the other tenants. I’m assuming this is because all tenants share the same modules and themes, and only the default instance is allowed to control them to prevent anarchy breaking out amongst the different tenants. My solution was simple – install the module via the default instance and then go back to the second one where it immediately showed up for me to enable.

Whilst I can see some logic to the business rule here, and maybe it’s spelled out clearly somewhere I missed, I think it could be handled better – there either ought to be a delegation feature within the multi-tenancy module that grants tenants the right to install modules, or a clearer error message when access is denied that makes it immediately obvious what the problem is. At the very least the UI for installing a module ought to be hidden when logged in as a tenant to avoid confusion.

Note the above all applies to Orchard 1.2 – if you’re reading this blog post some time down the line, be aware that it may not apply any more.

Posted in Fixes | Tagged , | 1 Comment

.app pre-registration now open!

I previously blogged about the .app project. As of today they are now open for pre-registration of .app domains, with the caveat that as the rights to the gTLD haven’t actually been secured yet, there is no guarantee the registrations will ever actually go through.

However, rather than simply getting you to pre-register and then sit tight and wait with crossed fingers, they’ve taken quite an innovative approach. Having registered the .app.cc domain, any domain that’s pre-registered automatically comes with a YOURNAME.app.cc subdomain redirect to the URL of your choice. This will continue to work even if the ICANN bid fails.

Multiple people can pre-register the same domain name but only the first person will get the redirect for that name.

Head over to the pre-registration page now and stake a claim to your app name!

Posted in Community | Tagged , , | Leave a comment

There’s a .app for that

When ICANN recently announced that it was pressing ahead with opening up gTLDs so that any business or organisation could start a public or private registry (e.g. .fb, .pepsi, .eco), I was really disappointed. It strikes me that this is a potential recipe for disaster. Even though ICANN has pledged to undertake due diligence and have a high barrier of entry to weed out all but the most sincere and committed of interested parties, it’s surely going to cause problems to some degree, even when you take out all the FUD. Think of all the companies that have custom DNS suffixes; for example, we use our company initials as ours so if a gTLD is ever set up by another company or organisation with the same initials, we’re going to run into problems.

However, whilst I could rant about that a lot more, the fact is that ICANN are pressing ahead and there’s not much that can be done to stop them. So instead I’d like to talk about a project that has just got underway to secure one of these new gTLDs because whilst my overall view on ICANN’s decision remains the same, I think this particular gTLD could be A Very Good Thing (and after all, if you can’t beat ‘em, join ‘em!).

The .app gTLD Rights Application Project (@dotappapp) is seeking to bring together the app development community and put together an application on its behalf for the .app gTLD. In its own words:

“.app App” is a community funded and executed project to obtain rights to the .app gTLD when ICANN makes them available in 2012.

We’re looking to gain support from the community together the funds necessary to build and operate the .app gTLD in perpetuity. Our aim is to keep the .app gTLD open and accessible such that it becomes an entity that properly support the app software development community, particularly in areas of intellectual property protection.

The idea is to take a gTLD that could have wide uses – from mobile apps to tablet apps to web apps and even to desktop apps – and place it firmly in the hands of the community rather than allowing it to be controlled by a profit-driven corporation. Is there a demand for such a name? Well I’m sure I don’t need to point out the 350,000+ apps in Apple’s App Store, or the hundreds of thousands of Android apps floating around, not to mention the nascent tablet market and the host of web apps and other platforms out there for which apps are being built on a daily basis. Furthermore, not only is it nigh-on impossible to purchase a single word .com these days, it’s getting pretty tricky finding XXXXapp.com domains as well, such is the demand. Given the choice between GetMyCoolNameAppHq.com or MyCoolName.app, I know which I’d prefer. Plus the “stigma” attached to non .coms is fast eroding as clever use of ccTLDs becomes increasingly popular.

Will all these developers want to buy a .app? No. Will enough of them be interested to make the venture worthwhile. You’d think so. And that’s before you factor in the next wave of app developers on platforms such as webOS, Windows 8 and the various HTML5 technologies as they become mainstream.

Perhaps the most ímportant and exciting aspect of the .app project however is the potential for something far greater than just a domain registry. Consider the following:

Validated domains

What .app involves that isn’t necessarily the case with other gTLDs is an actual product, whether it’s a web app, mobile app, tablet app etc. If you have a .app domain, you have a digital product to sell or give away. As a result of this, it would be possible to implement checks and balances to ensure that domains are registered for a valid app and not simply purchased for squatting or investment purposes. For example, there could be a time limit within which there must be some indication of progress, with the ability for users to flag domains that violate the policy for investigation and potential removal. It could also be possible to cross-check registrations with existing apps in other app stores.

Registry metadata

With each domain correlating to a real app, it would be possible to capture more metadata at the point of registration than your typical domain registration – information such as app name, description, category, launch date etc. This would allow a rich data set to be compiled and built upon. For example, a central directory of all apps, an API for programmatic querying of apps, a rating/review system etc.

Eco-system

Taking this on a step further, instead of displaying a typical ad-ridden domain parking page for new, inactive domains, the developer could choose to opt-in to tools and services geared at helping promote and build their app. For example, if an app’s launch date is in the future, the default parked page could display the app name and description and a signup form for visitors to register their interest. Developers could also have the option to switch on their choice of blog, wiki, invite system, newsletter etc. at the flick of a switch, allowing them to focus on building their app rather than their site.

 

I’m sure there’s many more benefits I haven’t thought of, but essentially what this all boils down to is a distributed app store controlled by the community rather than any single entity, spanning platforms and technologies in a way no other app store currently does. I think this could be immensely powerful and open up many new opportunities.

Of course, there are downsides to the whole approach. How do you maintain enough control over usage of .app domains without causing developers to feel they’re staking their livelihoods on a third party? How do you deal with stealth startups that don’t anticipate releasing anything for 2 years but want to secure their domain name now? Is the whole thing financially viable?

Remember – at this stage the project is merely about an application to ICANN. There’s a long, long road ahead if this is to succeed. There are legal complexities to overcome, a large amount of funding to raise, it’s unknown what competing applications the project might come up against, and other hurdles as well. If this is to succeed, it needs the whole community from all platforms to pitch in and get involved, and I would encourage you to take a look at the website, register your interest and maybe even purchase a membership.

Finally, come check out the discussion group and add your thoughts, and let’s all help make this a reality!

Posted in Community | Tagged , , | 1 Comment

Menu issue with Aptana Studio 3 on Ubuntu 11.04

In a break from .NET/Visual Studio themed blog posts, a quick pointer for anybody attempting to use Aptana Studio 3 in Ubuntu 11.04 – the main menu is totally hosed because of a clash with the new Unity 3D window manager. There’s a workaround in the Appcelerator docs (Appcelerator being the recent new owners of Aptana) for this. Simply create yourself a bash script to use as a proxy for launching Studio instead of opening it directly, which will allow the setting of an environment variable to restore the menu:

#!/bin/bash
export UBUNTU_MENUPROXY=0
./AptanaStudio3

If you’re new to the world of Linux, or a bit rusty, to make use of the above you need to create it as a text file in your editor of choice and then save it in the same directory as the Aptana Studio executable. You then need to give the file execute privileges (let’s assume you saved it as “AptanaLauncher”):

chmod u+x AptanaLauncher

You then execute it as follows:

./AptanaLauncher

The issue has been filed as an Eclipse bug, but a fix is still forthcoming (it’s been a few months already).

As an aside, following Appcelerator’s acquisition of Aptana Studio, they’ve recently release Titanium Studio. Worth noting that this is nothing more than Aptana Studio with full integration of the Titanium infrastructure – if you have no need for Titanium, there’s no need to switch (as pointed out by Aptana support themselves).

Posted in Fixes | Tagged , , | 4 Comments