Thursday, October 2, 2014

Learning OCAML: OcaIDE

OCAML has a growing and loyal community behind it, OCAML.org is a great place to get in touch and contribute.
Nevertheless, in my journey I found in difficult to find much material that is tailored for a total noobie.  This is why I decided to document my journey towards functional-language enlightenment, namely by learning and using OCAML language for  developing the MoanaML  project. Your feedback, guidance and contributions are most welcomed.

So here were are, let's start exploring...our glory awaits! :) By the way, I am running Ubuntu 14.04, so most of my tips will be related to it.

I tend to learn most by doing and to do something useful you need the right tools.

Therefore I think the first post about my journey should be on finding and using the right IDE 1. There are not many options around, but there are a few. Your main trade off is on how much time you spend fiddling with them.

I tried a few in all the cases I had to tweak the settings and configuration to get reasonable performance. In the end, I started using OcaIDE, which is a plugin for Eclipse. It is far from perfect, but gives you the initial support a noobie might need to get started.

  • Source editor for modules (ml files), interfaces (mli files), parsers (mly files) and lexers (mll files)
  • Syntax coloring (colors and styles are configurable)
  • Automatic indentation while typing in the editor (configurable in the preferences)
  • A customizable integrated code formatter, and an interface to the camlp4 formatter (through an AST printer)
  • Completion
  • Library browser, both for the standard library and user libraries

    . . . and much more.

Out of all the Eclipse plugins OcaIDE works pretty much out of the box. However you need to make sure you specify your build command in the Project preferences. This is also the right place to specify all the libraries and/or external packages the you are planning to use in your project.

In any case, the OcaIDE project offers Flash-based tutorials on how to set-up and best utilised your developing environment.

You can find step-by-step instructions for it here from guys in UPenn, which include info on how to install OCAML, Eclipse and finally OcaIDE.
A nice summary of how to install OCAML on different enviroment is also presented by the OCAML.org here.

There is plenty of discussion online about a suitable IDE, here are the links to some of it:







1 I am not a big fan of Vim and Emacs, so I wanted to find and IDE that gives me slightly more than just syntax highlight and indentation - just kidding :)  This  is a very gross underestimation of the true power behind Vim and Emacs editors, they are truly powerful tools once you master them. I guess in my case, I preferred to minimize my effort on fiddling with the developing environment and remembering key combinations and rather focus on the OCAML language itself. Nevertheless, as it turned out, choosing an IDE introduced plenty of fiddling with configuration as well. You can find numerous Stack Overflow discussions about it online.

Friday, March 21, 2014

I developed my first android app - 360Linkz


I have recently published my first android app. It is very simple but I learnt a lot developing it. I named it 36Olinkz. 

The app detects LinkedIn contacts in your vicinity. Once you login using LinkedIn credentials you can then filter and send messages to your connections. You will also be notified on any of the app users that are located close by (i.e., using the same Wifi point). In case, the detected user is not part of your connections, you can send a LinkedIn invitation or a message.

I plan to continue working on it to introduced new features. There is no grater motivation for a developer than the feedback from the users.

You can download it from the android play store 

 or click on the download link on the www.360linkz.com




Wednesday, December 4, 2013

From Latex to DOCX

Latex is awesome!  I just thought I needed to say it straight up...seriously, I made the switch from Microsoft Word years ago and never looked back.

Having said that, Microsoft Word has its benefits.

Sometimes you find yourself wanting to convert you tex file into docx or any other format. This is not a trivial task. You can copy & paste or use online services but I always wanted to have a tool to do it on my computer.

I recently came across this nifty tool, pandoc, a universal document converter:

"If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, OPML, or Haddock markup to

It works great. I was able to convert from Latex to Word and get very decent results. It was able to port citation, figures and even mathematical equations!

I did have a problem setting it up to support new packages. In particular, it wouldn't detect my acronyms \ac{BLAH}.

I used sed utility to remove them. I know it's not ideal, but it worked for me.

I would like to thank John MacFarlane for creating such a great tool!

Let me know about your experieneces with the tool or maybe you can help me figure out how to make it support additional latex packages :)

Enjoy!

Thursday, October 3, 2013

10 Tips...for new PhD students..


1. Small incremental goals (milestones)...

2. Take breaks...

3. Collaborate, work in a group...

4. Write, take notes, comments, blog, tweet...


6. Measure your progress...

7. Know yourself...

8. Use tools to manage bibliography...

9. Peer-review your work

10. Listen to senior PhD students :P


Thursday, October 25, 2012

Compiling C++ code after Ubuntu 12.10 upgrade...

Recently upgraded to Ubuntu 12.10 quantal and almost immediately found out that Omnet++ is not compiling any more :)

It turns out the issue is with the new gcc 4.7 compiler.

After Googling the issue, I stumbled on this post that help me fix it. The problem is with abspath.cc file that throws an error

 add the following lines to fix the issue:

#ifdef _WIN32
#include
#include
#else
#include

#endif

Thanks Georgi for posting it. It worked like a charm.

Hope it helps you as well.

Sunday, August 19, 2012

R + Omnet++ = Love++



I have blogged previously about the R Framework.

Now I found this great R packages that allows to import omnetpp results files (*.sca, *.vec) into R.

The package supports loading the contents of OMNeT++ result files into R, organizing the data and creating various plots from them.

 I found the tutorial very helpful.

Enjoy!

Update 28/11/2012: Came across some very helpful tips for using the package here

Saturday, March 31, 2012

Finally a way to add a PDF comment within Latex - Thank you PDFCOMMENTS

For awhile now I have been looking for ways to add PDF comments within latex.

Some suggested to use: \marginpar{}

I did't like it...

This morning I stumled upon this discussion page: How to annotate PDF files generated by pdflatex?

Note, I also discovered that PDFLatex has \pdfannot command. However I couldn't figure out or find an example to make it work. If you have please let me know :)

Altough \pdfcomments package offeres some cool features I encounter a few problems with it, while using TexMaker on Ubuntu.

  1. Embedded TexMaker view doesn't allow to view annotations. It displays an icon but nothing happens when you click on it.
    1. I use external viewer for it, however not without problems: Ubuntu default viewer - Evince   - is known to have problem displaying with PDFannotiations. I switched to Okular to view the comments.
  2. \pdfmarkupcomment doesn't work - not even with Okular :(

Have fun. Comment on your experience with it.