Channels ▼

Al Williams

Dr. Dobb's Bloggers

Android, Airplanes, and Assembler: IDEOne

March 28, 2011

I spend a lot of time on airplanes. It used to be you'd often strike up a conversation with the person next to you on a plane. Over the years I met the editor of a newspaper in Roswell, New Mexico (and, yes, he was human as far as I could tell), an LA Laker Girl (no kidding), and many other interesting characters. But these days, you don't get much chance to visit with your flying neighbors because everyone has an iPod, or a laptop, or some other gadget to keep them busy.

I'm no exception. But when I look around at the others on the plane, I see most of them watching movies, listening to music, or playing games. Once in a while you'll see someone in a suit working on a spreadsheet or some PowerPoint charts. I wonder what people think when they see me writing C++ or Java code on the plane?

I like to code. Some music in the headphones for background noise and I'm coding away on the plane. No phone ringing off the hook. Often no e-mail, although more planes are getting WiFi now. I used to carry a netbook running Linux, so my old friends GCC and javac were right there on the plane with me. However, lately I've been carrying an Android tablet. I'd bet someone has GCC and Java tools that run native, but it would be a stretch.

So I find myself on an airplane, my seat mates all plugged into their devices and I'm surfing the Web using the plane's WiFi. I really wanted to play with a little algorithm that was dancing in my head, but I didn't have the netbook with me and my laptop is too big for a coach seat. Then I noticed something in the Android market: IDEOne.

A few minutes later I had IDEOne installed on the tablet. It turns out the application is a front end to the IDEOne website (http://www.ideone.com), which requires free registration. This website lets you enter source code and compile it in roughly 40 different languages ranging from Ada and awk to Visual Basic and Whitespace. Of course, C, C++, C#, Java, and many others are right there too.

Don't expect Eclipse. This is not made to be a production environment, but it is handy for testing a little snippet of code or demonstrations or training. I was having a conversation with someone about multiple inheritance in C++, for example, and fired up the IDEOne website to compile the following code (see the screenshot for how it looked online):

#include <iostream>
 
using namespace std;
 
class base1
  {
  public:
  void p1(void) { cout<<"Object base1\n"; }
  };
 
class base2
  {
  public:
  void p2(void) { cout<<"Object base2\n"; }
  };
 
class multi: public base1, public base2
  {
  public:
  void print(void) { p1(); p2(); }
  };
 
int main(int argc, char *argv[])
  {
  multi obj;
  obj.p2();
  obj.p1();
  obj.print();
  return 0;
  }

The Android app is also great fun (hint: your password is your API key, not your login password, so create an API key when you create your account). With either the Android app or the website you can try out that FORTRAN code for sieving prime numbers that just can't wait until you get home!

[Click image to view at full size]
Figure 1. Source code on the IDEOne website.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video