Category: Uncategorized

  • Start with Ruby on Rails

    Over the last two months I have been looking into a new way of doing web-development, and found an ingenious timesaver in the relatively new and popular framework Ruby on Rails.

    It all started as I wanted to add some back-end functionality to some of the technologies I have experimented with on lovholm.net/projects. Front-end development is exiting with new super-fast Javascript engines, expanded possibilities with the new CSS3 implementation, and easy-to-use frameworks such as Processing.js and jQuery. It is fun to make the pages pretty and and animations, but with expanded and more intelligent functionality it’s getting even more fun and with Ruby on Rails you can make a little application in just hours.

    Ruby on Rails is a web-framework built on the very flexible language Ruby. It is based on a few very useful mantras such DRY – don’t repeat yourself –, and convention over configuration. If you have made any applications for the web you probably know that much of what you do goes into a pattern. With Rails you can rely on automatic creation of many of these tasks and just focus on the important stuff.

    If you have designed a computer system earlier you have probably tried to stay true to the division between the Model, the View and the Controller. By distributing the responsibility throughout the code you can make something which is understandable for others, or future you, and prevent many of the pains a disorganised computer system may bring. Rails make this easy by having a strict folder structure. Once you create a new project you will always find the functions in their designated folders.

    Installing Ruby on Rails is quite easy, and with the Ruby package-system Gem you can easily harness from the many hours people have spent adding functionality and interfaces to many of the interesting technologies and platforms which have emerged on the Internet. Geocoding, Twitter, Facebook, YQL and more is easy to use with Rails. By having software controlled by a package-system upgrades are made very easy and if you’re afraid of getting deprecated sometime in the future you may also freeze what versions you want to ship with your application.

    You find great instructions on how to install both Ruby and Rails by using Google. As much of the functionality is initialised through a command line I would recommend you to use the Terminal on a Mac, or a taste of the various UNIX or Linux flavours available. If you are a Windows user, you can get access to an emulated Linux system through Cygwin.

    If you really want to see what powers the “new” Internet provide today – in form of getting things done very quick and agile – make a couple of scaffolding-projects (a command to Rails which creates a controller with RESTful methods to a Model), put them under git version control, and push the code onto GitHub and Heroku. You can make something very cool very fast, and very cheap or even for free.

    I don’t know whether this post is a ‘seller’, but if you think it could be interesting to try out something cool go onto the Ruby on Rails webpage and do a quick tutorial. If you think it is interesting a lot of resources are available online, and if you prefer screencasts there are some at iTunes and Lynda.com have also made two tutorials you can follow.

    Go, make!

     

    PS: This is just a very short ‘Have you heard about?’-post. I will try to write some hints and tricks later.

     

     

     

     

  • 20 years with the World Wide Web

    Earlier this year we passed the twenty year anniversary of the world wide web; on of the most prolific inventions of our contemporary time. From this milestone a historical line can be drawn as recent iterations of the web are disseminated to a wider array of users and new uses adapts the web as a platform. Not only is the web gaining larger audiences, it is also changing various platforms until recently not being thought of as web. The last five years we have seen the renaissance of web technologies with the triforce of Javascript, HTML and CSS. We must not forget that the web has been of paramount importance in the diffusion of the Internet and is still expanding and even if its death has been prophesied.

    The first days 

    First, just to clear the air, the web and the Internet are two separate technologies. While we are celebrating the twentieth anniversary of the web we need to know that the Internet on which the web is working is much older. Protocols you are using daily while doing things as sending e-mails, transferring files over FTP and playing computer games online are also preceding the web with years, so why is the celebration of web such a special thing?

    The world wide web was introduced in the beginning of the 90s built on the ideas of hypertext (that had already been around for decades). With the creation of a markup language, HTML, and a transferring protocol for acquiring such sites, HTTP, the web was born. Working a the European Organization for Nuclear Research, the father of the web – Tim Berners-Lee conceptualised a system where digital resources could be exchanged platform independent. On his Next computer he wrote the technology.

     

    At that time one could not imagine the success and widespread the technology would go through the next twenty years.

    In the eighties and nineties other structural changes helped make the web into what it is today. In the late seventies and the eighties personal computers had entered the consumer market, and as its cost grew lower and more units were sold the general importance of computing grew. Before the web, and also before the personal computers, Internet and computing was a professional realm in companies and universities, but with Internet Service Providers homes were included into the global network. The market for internet access grew as home computing became popular, and until recently, here in Norway, it was a political goal to spread computers to the homes, and home computing was partly tax-exempted. The UN and the World Bank still use percentages of home with Internet access as a measure of countries, and lacking IT literacy is spoken of as it was analphabetism.

    Before the web through the Internet was possible, an abundance of open and proprietary standards, several programs with different usage and no central hub as the computer browser provides today the Internet lacked any application so ubiquitous as the web would become. E-mail servers could communicate in SMTP and POP3, but there was a lack of an open gateway where all services could be found (this will take more than twenty years, and browsers today are not totally compatible, but it is a great abstraction from when little and big endian was a problem for network communication, or from the proprietary standards of IE6.)

    The web is cool and much have happened, but what I find especially amusing is the recent and ongoing development. Just think about it. The last five years more and more applications are encompassed into the web. Long before gmail and even earlier than hotmail most people downloaded their e-mail to their local computers using the POP3 standard, today it’s all online, or at least you can synchronise your mail-boxes with IMAP. Another example is the expansion of content services oriented around the web. Music, movies, pictures and friends are now living in the cloud and the cloud-access-points (desktops, laptops, mobile phones, TV-sets, tablets, information screens etc) are much more flexible than just a couple of years ago. Where did you go to access the Internet in 1995, or 2000? Now you probably have a portal close by, but ten years ago that portal was in a home-office. When did you get your first laptop? Smartphone? Wireless router? When did you sign up for Flick, Picasa, Gmail, Facebook, Twitter?

    The recent technological development has largely been accredited AJAX and the rebirth of Javascript. With new Javascript engines such as Chromes V8 modern browsers are able to run Javascripts more than 100 times faster than earlier, also more effective distribution of workload onto the GPU and new standards in HTML and CSS has changed the web drastically. The web originally was a stateless experience, you asked you got served, but in-between you had a load-time unbelievable for today’s netizens. Now applications are downloaded (and with all the libraries included and assets these can be massive), but when first running locally they acquire data asynchronously. The application are now sending and receiving data without loading the whole site, they have been doing it for years, but now it starts to change the experience of the web.

    Yesterday, I was looking into some of the technological changes in the web, and I tested some of the relatively new features of the web. With new iterations the web-browsers a better control of visual elements are implemented through CSS3. Box shadow, round edges, transparency and other features earlier emulated with images, smoke and mirrors are now included in the model. Here is a little demonstration of some features at lovholm.net/projects. Another demonstration which only works with newer web-kit browsers (Safari, Chrome) is showing reflections and animations through CSS3 (Click on the image).

    Not only the visual aspects are changing, the HTML 5 package introduce a new and more semantic model for how to label content in HTML, this again leads to the idea where the Internet is made up of smaller parts than documents. In his book Weaving the Web, Tim Berners-Lee introduces the idea of the web of data. I like to think of it as being able to query the web, not only locally running databases. You can now have a lot of fun using YQL to query Yahoo’s interpretation of the web , or you can find the facts from Wikipedia using their service DBPedia.

    Here is presentation summarising some of the open data achievements. (Do also watch the first presentation TBL on the next web)

     

    The article picture is made by Anna Lena Schiller, licences under Creative Commons and made available on Flickr.

     

  • Quiz 27/8

    I forbindelse med at Telemuseet arrangerer sin sommerfest har jeg blitt spurt om jeg kunne lage noen spørsmål til festens quiz. Sammen med Tobias, som sto for muiskkspørsmålene, ble disse spørsmålene stilt. Av praktiske grunner er ikke musikkspørsmålene tatt med, siden du måtte ha hørt musikken for å kunne ha svart på spørsmålene.

    Hvor mange spørsmål klarer du å svare på?

    1. I Shakespeares mest berømte verk – Romeo og Juliet – møter vi to familier. Hva heter disse?

    2. Telemuseet har avdelinger lokalisert forskjellige steder i landet, og for å reise til disse kan fly ofte være enkelste reisevei. Hva står det på baggasjelappen din når du har fløyet til: Bergen, Stavanger, Trondheim og Torp?

    3. Ranger disse landene fra minst til størst. (Grunnflate)

    • Colombia
    • Brasil
    • Spania
    • Bangladesh

    4. I hvilken film fra 2008, regissert av David Fincher, opplever hovedkarakteren et noe merkelig livsløp.

    5. Vi skal fram til en stat i USA. Staten var en av de tretten første statene. Statens hovedstad heter Concord, men dette er ikke den mest befolkede byen i staten. Opphavet til innbyggerne kan hovedsakelig spores tilbake til de britiske øyer, hvor omtrent halvparten har sitt opphav. Statens navn har også sitt opphav her. Staten har omtrent 1,2 millioner innbyggere og høyeste punkt er Mt Washington. Hva heter staten?

    6. En skildring av krigene i Afganistan og Irak har denne uken funnet veien til Oslos kinolerreter. Hva heter filmen?

    7. Hvilken sveitsisk teoretiker blir på grunn av sin språkfilosofi, og sin deling av språket i bruk og struktur, regnet som en viktig teoretiker innen strukturalismen.

    8. Ranger disse hendelsene i kronologisk rekkefølge

    • Karl Marx blir født
    • Stormingen av Bastillen
    • Den amerikanske uavhengighetserklæringen
    • Voltasøylen oppdages

    9. I hvilket litterært verk fra 1951 møter vi antihelten Holden Caulfield som bestemmer seg for å forlate skolen Pencey for å reise inn til New York hvor han tar inn på hotell, går på byen og besøker sin søster. Bokens tittel er basert på en barnesang av dikteren Robert Burns.

    10. Hvilket nettsted, i dag et av verdens mest brukte oppslagsverk og web 2.0 tjeneste, ble opprettet i 2001, og hva betyr den første delen av navnet? For ordens skyld kan det sies at navnet er et ord sammensatt av to.

    11. Vi har per i dag hatt lydfilm i over 80 år, og lyden har blitt en naturlig del av filmopplevelsen. Slik har det ikke alltid vært. Hva heter filmen fra 1927 som regnes som den første lydfilmen?

    12. Hvor mange land grenser til Russland? (Med Kaliningrad, men ikke Beringstredet)

    13. Hvilken bok av Knut Hamsun er filmen Telegrafisten basert på?

    14. Kenya har nylig fått en ny grunnlov etter en prosess som har pågått i over 20 år. Titusener var tilstede i hovedstaden på signeringsserimonien der presidenten signerte grunnloven. Hva heter han, og i hva er navnet på Kenyas hovedstad?

    15. I hvilken prisbelønnet amerikansk TV-serie møter vi reklamemenn i firmaet Sterling Cooper og deres elleville tilværelse tidlig på 60-tallet?

    Bildet er nok engang hentet fra Flickr, og denne gangen er det Oberazzi som står bak bildet. Rettighetsinformasjon til bildet kan finnes på hans side på Flickr.