Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Sunday, March 2, 2014

After Digital Jam 3 - Take aways and next steps

Just a few photos from the recent "unofficial" After Digital Jam 3 meetup. This is not meant to be a faithful or exhaustive transcription of the meetup. Funny how this post echoes the idea from 2012 post that discusses how to figure out how we create "Digital Craftsmen".




The "unofficial" After Digital Jam 3 Meetup was small but worthwhile. We were able to put the events of Digital Jam 3 Day 1 into some perspective and discuss how members of the Jamaican developer community could act upon some of the initiatives that were indicated by the various speakers.


Introductions

We actually spent a lot of time in just introductions around the table. Present at the meetup were:
Rohan Smith a developer who has recently moved to Trindidad and Tobago pitched his new project Rastival, a "hear it later" app (my words), Rastival is a mobile app and chrome extension which will allow users to hear rather than read articles of their choice from around the web. 

Damien Harris - Managing Director at Unique Media Designs, his company is known for for Virtual Mall Jamaica and their online marketing services. They also also develop eCommerce websites for businesses in Jamaica including a payment gateway that works via National Commercial Bank.

Kaiton Williams - Technology Anthropologist, he's interested in understanding how Jamaicans are interacting with technology, previous to this he spent a decade working at Microsoft and has also worked with companies her in Jamaica including Pan Media and Jamaica Online, when it was around. 

Ramon McLaren - Software developer who has worked in media. He's now at the University of the West Indies as the coordinator for final projects in the Computer based management information systems programme (CBMIS) at the Mona School of Business and Management (MSBM). While he declares himself to be an "AntiSocial", he doesn't do Facebook or Twitter, he certainly can keep up a conversation.

Allistaire Mclaren - An engineer at CARIMAC and is wrapping up the CBMIS programme, he's working with a team to convert their final project into a software product. 

Daryl Baugh - An entrepreneur who works with web metrics, web design and building internet companies. There is lots more to say about Daryl like his ability to draw on obscure statistics to match every point he makes but we'll stop here for now.


General Discussion

From the days' proceedings I personally singled out a comment by Chris Zacca who pointed out that investors are looking for alternatives to government paper and may be more willing than previously to invest in tech businesses. I think we're all waiting to see what happens with "Startup Jamaica" the incubator that Julian Robinson says will become a reality in the near future.

We spent time listening to Rohan's pitch for his new app http://rastival.com which will help you to "hear the internet".

Take Aways

It would be impossible to curtail the discussion to things related to Digital Jam 3, some take aways from the meetup:
  • Persons liked the idea of meetups where we actually get to build stuff (less talk more action), the actual implementation details will need to be decided upon. 
  • There is a need for a more accessible community of coders/mentors. While there are systems, even informal that mentor musicians and athletes but no equivalent at any significant scale exists for up and coming developers. Rohan shared how in his early days he wanted to code but had no idea where to go to or who to speak to.
  • Mobile money could be a good thing but there was a fear of silos, we think that the best possible outcome would be interoperability standards so that you don't get locked into XYZ's mobile cash that can't be exchanged with ABC's own.


Most people at this meetup weren't as impressed with the Crowdflower, crowd working thing. Perhaps we weren't the right audience. The Crowdflower type model does make room for those who may not be higher level information workers to begin to tap into an internet based revenue but it's likely to be dull and repetitive tasks.

Where do we go from here?

Echoing a question that was raised at the Digital Jam 3.0 event, we started to discuss where we might want to take things. In terms of value to the developer community there seem to be two things to deal with:
1. A way for newbies to connect with mentors
2. A community where developers can grow their skills and learn best practices

Kaiton suggested that we look at a simple model where developers meet to code on and learn about interesting problems, similar to Kitchen Table Coders.  I think spaces like what "Startup Jamaica" will hopefully be will help towards this. In the meantime, I'm off to scheme to see how I can begin to contribute to some of this.

Monday, July 8, 2013

Creating a Dexterity Based Plone Add-on (Plone 4.3.x on Ubuntu)

These are the steps to creating a Dexterity based add-on in Plone on the Plone 4.3.x platform. Consider this the "Hello World" example. From here you could move on to something like the Todo application tutorial http://tutorialtodoapp.readthedocs.org/.

update: If you need to started quickly, try out Plone in the cloud with Nitrous.io.

Background

A lot has changed in a year. With services like Digital Ocean it is now feasible to deploy a Plone site on a $5 per month server. The documentation for Plone development has been mostly consolidated at the developer.plone.org website, Dexterity is now firmly the recommended approach for new developers and the latest version of Plone ships without 'builtin' grok and relations support. The following tutorial takes these changes into consideration and walks through the process of setting up an add-on. This was tested on a $5 per month Digital Ocean droplet, but should work just as well on a free Nitrous.io box.

For this project we assume the use of the Unified Installer, which assumes the use of a Unix based platform. The example is based on an Ubuntu 12.04 platform.

Start by Installing Plone

Note: We used Ubuntu 12.04.

Install the following as the root user:
apt-get install python-distribute python-dev build-essential libssl-dev libxml2-dev libxslt1-dev libbz2-dev 
apt-get install libjpeg62-dev libreadline-gplv2-dev wv poppler-utils python-imaging
(For more information on installation read http://developer.plone.org/getstarted/installation.html#ubuntu-debian)

For this exercise I created a 'zope' user (you can have any user). As the 'zope' user I ran the following commands.
wget https://launchpad.net/plone/4.3/4.3/+download/Plone-4.3-UnifiedInstaller.tgz
tar xvfz Plone-4.3-UnifiedInstaller.tgz
cd Plone-4.3-UnifiedInstaller
./install zeo
The result was a Plone installation with a buildout directory at $HOME/Plone/zeocluster

Starting and Stopping a ZEO based Zope

(I thought I'd mention this here, so you don't have to go searching all over the place while following along). During development you'll need to occasionally start and stop Plone. The following commands will be very handy.  A quick way to get to the buildout directory is to run the following command:
cd $HOME/Plone/zeocluster
Run these commands from the $HOME/Plone/zeocluster directory:
To start the services:
bin/zeoserver start
bin/client1 start
bin/client2 start

To stop the services:
bin/client1 stop
bin/client2 stop
bin/zeoserver stop

Note: If you used the Plone in the Cloud, Nitrous.io approach then there is also the option of using the plone-start.sh, plone-restart.sh and plone-stop.sh commands.

By default they run on port 8080 for client1 and port 8081 for client2.

The clients can be run in foreground mode, which can be useful for debugging, for example:
bin/client1 fg

Enabling Development Mode, add grok and relations support

In the $HOME/Plone/zeocluster directory, edit 'buildout.cfg' and add 'plone.app.dexterity [relations, grok]' to the 'eggs =' entry in the [buildout] section]. I'm used a few more eggs in my buildout, but it will look similar to this:
eggs =
    Plone
    Pillow
    five.intid
    Products.PloneFormGen
    collective.loremipsum
    plone.app.dexterity [relations, grok]
I like the grok approach so, to ensure that my Plone site works with grok I added the line above, for good measure the line above also enables relations support.

To enable development mode use the '-c develop.cfg' option with buildout
cd $HOME/Plone/zeocluster 
bin/buildout -c develop.cfg  
After running that command, you should have all the tools needed to create your first dexterity based add-on.
warning: running bin/buildout (without the '-c develop.cfg' option) disables many of the development features.

Locate your buildout directory:

By default it will be one of the following locations:
$HOME/Plone/zeocluster
$HOME/Plone/zinstance
$HOME/workspace/zeocluster # if you used the Plone on Nitrous.io setup

Quick Test of your commands

From your buildout directory you should be able to run the the following commands
bin/zopeskel dexterity
bin/zopeskel plone
bin/zopeskel diazotheme

Creating your first Dexterity Add-on

By convention, during development, add-ons are placed in the 'src' directory. From the buildout directory go to the 'src' directory and generate the add-on:

cd src
../bin/zopeskel dexterity hello.world

Note: pay attention to the two preceding dots and the slash ../bin/zopeskel

You should see output similar to this. For my 'hello.world' add-on I entered the following:
Export Mode? easy
Version: 1.0a
Description: Hello World Product


Trying out the add-on

Return to your buildout directory to edit the develop.cfg file. Add the add-on to your buildout by editing the develop.cfg file in two places:
Tell your buildout that hello.world is a filesystem based source project by adding the following line under the [sources] section:
hello.world = fs hello.world

Add hello.world to your available packages (packages in the Python world are called ‘eggs’). This is achieved by in the [buildout] section by adding the new package to the eggs +=:
eggs +=
    Products.DocFinderTab
    plone.reload
    hello.world
Then re-run 'bin/buildout -c develop.cfg'

Start any one of the clients (see notes above on starting and stopping) and add a Plone site. Your new add-on will be available under 'Site Setup' of your site:


 That's what you need to know to get started.

Tuesday, May 14, 2013

Zero to bootstrap in under 60 seconds (not counting initial setup)

I needed to move quickly so I spun up a workspace at http://c9.io and installed the yeoman.io tools.

One time setup

npm install -g yo grunt-cli bower

Cloud9 IDE ships with tools for node.js, python and other platforms, quite useful since yeoman.io depends on node. I wanted to use the bootstrap generator so I installed it.

npm install -g generator-bootstrap

That's the end of the one time setup which took all of 6 minutes.

Day to day usage

I decided to start a bootstrap project, which was as easy as answering a few questions after running the command:

yo bootstrap

Zero to bootstrap  in under 60 seconds (not counting initial setup).


Monday, February 18, 2013

Winding down with a oneline Cloud9 IDE web2py installer

It was such low hanging fruit, I had to do it. A Cloud9 IDE web2py installer (should prove useful when teaching this stuff).

Try it yourself:
curl -L http://tinyurl.com/web2pyinst | bash
 The screenshot should say it all.
There are some Cloud9 IDE specific things, so it won't work out of the box for other platforms.


Wednesday, December 19, 2012

Dev-Evening around a dining table - Developing Digital Craftsmen

TLDR; Lot's of great discussion. No coding. Some interesting projects in the works and we are all agreed that we need to "crack the code" on how to empower more Jamaicans to become "Digital Craftsmen".

I've been trying to figure out a way to get some developers to code together for some time.

Thanks to Khary Sharpe, who launched the Jamaica Software Developers Community at Google+ it has finally happened. The group which is barely weeks old, already boasts almost 50 developers (not all Jamaican, we have at least one Barbadian and an American). I tangent.

As I was saying, I proposed a "Dev-Evening" which is "an invitation to spend a few hours coding around a dining table for an evening". A few persons signed on and here we are.

The purpose?

The idea is to get a few coders and aspiring coders under the same roof to do some code,  hopefully some learning can happen. So we have two designations: Coders and Over-the-shoulderers (Ots).  I also kept it small for two reasons: so that Coders don't get overrun by Ots and I only have so many seats around my dining table.

The Plan

I like structure (sometimes). So I proposed that the meetup have there stages. Stage 1: Introductions and state what you hope to do, Stage 2: Do stuff, ask and answer questions and Stage 3: Wrap up.

What Really Happened

Well the introductions (uhm) never finished. We talked and talked and talked some more. Good conversations. Matthew McNaughton projected some of his vision for the future of SlashRoots.
Marc Gayle is working on a top secret project. I can say that it is built in Ruby on Rails and that it is going to be awesome. Can't say anything else at the moment.

We definitely all agreed that we'd like to see a more structured approach to "raising" "Digital Craftsmen", developers who do more than "slap" a project together. We're trying to figure out an ecosystem that fosters love for coding and entrepreneurship. It's going to involve a lot of bits including: Apprentiship, tools, training, code reviews. On the other side of all of this there we expect that we'll be exporting Digital Craftsmen while others will start businesses that develop web scale products.

We wrapped up with a spontaneous brainstorm around possible business models.

The Future

We all agreed that the conversations were critical and, in a sense, needed catching up. There was valuable exchange and I think it has been a "win" for all of us. In the future I hope to actually do coding at the event. Nothing before it's time.

Trivia

Matthew, never took out his laptop for the whole time. Very much by the way and much more boring, I'm working on extending a custom Plone Add-on, it needs to be date-time aware so that it shows up in the standard Plone calendar, event listings and search results related to "eventish" objects. It's almost there, so if I'm lucky I'll squash all the bugs and still get to bed before midnight.


Wednesday, October 19, 2011

PyCurrency - a simple currency conversion solution for python

I needed a way to add currency conversions to some code, in the past I used a script that retrieved yahoo currency exchange data in csv format and stored the exchange rates. This time around I wanted something  simpler, and since I couldn't find anything, I wrote it myself.

I've just released an alpha version of PyCurrency. The code is embarrassingly horrible, the doctests pass and most importantly it works for me. The idea is to create a wrapper around Google's currency conversion features.

To get started install it using easy_install or pip:
easy_install pycurrency
Usage is pretty straight forward. Below is an example of how you would convert 1 US Dollar to Jamaican Dollars:


>>> from pycurrency import converter
>>> myconverter = converter.Converter(1,'USD','JMD')
>>> myconverter.result() 
u'85.2878465'

Once instantiated, a converter object can be loaded with new currencies and amounts and the result recalculated. For more information visit: http://readthedocs.org/docs/pycurrency

The source is managed using mercurial and housed at bitbucket.org: https://bitbucket.org/alteroo/pycurrency

Saturday, October 27, 2007

Me Grok? You Ruby?

So I learnt the basics of Ruby and Ruby on Rails (RoR) this week. I built a simple application following a tutorial, so I don't know if that counts.

Then, yesterday, I discovered Grok, I'm pretty good at discovering things months after they have existed, being launched in October 2006, Grok is already celebrating its first birthday.

Grok represents Zope 3 for humans. A framework that simplifies the way that a developer works with Zope 3. The highlights for me:
  • Less configuration, more time to code
  • It already has the KSS ajax framework, something I have been playing with in the Plone world
So I've been derailed for awhile from my RoR pursuits to look into Grok. If it does what I need I may stay away from the Ruby crowd for awhile longer.

Tuesday, October 23, 2007

How to learn any new programming language (checklist)

del.icio.us Digg slashdot StumbleUpon

So you want to learn Javascript, C#, Mono, Perl, Python, Boo, PHP, Whatever (well, I don't know if Whatever is a language), here is what you need to know.


Background


I Googled, and didn't find anything that had a step by step, structured way to learn a new programming language. So this is my attempt to capture the process as best as possible. It is especially clear in my head at the moment, because I'm in the process of adding Ruby to my arsenal. From a distance, Python still looks cleaner, but my curiousity about rails has got the better of me.

Level 1 - Get the Basics



Don't be too picky about the exact names of the subtopics presented below, different books and tutorials may give these different names. Generally, I've found that these are the basics to get up and running.

  1. Basic Syntax - All languages have a structure, a way that commands are written. Learn it, is indentation important? Do they have special symbols e.g. ';' or '_'. Keep paying attention to this throughout your learning (learn how to use comments).
  2. Learn Data Types - The typical data types include: Strings and Integers, other types vary in name and function from language to language, learn what a type is.
  3. Learn Variables - It is important to understand what variables are, how they are used and represented, are they dynamically typed? are they loosely typed? There's a difference.
  4. Learn Operators - This is the "mathy" stuff -,+,* etc..
  5. Learn Flow Control - Look for information on loops, if-then and others.
  6. Learn Basic Data Structures - Find out what are the basic data structures of the language, these could be lists, arrays, dictionaries, hashes. The names and features will vary by language.

Level 2


  1. Learn Objects and Classes -
  2. Learn Exception/Error Handling -
  3. Learn Data Structures and Algorithms -
  4. Learn Design Patterns - Many problems in software development fit into a particular 'pattern', Design patterns help to make your code more reusable between projects.

Sign up for my upcoming Plone 5 Book & Video tutorials

plone 5 for newbies book and videos