OpenCV On Mac: How To Get It Up And Running?

opencvOpenCV is a computer vision library used extensively by people in the computer vision field. Until a couple of years ago, OpenCV was a bit hacky and the usage was not very straightforward. But determined efforts by multiple companies finally standardized the process and now it is nice and clean. Computer vision algorithms are computationally intensive, requiring lot of processing power to run in real time. Before OpenCV came along, the efforts were very fragmented and repetitive, and there was no standard library as such. Hence Intel decided to do something about it and came up with OpenCV. The advantage of OpenCV is that the algorithms are highly optimized and the library is available on almost all the popular platforms. I have outlined the procedure below to get OpenCV up and running on your Mac.   Continue reading

Git Is Gone In OS X Mountain Lion

gitThis blog post is for a very specific group of people who cared enough to notice that git command line tool is not working on their brand new MacBooks with Mountain Lion! If that sentence didn’t make sense to you, then you are probably at the wrong place. I got my new Mac last week and I wanted to clone some code from Github. So I opened the terminal to clone it and behold, “git” is apparently not a recognized command! I have already installed the latest developer preview of Xcode (version 4.6 DP3), so what went wrong here? It turns out that we need to manually install the git command line tools. We still live in a world where git is not an integral part of all the systems! Xcode 4.6 doesn’t install the command line tools by default, and Git is one of the tools included in these command line tools. Anyway, there’s a simple fix for it.   Continue reading

How To Build A Web Crawler?

webI was reading an article the other day and I came across the term “web crawler”. The context in which it was used got me a little curious about the design of a web crawler. A web crawler is a simple program that scans or “crawls” through web pages to create an index of the data it’s looking for. There are several uses for the program, perhaps the most popular being search engines using it to provide web surfers with relevant websites. Google has perfected the art of crawling over the years! A web crawler can pretty much be used by anyone who is trying to search for information on the Internet in an organized manner. It is referred to by different names like web spider, bot, indexer etc. Anyway, that article got me thinking about building a web crawler. I just wanted to fiddle with it and see how much time it will take to get something working on my machine. It turned out to be quite easy!   Continue reading

Python Development In Eclipse

As your code gets bigger, effective code management becomes an integral part of your project. This post is about setting up Python development environment in Eclipse. Most of the Python developers will already be aware of this. For those of you who are not, read on. Eclipse is an IDE which supports many different languages. It has plugins for various different frameworks as well. We will discuss about how we can set up everything from scratch. Once you set everything up, you will be able to run and debug you Python code easily. It provides many different options and it has a nice UI too.   Continue reading

Operation Aurora

On January 14, 2010 McAfee Labs identified a zero-day vulnerability in Microsoft Internet Explorer that was used as an entry point for Operation Aurora to exploit Google and at least 20 other companies. Microsoft  issued a security bulletin and patch immediately. Operation Aurora was a coordinated attack which included a piece of computer code that exploits the Microsoft Internet Explorer vulnerability to gain access to computer systems. This exploit is then extended to download and activate malware within the systems. The attack, which was initiated stealthily when targeted users accessed a malicious web page, ultimately connected those computer systems to a remote server. Now this connection was used to steal company intellectual property and additionally gain access to user accounts. Why did the users visit the malicious web page? Likely because they believed it to be reputable. This attack became particularly famous because of the level of sophistication and the obfuscation methods used.   Continue reading

Exploring The Lesser Known Features Of Python – Part II

As it is evident from the title, this is the second part in the Python exploration series. You can find the first part here. I have discussed a few lesser known but very useful features of Python. There were too many features, so I didn’t put everything in a single blog post. I will continue discussing more features in this post. I will keep adding more as and when I discover more things about Python.   Continue reading

Exploring The Lesser Known Features Of Python – Part I

I have been fiddling with Python for some time now and I have to tell you, it just keeps getting better and better! Every time I interact with Python, I stumble across something new. There are so many things you can do with it. It is very well documented and most of the material is available out there. There are some of the lesser known features which are very useful, but you don’t see them often. There are quite a few and I have split it into two parts. You can find the second part here. I have listed the first few here:   Continue reading

Essential Python Tools: virtualenv and pip

A wise man once said ‘Necessity is the mother of invention’. But I think the real mother of invention is laziness. If you are lazy enough, you will find an easier way to do a particular thing. In order to solve large problems elegantly, we need to use tools that solve smaller sub-problems very well. To the coder in you, yes, it’s a bit like dynamic programming! If you have fiddled with Python, you would have definitely come across many different libraries and packages. Sometimes, you wish that you had different machines for different libraries because the requirements differ from one thing to another. There should be an easier way to manage different environments and packages right?   Continue reading

Python and CSV – Working With Excel Spreadsheets In Python

We are all familiar with Excel spreadsheets. They are used everywhere to make tables and keep track of stuff in general. Excel offers nice functionalities as well. When we are dealing with a huge number of entries, manipulating these values manually becomes tedious. Consider a situation where there are 1000 rows and 25 columns in a spreadsheet. You want to check the values in the 8th column of each row. Depending on those values, you want to manipulate the values in the 17th column of each row. Or perhaps we want to get all the rows with the same name together. If it were a few rows and columns, we could have done it manually. But doing this for 1000 rows is quite boring. So how do we do it?   Continue reading

Command Line Within Python

One of the cool things about Python is that you can do absolutely anything and everything with it. This blog post deals with using command line within Python. When you are writing your code in Python, you might want to access the command line to run a couple of commands like ls, grep, make etc. If it were a shell script, you could directly write that command and it will get executed as if you were on the command line. But shell scripting will only provide limited functionalities. So how do we do it in Python?   Continue reading