Tag Archives: Development

Long time no write – Cloud9IDE

It’s been quite a while I didn’t write anything, mostly due to the fact I simply didn’t take the time to do so. I will try and get back into the habit of making this at least a weekly thing, but we’ll see if that’s realistic 🙂

Cloud9IDE

cloud9ide logo

 

For the past couple of weeks, I have been trying out Cloud9 IDE over the weekends and am really happy I did. I made the switch to a full cloud work environment about 6 months ago, but hadn’t tried actually developing that way (my current job doesn’t require me to do a lot of actual coding) so I thought it a good idea to give it a go with a small project and see how it would work.

Starter: Sign-up to new project

The initial sign-up is very smooth and quick. Not many details to fill-in and, most importantly: they do not force you to give a credit card (A REAL TRIAL! :)). You can then go on and create 1 private (as in, without anyone else being able to look at your source code) project with the free account and that is where the real fun starts.

When you create a new project, this is called a “Workspace” in Cloud9. You can choose from a variety of starter packs (that pre-configure your workspace for the types of technology you’re going to use) or simply go for something “custom”. The first interesting thing I saw whilst creating this workspace was “clone from url”. This option enabled me to specify a github url and create a workspace directly linked to it (pulling the code and letting me commit without a problem). That was a really nice surprise to start off with, as I was anxious as to how I would solve problems with getting stuff into the cloud during my development process.

First steps

The IDE looks pretty neat from the first try. Here is an example of both the first page you see (upon project creation — node.js here) and some syntax highlighting

cloud9 new project screenCloud 9 screen with syntax highlights

The editor is really smooth and definitely works as nicely as any text-editor I have used natively (granted, I haven’t tried a 3000 line file yet, but still). It is very easy to create files, write code and most importantly… run it…

Running your code

It is in running, testing and debugging my code that I see the enormous benefit of using cloud9. A couple of things quickly jump to mind:

  1. Live-preview in the same browser tab. It simply updates as you save your files
  2. SauceLabs integration enables you to test in ANY browser you want – MOBILE INCLUDED. Yup, you heard that right: it takes 10 seconds to save your file and have it run on both an emulated android and an ios device…

cloud9 mobile testing with saucelabs

  1. Live link. If the “live preview” is not good enough for you and you want to test your code outside of the cloud9IDE preview, you can simply take the link and open it up in another tab, to test it the old fashioned way.

Wonderful easter-eggs

Whilst getting to grips with Cloud9, I was trying to learn a little on html5 mobile app development at the same time, so I wanted to use phonegap and, more specifically, ionic (a framework based around phonegap for html5 mobile development). That is when the power of the terminal became really apparent. I thought I would have to go through all the trouble to get node.js installed and then make it work with phonegap, but no. Node.js was already fully running and the only command I had to put into the terminal was “npm install -g cordova ionic”. That was it… and I’m not even kidding… No errors, no hassle, everything simply installed and my whole workspace was set-up to start developing apps for mobile…

Another useful thing was that at some point I wanted a public URL for my app. As it was HTML5 I also wanted to support normal browsers so I decided to get a heroku app and push it there. Again, I thought I would have to set up the heroku toolbelt and some other things to get this working, but no… IT WAS ALREADY THERE. This meant that the whole process of pushing my code live on a new heroku app took under a minute (setting up the new heroku app INCLUDED).

Conclusion

After 3 days (over the space of 3 weeks) with Cloud9IDE, I am completely sold. I think it is one of the better applications I have tried out over the last years and definitely feels like a major leap forward in the development landscape in general.

I haven’t tried out very heavy set-ups yet, so I’m not saying this is for everyone and every project, but I am definitely recommending this for small to medium-scale web development and any html5 mobile development.

Hope this overview was useful, but let me know if you have any thoughts / comments!

 

 

Trello (& Agile) review

At my current company, I inherited the use of « Trello » (www.trello.com). Initially I wasn’t too psyched with it, probably due to my own habits and the fact this meant changing, but I have grown really fond of it!

Trello is an online task management tool that “gets back to the basics”. In essence, it somewhat replicates the good-old whiteboard with post-its, but makes it digital, multi-user, cross-platform, mobile & simply amazing Smile. It consists of a very simple column system, with each column containing several tickets. Each ticket can contain text, images, due dates, labels, etc. and be assigned to users. You can create as many columns as you want, suiting different needs. This creates for a very flexible workflow that can be tailored within minutes to do what you want it to do.

Agile use case

In our case, we started out a bit messy, simply keeping a backlog of tickets in “To Do”, moving to “Doing” when worked on, “Done” when finished and “Deployed” when deployed (duh… Smile). However, switching over to a scrum-like model is as simple as adding a column “Current Sprint” and applying the needed logic of daily scrums, grooming, etc.

Conclusion

All-in-all I am really pleased with Trello and will definitely be using it for the foreseeable future. As flexible as it is, it seems to enable me to cater specific boards to specific scenarios of project management. I Would recommend everyone who’s looking for an effective project management suite to give it a go and let me know how it went !

Setting up a VirtualBox development instance with NAT port forwarding

I just spent another couple of hours figuring out how to effectively re-install my development instance (Ubuntu Server running in VirtualBox on my Windows host) and thought I’d write it down for personal reference and in case someone needs it :).

  1. Install VirtualBox (of course)
  2. Install Ubuntu Server
  3. Enable port forwarding from 127.0.0.1 to 10.0.2.15 on port 80
  4. Install guest additions
    1. sudo apt-get install dkms build-essentials
    2. mount guest additions
    3. sudo mount /dev/cdrom /media/cdrom
    4. cd media cdrom
    5. sudo ./VBoxLinuxAdditions.run
  5. Reboot
  6. You’re done ! You should now be able to access your linux guest by going to localhost on your host 🙂

Now you might want to set up folder sharing and map your local www folder to /var/www, but that is easy from here I guess :).

Note: do not forget to sudo adduser “youruser” vboxsf to enabled permissions on your shared folder!

Android voice control

I have been playing with Android development for quite a while, but two weeks ago I finally finished my first Application. I thought that Text-to-Speech and Speech-to-Text were pretty amazingly easy to integrate and thought I could make everyone benefit from a few snippits, so here is my code (it was almost all done in a single class) :


package com.findarato.cyanide;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;
import android.view.*;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class CyanideRobotActivity extends Activity implements OnClickListener, OnInitListener, OnUtteranceCompletedListener {

private static final int VOICE_RECOGNITION_REQUEST_CODE = 12345;

EditText server = null;
EditText port = null;

TextToSpeech tts = null;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);

final Button buttonStart = (Button) findViewById(R.id.button_start);
final Button buttonStop = (Button) findViewById(R.id.button_stop);
final Button buttonSpeech = (Button) findViewById(R.id.button_speech);
tts = new TextToSpeech(this, this);
tts.setOnUtteranceCompletedListener(this);
server = (EditText) findViewById(R.id.text_ip);
port = (EditText) findViewById(R.id.text_port);

port.setText("9002");

buttonStart.setOnClickListener(this);
buttonStop.setOnClickListener(this);
buttonSpeech.setOnClickListener(this);

}

private void startVoiceRecognitionActivity() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Please tell the robot what to do.");
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 20);
startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
}

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
String serverString = server.getText().toString();
int portInt = Integer.parseInt(port.getText().toString());

if(requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {
ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
for(String match : matches) {
if(match.equalsIgnoreCase("start robot") || match.equalsIgnoreCase("start") || match.equalsIgnoreCase("start cleaning")) {
tts.speak("Starting cleaning now", TextToSpeech.QUEUE_FLUSH, null);
new networkRequest(serverString, portInt, "START").execute();
}
else if(match.equalsIgnoreCase("stop robot") || match.equalsIgnoreCase("stop") || match.equalsIgnoreCase("stop cleaning")) {
tts.speak("Stopping cleaning now, returning to my charging dock.", TextToSpeech.QUEUE_FLUSH, null);
new networkRequest(serverString, portInt, "STOP", true).execute();
}
}
super.onActivityResult(requestCode, resultCode, data);
}
}

@Override
public void onClick(View v) {

String serverString = server.getText().toString();
int portInt = Integer.parseInt(port.getText().toString());

switch(v.getId()) {
case R.id.button_start :
new networkRequest(serverString, portInt, "START").execute();
break;
case R.id.button_stop :
new networkRequest(serverString, portInt, "STOP").execute();
break;
case R.id.button_speech :
HashMap<String, String> extra = new HashMap<String, String>();
extra.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "start voice recognition");
tts.speak("Hello master, what would you like me to do ?", TextToSpeech.QUEUE_ADD, extra);
break;
default:
break;
}

}

@Override
public void onInit(int status) {
// TODO Auto-generated method stub

}

@Override
public void onUtteranceCompleted(String utteranceId) {
if(utteranceId.equals("start voice recognition"))
startVoiceRecognitionActivity();
}
}

The interesting parts are the methods startVoiceRecognitionActivity() and onClick(View v) -> switch statement R.id.button_speech

EDIT : I have created a gihub repo for this, if anyone is interested : https://github.com/JoshuaWohle/Android-Voice-Control