I just finished writing my first machine learning algorithm in Matlab. The algorithm is based on gradient descent search for estimating parameters of linear regression (but can be easily extended to quadratic or even higher-dimensional polynomials). It’s fairly easy if you know the theory behind the model. So, first a very brief theory portion. This isn’t a tutorial on statistics. Go read a book if you don’t know about regression.

Read the rest of this entry »

I recently had to write a Linux Security Module (LSM) for one of my research projects and I was surprised to find that there are few tutorials out there and most of them don’t work because of the discrepencies in kernel versions. They’re talking about 2.000.x kernel versions! The only good tutorial I came across was the one on Linux Journal but it assumed some background knowledge (which I didn’t have). So, I had to struggle for a day to figure out how to go about writing the LSM. Hence, this tutorial.

Now, this isn’t strictly a newbie tutorial. It isn’t even a tutorial per se. It’s more like a guideline that will tell you where to look to find what you need. The reason is that if I write something specific, it’ll go out-of-date in a giffy. So, I’ll tell you the process of how I figured out the steps and you can (probably) reproduce them even if the specifics have changed. This might not be the best way to do it but it certainly gets you going. I had to take quite a few detours to get to these steps; so they might save you some time. Ok, let’s go.
Read the rest of this entry »

It’s been four days since I started working with eclipse plugins and I finally have my first useful plugin. It’s useful for my research purposes and hopefully for a small audience interested in my work. It might also be useful for those trying to learn how to write eclipse plugins because I’ll soon be writing a tutorial on how I put this thing together from scratch (inshallah).

For the time being though, enjoy the screenshot.

Update: fixed the plugin with a new ‘View’. It now operates much better with a separate view for the output and controls. Also added is a ‘Hierarchy’ view for viewing the policy in a nice tree structure.

If you’ve ever had trouble installing Ubuntu because you couldn’t use a CD (because of a bad CD, a thoroughly malicious drive or, as in my case, a small-form CD stuck in your slot-load mechanism), you might want to read this. This mini-tutorial (slash how-to) is going to show you a clean and concise, no-BS mechanism for installing Ubuntu 8.04 Hardy Heron without the need for a CD or a working Linux installation. I didn’t discover this method. Just came across it somewhere and can’t find the link in Google. So, here it goes. (I’m assuming your USB is F: drive)

  1. Get syslinux (this will allow you to make your USB active and install a bootloader on it — I used version 3.81).
  2. Format your (700M+) USB drive with a FAT32 filesystem.
  3. Extract syslinux, go to the win32 folder in the extracted files and execute (from ‘cmd’): syslinux.exe -ma f:  … ‘m’ installs the bootloader and ‘a’ makes it active.
  4. Get Ubuntu 8.04 iso image and use an un-archiver to extract it. Winrar works for me.
  5. Copy all extracted files to f:
  6. Copy f:/isolinux/* to f:/*
  7. Rename isolinux.cfg to syslinux.cfg
  8. Reboot and boot from your USB drive (you may need to change BIOS settings for this).

Voila! You have Ubuntu working.

Note: Ubuntu 9.10 didn’t work for me. I got to the X part but only a “working” cursor showed with no progress. So, let me know if you get it working with this method.

This tutorial is about flashing your Android Developer Phone 1 with your own custom build. It will provide a concise description of steps involved along with a special portion on how to port Google’s apps on your custom build. I found that particularly troublesome with little help on the Internet. So, that will be a bonus :)

First the disclaimer: This is for your Android Dev Phone 1 (ADP1). If you’re using T-Mobile’s SIM/firmware locked phone, stop. This tutorial is not for you. If you’re using ADP1, proceed at your own risk. You may brick your phone if you do something wrong and I shall not be held responsible for it. Finally, you might want to backup your factory-provided image. I don’t think it’s really necessary because you can just flash it again using the HTC provided images.

So, here is how it’s done:

Read the rest of this entry »

We received our Google Android Dev Phone 1 yesterday and immediately ran into trouble. We don’t have a supported carrier here and we couldn’t get our own carriers to work with Android because we didn’t have the APN information. Android’s distro that comes bundled into the Dev Phone won’t let you in without an APN  though. You get a “SIM not found” message and you can’t do anything other than dial an emergency number. So, after searching for a while, I found some useful tips for getting around the problem.

First, you need to plug in your phone through the provided USB. If you’re running XP, the device will probably not be recognized. (It wasn’t for me.) So, download the Android phone driver here (or here) and install it when XP asks to search for a driver. (Thanks to anddev for this information.) After that, get the Android SDK from here. Go to command prompt and navigate to the tools directory in the SDK. Then execute these commands.

adb shell
su
cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
INSERT INTO system (name, value) VALUES ('device_provisioned', 1);
.exit
reboot

Once the device finishes rebooting,

adb shell
am start -a android.intent.action.MAIN -n com.android.settings/.Settings

Many thanks to Android Tricks for writing this tip.

Update 1: Android SDK ships with the latest version of the windows Android phone driver. You can find it in $ANDROID_SDK_HOME/usb_driver. So, you don’t need to download the driver using the links provided above.

Update 2: To get the Android device to work on Ubuntu 9.04 Jaunty Jackalope, you need to perform the following steps:

  1. sudo nano /etc/udev/rules.d/51-android.rules
  2. Add this line to the file: SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
    (You can get the 0bb4 value from lsusb for High Tech Corporation (i.e. HTC) if you work with a different phone)
  3. sudo chmod a+rx /etc/udev/rules.d/51-android.rules
  4. sudo /etc/init.d/udev restart
  5. adb devices (to see the device)

This is a more of a brainstorm than an idea and I have no idea if this already exists. But here’s the thought anyway.

I read “Adobe Blogs” — a single interface to all the blogs contributed by the Adobe team. Is there an equivalent of that in the twitter/microblog world? To the extent that I’ve seen it, there is none. Each corporation dedicates a person to write on twitter for them. How’s about having a single aggregating microblog that provides a single interface to a corporation’s microbloggers. Right now, you have to subscribe to all the different microbloggers or have a single person write on behalf of the whole business. Can we not distribute this so that every employee can chip in?

HTC Hero

June 25, 2009

HTC (the guys who built the first Android phone for T-Mobile) have released a new Android-based smartphone called Hero. It’s an amazing piece of technology and looks really cute. We’ll be trying to get our hands on this one but only if it’s not SIM-locked. Not likely, since HTC is a manufacturer, not a carrier. It runs on a customized Android OS. Looks like HTC guys put a lot of effort into the UI of the device. Not only is it multi-touch, it also looks like the next gen of UIs for smartphones. Here are the specs:

http://www.htc.com/www/product/hero/specification.html

Here’s the phone:

Android-based Hero from HTC

Android-based Hero from HTC

Google is aiming at killing email altogether!

I’ve been viewing the newest beta product from Google called “Wave”. It’s rightly named not only because it’s arranges all conversations and communication in a wave that participants can join and leave but also because it’s most likely going to give rise to a new wave of technology products. For the complete intro to this amazing new technology, you should head over and view the complete (80 minute) demo given at Google I/O. What I like most about the product is 1) the real-time features including instant appearance of the text input in one user’s account on the other user’s wave inbox 2) the collaborative features (including multiple simultaneous editing users and 3) the way everything is linked together, much like Tim Lee’s linked data.

We have often been led to believe that certain pieces of technology are paradigm changing but this piece of technology is one thing that is surely going to change the way communication occurs. If it’s as good as the demo, it may mean a gigantic step towards linked data and streamlining of different technologies such as social networking sites, (micro)blogging, online comments and certainly email! If this works out, soon we won’t need to send email.

That cryptic title basically means that if you search for “search” on Google, the first result you get is for live.com. Surprising but what’s more so is that Google is 12th on the result list — coming after such giants as Search.org, Altavista and Netscape. Who uses those anyway and how come Google itself is doing so great for that?

Could it be that I’ve somehow demoted Google using the wiki features? Can anyone confirm that they’re getting the same (or similar) result?

“search” – Google Search.

Follow

Get every new post delivered to your Inbox.