This is a short post with some references for doing what the title of the post says. MiniSAT is a powerful SAT solver with a well-documented (and surprisingly short) codebase. It obviously isn’t the best out there, but definitely the most user friendly, which makes it great for research and hacking purposes. When I tried to install MiniSAT 2.2.0 on my Mac (runs OSX 10.7.5 Lion), there were some minor issues that I could solve with some searching around, but I hope this post helps someone trying to do the same (at least me if I need it anyway). It’s just the following steps, and you should have it running in no time:

Follow the instructions on this link first. The same instructions have been copied below:

  1. You must have the XCode tools installed on your mac.
  2. Download the source distribution
  3. Edit the file utils/System.cc to include the stub for memUsedPeak, patched code will look like this:
    #elif defined(__APPLE__)
    #include 
    
    double Minisat::memUsed(void) {
       malloc_statistics_t t;
       malloc_zone_statistics(NULL, &t);
       return (double)t.max_size_in_use / (1024*1024); }
    double Minisat::memUsedPeak(void) {return memUsed(); }
    #else
  4. Follow the instructions distributed, changing the “gmake rs” to “make r”

Depending on the version of MiniSAT you’re trying to install, you may or may not have to do this. But make sure it’s done.

To build, go to minisat/core and run “make r”. If it works, great. If not, you might get the following response:

Makefile:4: /mtl/template.mk: No such file or directory
make: *** No rule to make target `/mtl/template.mk'.  Stop.

To correct this, you need to set the MROOT environment variable to the MiniSAT main directory. Go to the minisat directory and type

export MROOT=$PWD

Now go to minisat/core and type “make r”. This should work. Please post other issues in comments here. Or better still, refer to the amazing MiniSAT forum posts (where I learned most of what I know). Check the following links:

https://groups.google.com/forum/#!topic/minisat/0mGR5vei9Sc

https://groups.google.com/forum/#!searchin/minisat/add$20learned$20clause/minisat/tt7mtJxtCs4/oQRCRPPFZnMJ

 

Tags: , ,

Do you know how to do change font size in Power Point quickly? … You must know these things. Grad school is about learning Power Point.

One of my potential advisors said this while he was helping me out with an important presentation. While it was hilarious when he said it, a little thought about it, coupled with my own recent experiences have made me look at the important lesson in there. The simple lesson is that there are some things one has to do very frequently, and it makes a lot of sense to focus on those tasks, take a step back, and wonder if one is doing them efficiently. It is such a simple idea, but it often escapes implementation in real life. Like in my case, after months of using a Mac, I’m still unfamiliar with keyboard shortcuts, and extremely clumsy. While I keep lamenting how I’m used to Linux, and the Command key is an abomination, I would do better to consciously try and learn the nuances of the Mac environment.

There are a couple of important realizations here. Firstly, I strongly believe that most people have the ability to adapt themselves to almost any situation. Sure, it takes time sometimes, and might be really annoying at first, but rewards are quick, eventually. And second, you don’t want to be the n00b coder who has to use his mouse to open and run his editor.

So this week is dedicated to not giving in to the temptation of using brute force and ugly methods. If I’m going to be doing something, I better do it well.

Tags: , ,

It’s funny that my initial posts are turning out to be all about version control. But given the hugely collaborative nature of research today, I guess it makes sense :D . I’ve had my own issues with setting up command line access to my Github and Bitbucket accounts. Each time I wasted some time setting up the SSH RSA keys, and in the troubleshooting after that. But now I have a good short procedure (from reading up a few sources), and handling the most common bug.

The following description is for Mac (OSX), and for Bitbucket. I’m mostly writing this for myself, and for anyone else who might find it useful, but it is not really meant to be a complete reference. So, here’s how RSA keys work:

You have a public key, and a private key. You must store the private key in your computer, and provide the public key to the remote source.

$ ssh-keygen -t rsa -C "your_email@youremail.com"
#Creates a new ssh key using the provided email

This prompts you to enter a passphrase. Enter it, for added security, although if only you handle your computer, this can be skipped. But it is possible to not have to enter the passphrase each time, so I consider it a good idea to set one anyway. In addition, a filename must be selected for the key to be put in. Typically, it will be put into the ~/.ssh directory. The default name would be id_rsa. Although I choose to enter my own name for each new service I’m creating an rsa key for. In this case, I entered the name bitbucket_rsa. This creates two files in the .ssh folder: bitbucket_rsa and bitbucket_rsa.pub. The former contains the private key, and the latter contains the public key.

Now, you can simply go into the settings in your Bitbucket account, and paste the contents of bitbucket_rsa.pub at the appropriate place. That’s it, now you’re (most likely) ready to push and pull! There might be issues coming up occasionally. There’s a lot of online content dedicated to solving those problems, but the most common one is when despite setting up the keys correctly, the remote server denies a connection. This often happens when SSH doesn’t know how to offer Bitbucket a key. To check for that, type the following command

$ ssh-add -l

This should show up a list, and if bitbucket_rsa doesn’t show up, it means it wasn’t added to this list. To add it, simply type

$ ssh-add ~/.ssh/bitbucket_rsa

This should do the trick! For other issues, the help pages of Github and Bitbucket are very useful.

Tags: , , ,

For quite some time I’ve been wanting to start serious development. I have several ideas, but stray code lying around on my computer always made me uncomfortable. Hence I needed some sort of central location where I could store all the code I write. Enter GitHub! I’ve spent quite some time in the past couple of days to understand the major commands and working of Git. I’ve used SVN before, but this has fundamental differences. In particular, the presence of a staging area before committing, and the way modified files are stored and referenced differs from SVN.

Anyhow, so after installing Git in my Mac (the command line version doesn’t work for me now, which is sad) and on my Ubuntu VMWare (command line here!), I’m ready to start writing more code. While learning about Git, I came across two great ways to quickly gain a working knowledge of the basics, which can help you to start off in no time. The first is this short “course” that teaches Git in a few easy steps. Worth trying: http://try.github.com/levels/1/challenges/1. While this course gives hands-on experience, it doesn’t make some of the internal workings of Git very clear. For the intuition, I have this (http://www.sbf5.com/~cduan/technical/git/) website to thank.

Now I feel extremely well-equipped to start working on all those programming projects (mostly personal) with ease and comfort.

Tags: ,

What happens when a 22 year old gets access to unlimited Web hosting with all facilities? He spends all his time thinking about developing more websites, creating a larger Internet footprint for himself. A part of that desire is this new blog I’m starting. It is a research blog, primarily for more technical ideas and musings. I will write about general ideas which I think are worth pursuing, interesting programs that I write, or even my interpretations of something new that I learn. Part of the motivation to start this blog lies in being able to express technical ideas more clearly (which can be done only by writing as much as possible), and the rest of it is about archiving and tracking progress.

I spent quite some time pondering over what would be the best way to go about this – a blog or a wiki. I even installed a couple of wiki softwares, spent a huge amount of time on getting them to work, but then returned to WordPress because a blog fits the bill. I have two redundant wikis now, but hopefully they will be useful some other time.

I plan to categorize updates as meticulously as possible, and update this blog more than once a week (or so I hope).

Tags: ,