Sunday, October 28, 2012

Don't do this... EVER!

...or else, I'm gonna find you and insult you to death!
Any new technology tends to go through a 25-year adoption cycle.
                                                                   -- Marc Andreessen
Office Open XML (also informally known as OOXML or OpenXML) is an open file format developed by Microsoft and standardized by ECMA (ECMA-376), ISO and IEC (ISO/IEC 29500:2008). Typical Office Open XML file extensions include:
  1. .docx
  2. .pptx
  3. .xlsx
  4. .docm.
  5. .pptm
  6. .xlsm
Different office suites have limited support of Office Open XML format at the time of this writing. Most (if not all) office suites have only partial support for ISO/IEC Office Open XML format at the time of this writing (which means that same document might display differently in different office suites). Even 2007 or newer versions of Microsoft Office have varying levels of support for ISO/IEC 29500:2008 (Microsoft has stated that upcoming MS Office 2013 will support both read and write of ISO/IEC 29500 Strict).
  • How can you blatantly assume that every other person on this planet is using 2007 or newer version(s) of Microsoft Office? In case you don't know, there are loads of free and commercial MS Office alternatives.
  • I know that Microsoft provides free compatibility packs for older versions of MS Office, but how can you assume that every person has spare time and bandwidth to download and install these packs?
  • What about those who use platforms which are not supported by Microsoft Office (e.g. Linux)?
  • What about those who can't afford a Microsoft Office license?
  • What about those who use cloud based office suites (e.g. Google Docs/Drive)?
Especially when sending documents as attachments to mailing lists, stop being stupid and have sense to use more widely supported formats (such as DOC or PDF) so that everyone can easily access the document.

Mind you, even if you are using 2007 or newer versions of MS Office, you can save a file in 97-2003 format for use in pre-2007 versions of MS Office (and many other office suites), so that you and everyone else can easily access it in most office suites.

Standardization of Office Open XML has been criticized due to many reasons. Quoting Google:
"If ISO were to give OOXML with its 6546 pages the same level of review that other standards have seen, it would take 18 years (6576 days for 6546 pages) to achieve comparable levels of review to the existing ODF standard (871 days for 867 pages) which achieves the same purpose and is thus a good comparison.
Considering that OOXML has only received about 5.5% of the review that comparable standards have undergone, reports about inconsistencies, contradictions and missing information are hardly surprising."

It'll take many (many!) years before Office Open XML will become ubiquitous (when it'll hopefully be supported by all major office suites). Until then, please use more common formats such as PDF, DOC or TXT.

Friday, October 19, 2012

Setup SMS notifications in Google Calender

Google Calender supports SMS notifications for events in your calendars. With this, you'll be automatically reminded about events in your calendar using SMS.

Note: Click on the images in this blogpost to zoom in!

Here are the steps to register your mobile phone:
  1. Goto http://www.google.com/calendar and login with your Google account.
  2. Click on gear icon in top-ish right corner and then click on Settings option:
  3.  Click on Mobile setup link/option:
  4. Now select your Country, input your Phone number and click on Send verification code button:

  5. You'll now receive a verification code in your mobile phone's SMS inbox. Input this Verification code and click on Finish setup button:
  6. You can now customize different SMS notification options for Google Calendar:
Depending on your choice of settings, you'll now receive notifications for some/all forthcoming events in your Google Calendar.

See also:

  1. http://www.google.com/mobile/sms/calendar/

Saturday, August 18, 2012

Compiling gcc-4.7.1 on Ubuntu 12.04

I'm working on OpenCog's Cygwin port for my GSoC 2012 project (with help and guidance from my mentors Nil Geisweiller and David Hart). Right now, I'm trying to build MOSES under Cygwin. And, I'm stuck at: http://pastebin.com/6KCBTr8W. Nil found out that the cause of this problem is that std::future isn't defined, it is only declared (based on [1][2][3][4][5]). This seems however to be a problem with Cygwin itself, as it doesn't fully support C++11 yet.
On my request, Nil had a look at gcc-4.7.1 source to check the status of C++11 support in gcc-4.7 (especially std::future as described above). He found out that the macro conditional wrapping the definition of std::future is nearly the same (which would indicate that it would not work), however [1] seems to suggests that it should work with gcc-4.7 So, we agreed that I should try to build gcc-4.7.1 on Cygwin.

But my desperate attempts to build gcc-4.7.1 on Cygwin failed. I even tried getting some help from not-so-active #cygwin (irc.freenode.net) and someone told me this: http://pastebin.com/TgrWnyfS. But other than this IRC conversation, I could not find much help in Cygwin documentation and on mailing list archives.

So, I thought of building gcc-4.7.1 on Linux first. My intent was to build gcc-4.7.1 in a minimal Ubuntu install (this explains the reason behind using debootstrap chroot below) so that I understand the minimum must-have requirements/dependencies for gcc.

Unless you are running version 12.04 of Ubuntu, please don't blatantly copy/paste commands below (For any other Ubuntu version, please read documentation, linked as References at the end of this post, in detail). Here are the steps I followed to build gcc-4.7.1 on Ubuntu 12.04:

1. Setup Ubuntu-12.04 debootstrap chroot [6]:
sudo debootstrap precise /var/chroot/precise http://archive.ubuntu.com/ubuntu/
2. Make chroot usable (and thus useful) [7]:
sudo cp /etc/resolv.conf /var/chroot/precise/etc/resolv.conf
sudo cp /etc/apt/sources.list /var/chroot/precise/etc/apt/
sudo chroot /var/chroot/precise/
echo "export LANG=C" >> /root/.bashrc
source /root/.bashrc
apt-get update
apt-get --no-install-recommends install nano wget
3. Open file /etc/fstab using following command:
nano /etc/fstab
and append following in this file [8]:
/proc /var/chroot/hardy/proc none rbind 0 0
/dev /var/chroot/hardy/dev none rbind 0 0
/sys /var/chroot/hardy/sys none rbind 0 0
/tmp /var/chroot/hardy/tmp none rbind 0 0
/home /var/chroot/hardy/home none rbind 0 0
/media /var/chroot/hardy/media none rbind 0 0
/lib/modules /var/chroot/hardy/lib/modules none rbind 0 0
/var/run/dbus/ /var/chroot/hardy/var/run/dbus/ none rbind 0 0
4. Install build dependencies/prerequisites:
apt-get --no-install-recommends install g++ gawk m4 gcc-multilib

5. Download gcc-4.7.1 inside chroot using 'wget':
cd /root
wget -c http://www.netgull.com/gcc/releases/gcc-4.7.1/gcc-4.7.1.tar.bz2
(To choose another version of gcc or another download mirror, goto http://gcc.gnu.org/mirrors.html)
I tried a few different approaches to build gcc but got stuck at some errors such as [9] (see also [10][11] for more details and [12] for solution) and build failing inside pbuilder chroot with error http://pastebin.com/4NL6RfhY (as a solution, I used debootstrap instead as in instructions in this blogpost).

For detailed documentation to install gcc, [13] is the authoritative reference.

References:
[1] http://scottmeyers.blogspot.fr/2012/04/c11-is-almost-here-for-real.html
[2] http://stackoverflow.com/questions/10209871/c11-stdasync-doesnt-work-in-mingw
[3] http://cygwin.com/ml/cygwin/2010-03/msg00727.html
[4] http://stackoverflow.com/questions/3414834/gcc-stdthread-not-found-in-namespace-std
[5] http://cygwin.1069669.n5.nabble.com/GCC-4-4-0-Can-t-activate-threading-support-td50226.html
[6] https://wiki.ubuntu.com/DebootstrapChroot
[7] https://wiki.ubuntu.com/DebootstrapChroot#Setting_up_your_chroot_with_debootstrap
[8] https://wiki.ubuntu.com/DebootstrapChroot#Getting_stuff%28X/ssh-agent/ect,dbus,mounting%20removables,modprobe,err%20stuff%29_working_automagically
[9] https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/968766
[10] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52639
[11] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670164
[12] http://stackoverflow.com/a/10339798
[13] http://gcc.gnu.org/install/

Wednesday, February 29, 2012

Installing MATLAB on Linux

Notes:
  1. These instructions have been tested for MATLAB R2011a on Lubuntu 11.10.
  2. For more details, refer to install_guide.pdf in MATLAB setup ISO/folder. You can get this file (and complete official MATLAB documentation) for free (just create a free MathWorks account) at:
I followed these steps to install MATLAB on Lubuntu Linux:
  1. Extract or mount the MATLAB ISO file. Let's assume that you extracted MATLAB ISO file to
    /home/user/matlab
  2. Change to the extracted directory and run:
    cd /home/user/matlab
    sudo ./install
  3. When I ran above command, I got this error message (and installer exited without completing the install):
    user@system:~/matlab$ sudo ./install 
    [sudo] password for user: 
    Preparing installation files ...
    Installing ...
    eval: 1: /tmp/mathworks_2463/java/jre/glnx86/jre/bin/java: Permission denied
    Finished
    user@system:~/matlab$
    MathWorks India has a solution page to this problem. It lists the cause of problem and a solution. But this solution is better (imho) and worked very well for me! All you need to do is run following command on terminal/console:
    • For Linux (32-bit):
      chmod ugo+x /home/user/matlab/java/jre/glnx86/jre/bin/java
    • For Linux (64-bit):
      chmod ugo+x /home/user/matlab/java/jre/glnxa64/jre/bin/java
    Google has loads of related stuff if you search for "matlab java Permission denied".
  4. Don't start MATLAB after installation. Run these commands on terminal [1]:
    mkdir ~/.matlab
    sudo chown -R ${USER}:${USER} ~/.matlab
  5. MATLAB got installed (by default) to /usr/local/MATLAB. To run matlab use:
    /usr/local/MATLAB/R2011a/bin/matlab
[1] http://thameera.wordpress.com/2010/10/21/installing-matlab-2008a-on-ubuntu-10-10/

Monday, February 27, 2012

Access remote shared space from PCManFM

Notes:
  • PCManFM uses SSHFS to connect to mount and interact with files and directories located on remote system.
  • Methods 1 and 2 (below) have been tested on PCManFM 0.9.9.

Method 1:
  1. Open PCManFM.
  2. Type following in address/location bar (and then press Enter/Return key):
    ssh://user@server/dir/to/mount 
    where user is your username on remote server, server is remote server's URL/IP and /dir/to/mount is a directory on remote system which you need to access (you need to have appropriate access privileges on the directory on remote server to be able to access it).
  3. Depending on your connection speed, a new window will open prompting you to "Enter password for ssh as user on server". Enter your password in the text box (and then press Enter/Return key again).
This will connect you to your remote shared space in PCManFM.

Method 2:
(Source: http://en.wikipedia.org/wiki/SSHFS) 
  1. Mount a remote SSHFS share using:
    sshfs user@server: /path/to/mount/point
    where user is your username on remote server, server is remote server's URL/IP and /path/to/mount/point is the mount point on your local system.
  2. Browse to mount point (specified in previous command) in PCManFM.
  3. To unmount from a remote SSHFS share:
    fusermount -u /path/to/mount/point
PS: Methods 1 and 2 (above) are same (in the context of approach they take to mount a remote SSHFS share).

      Sunday, February 19, 2012

      Error: USB device over current status detected

      A few days ago when I booted my system, I was stuck at POST screen with following error message:
      USB device over current status detected.
      00 USB mass storage devices found and configured. 
      I searched the internet (on another system) and found out few solutions but nothing could solve my problem. Then luckily, I looked at my front panel USB port on my computer cabinet and found out that someone (not me!) had mistakenly inserted 3.5mm TRS plug into USB female. I removed it, then rebooted my system and everything was back to normal.

      Friday, February 17, 2012

      Key points in Professor Thrun's "Higher Education 2.0" talk at DLD 2012

      This is an excerpt from Professor Sebastian Thrun's talk at DLD 2012 titled "Higher Education 2.0". He announced Udacity in the same conference. The complete video of his talk is available on youtube (If you have ~22 minutes to spare, go watch it. This excerpt is nothing when compared with his talk).


      "...So, we scrambled. We put together a small technology team. We built a really ugly website. And, we started recording ourselves day and night. And just to show you how primitive our technology was, there was literally a camera, a pen and a webcam...

      We decided to flip the entire way we teach. Rather than lecturing students, we decided to quiz students... The principle way of engaging is that the student has to think. We are doing this to empower the student to learn which is fundamentally different from the way the lectures take place in universities today... And, we recorded this day and night at the expense of my family life, my sleep; one class took me about maybe 10 to 15 hours to record. And, then something bizarre happened. I was teaching the same class at Stanford to 200 students. On day 1, we had this full class of 200 students. And just 2 or 3 weeks in, class was empty. There were only 30 students showing up. So, I asked the students: "What's happening? Why are you not coming to class?". And they all said: "We actually prefer you on video"... You got to think about this. These are students who pay 30000 dollars a year at Stanford University to see the best and most famous of all professors. And, they prefer some video. That was a big shock to us.

      ...Here's my favourite critical email. Here is the very short sentence that moved me. The complaint is that this is a "weeder" class...the class is setup in a way that doesn't motivate but puts really harsh materials in front of students. And, tests them whether they can do it...[This email] was absolutely true. ...in my 20 years of teaching, at Carnegie-Melon, at Stanford, I'd always been a tough teacher. I'd always given students really hard question, I'd always let them fail, and would come to their rescue, making myself look really smart. Here was no purpose of weeding. This was an open university, there was no reason to reduce class size, there was no certificate to be earned; and here I was teaching a weeder class". Then I started to realize that we really set up our students not for success but for failure. We really empower professors by looking smart, and we don't really help the students to become smart. And this was just one example of a person who was dropping out, because I was the smart-ass who didn't help her.

      I started realizing that grades are the failure of the education system.

      Giving somebody three, or four, ... just means that really educators failed to get them to A+ level. So rather than grading students, with grades, as I'd done in the beginning of the class, my task had to be to make students successful, to get everybody to an A+ level. So it couldn't be about harsh questions and difficult questions, where they had one chance, and when they got it wrong they got a C, we changed the entire system to make it so that the questions were still hard, we gave more assistance, we let them take it multiple times, when they finally got them right they would get an A+ and I think it was much better for that.

      That really made me think about the education system as a whole.

      Salman Khan (of Khan Academy) has this wonderful story: when you learn to ride a bicycle, and that's quoting from his talk, and you fail to learn a bicycle, then you don't stop learning a bicycle, give the person a D, and move on to a unicycle. You keep training them as long as it takes to ride a bicycle, and then they can ride a bicycle.

      Our classes today, in math for example, when someone fails, we don't take the time or the needs  to make the student a strong student, we give them a C or a D or an F, then we move to the next class, and now they're already brain-marked as losers, they miss the necessary skills and knowledge, and they're set up for failure.

      This medium has the opportunity to fundamentally change all of this.

      ... Maybe we should rethink education. Universities were invented in 1088, about a thousand years ago.... The lectures were the most effective way to convey information. ...[we had the invention] of digital media. And, miraculously, professors today teach exactly the same way they taught 100 years ago. University has been the most suprisingly the least innovative of all places in society. Perhaps we should reconsider and think about new media, for teaching, that can personalise themselves and helps us to become effective."


      PS: I plan to annotate this post except that I don't know when it'll happen. In the meantime, bolded text in above quoted text will further highlight some points that are worth noting.