Adding Mongo DB driver to XAMPP

Like many developers I use XAMPP for PHP development. But adding PHP extensions in xampp to does not seem to have a direct procedure . So when I wanted mongodb drivers I was on my own to figure out how to get it working . Here is the knowledge I gained .

I am using Ubuntu oneiric ocelot machine so this procedure is similar for all *NIX machines  (Sorry windows users but the procedure must similar).

  1. First download and install Mongo db from mongodb.org/downloads
  2. Secondly download the PHP MongoDB driver source from github.com/mongodb/mongo-php-driver
  3. Now to compile the code
    1. You need phpize to compile the source code, so install php5-devpackage by running `sudo apt-get install php5-dev`
    2. Navigate into the mongo-php-driver directory and run `phpize` on the terminal
    3. Then run `./configure` to check for dependencies
    4. Run `make` to build the package
  4. Assuming XAMPP is installed at `/opt/lampp/` copy `mongo.so` and `mongo.la` from `modules` directory inside mongo-php-driver directory to `/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/` directory
  5. Add the line `extension=mongo.so` to  `/opt/lampp/etc/php.ini`
  6. Start mongodb and xampp servers and run the program test program from php.net/manual/en/mongo.tutorial.php to check if it is working

 


An Easter Egg in Google Search

An easter egg has been found in Google search . It was about time that google did something interesting with google search , which even after the recent redesign wasn’t very interesting, But still the minimal look is what we all love about google search .

What is an easter egg anyway , well Wikipedia defines it as

A virtual Easter egg is an intentional hidden message, in-joke or feature in a work such as a computer program, web page, video game, movie, book or crossword.

What it means is that easter egg is just a simple trivial feature that in placed by the creators of the software product to lighten things up .

So now back to google’s easter egg, Imagine Google doing a Barrel roll well you can literally ask google to do it by typing Do a barrel rollin the search box , the same effect can also be triggered by typing “z or r twice” .

Then try imagining google having a slight tilt , well neither could I , but you can still see it by searching for tilt or askew” .

These effects seem to be working in the recent versions of all  major browsers .

I have made a video of all the effects take a look


How to Create a Twitter Like Retweet Links

Twitter is one of the most visited social networking sites , and one of the factors in their success is the intuitiveness of  the user interface .

In this tutorial We are going to learn how to create a twitter like mouse over effect for retweet , favorite links

Twitter mouse over effect

To achieve this effect we are going to be using HTML, CSS and jQuery .

First the HTML :

<body></pre>
<div class="<span class=">TweetContainer"></div>
<pre>
        		<div class="Tweet">
        			<span class="TweetAuthor">
        				<p><strong>JamesBond007</strong>:-</p>
        			</span>
        			<span class="TweetText">
        				I am #Bond, #James Bond ! @JamesBond007
        			</span>
        		</div></pre>
<div class="<span class=">TweetActions"></div>
<pre>

        			<em>Favorite</em>&nbsp;
        			&perp;
        			<em>Retweet</em>&nbsp;
        		</div>
        	</div>
</body>

We create a Container DIV and 2 separate DIVs one for the Tweet and another for the TweetActions. The actual Tweet content is put inside the Tweet DIV and TweetActions contains Favorite and ReTweet .

Next The Styling

<style>
                	.TweetContainer
                	{
                		margin: 15 auto;
                		width: 500px;
                		height: 70px;
                		background: #C7EEFE;
                		padding: 30px;
                		border-radius: 15px;
                		font-family:  Arial,sans-serif
                		border-color: #B7EEFE;
                		border-width:medium;
                	}
                	.TweetActions
                	{
                		position: relative;
                		left: 300px;
                		cursor: pointer
                	}
</style>

And now comes the jQuery Code

                <script>
                        $(document).ready(function(){
                        	//Hide the Favorite and Retweet Buttons
                        	$('.TweetContainer').find('.TweetActions').hide();
                        	//Trigger the Mouse over action
                        	$('.TweetContainer').mouseenter(function(){
                        		/*
                        		 * Show the Retweet and Favorite buttons for the Current
                        		 * Tweet
                        		*/
                        		$(this).find('.TweetActions').show();
                        		//Highlight the Current Tweet by changing the background Color
                        		$(this).css({
                        			'background':'#C7FFFE',
                        		});
                        	});

                        	//Trigger the mouse leave action
                        	$('.TweetContainer').mouseleave(function(){
                        		/*
                        		 * Hide the Retweet and Favorite buttons for the Current
                        		 * Tweet
                        		 */
                        		$(this).find('.TweetActions').hide();
                        		//Change the background color of the Current Tweet to normal
                        		$(this).css({
                        			'background':'#C7EEFE',
                        		});
                        	});
                        });
                </script>

Putting it all together we get

Live DEMO

To get the full Source code just save the Demo Page as html and open it with a text editor .

As always comments and Suggestions are welcome .
Please Post your comments below


Gmail Preview Pane

Gmail wasn’t the first web mail interface that I used but it is certainly the best I have ever used. The best web mail interface just got better with a new feature called Preview Pane , which provides a twitter like view for you Gmail page , and greatly improves your productivity .

This feature can be enabled from gmail Labs .

Via : Gmail Blog


Transparency Reports from Google

Here is another  reason why google is so brilliant , its because Google is socially and ethically responsible .

Google has added reports about Government requests to remove content from Google’s services like Youtube or Blogger .

They have also added a Traffic Analysis tool to show traffic activity from different Countries .

Its Good that Internet Giant is doing the right thing by supporting transparency , which is the first step towards to eradicating all under the table activities and Internet Censorship

From : http://www.google.com/transparencyreport/ and India – Google Transparency Report http://bit.ly/klwaaR

So as always Please post your comments and suggestions .


A few Fun Wallpapers For you Linux Desktop

Here are a Few of My Favourite Linux Wallpapers :

  1. Photobucket
  2. Photobucket
  3. Photobucket
  4. Photobucket
  5. Photobucket
  6. Photobucket
  7. Photobucket
  8. Photobucket
  9. Photobucket
  10. Photobucket

Serving Servlets !

When staring web developement now a days many people  start with PHP , Ruby on Rails , or something like that , but there was a Time when Servlets were King .

Servlets are still very Prominent and are also very powerful, and sometimes better than any other web development platform.

To get started with servlets using just Tomcat is very easy , but using Eclipse along with it Required a small bit of effort .

I spent 20 minutes on learning how to configure Eclipse to work with Tomcat 7

So here is a Tutorial for the same .

So Lets get Started…..

The Downloads

2 Things have to be downloaded

  1.  Eclipse IDE for Java EE Developers
  2. Apache Tomcat 7

The Process

I am writing this tutorial for Linux but the concept is the same for Windows and Mac .

After Downloading

Extract Eclipse and tomcat into a folder

After Extracting Eclipse ,

Run Eclipse

open Window->Preferences 

Choose Server->Runtime Environments

Click Add 

Choose Apache Tomcat v7.0

Click Next

Choose the location where Tomcat was extracted 

Click Finish

Now the Server has been successfully added .

The Project

Create a new Dynamic Web Project

After Creating the project

Right click on the project  select New->Servlet

Now you can create your Servlet and run it in eclipse with Tomcat ,  so what are you waiting for  get coding!!


Firing up Ubuntu with the 4th Fox

Firefox 4 (stable) was released yesterday (March 22 , 2011), So I decided to write an article on how to install firefox 4 on Ubuntu the easy way.

Now if you goto mozilla.com to download the latest version on linux you prompted to download a file called  firefox-4.0.tar.bz2

but many people don’t know how install this file , well the easier method is to download the latest version from Firefox stable PPA

but before you do this make sure to uninstall any beta versions.

Open terminal and type the following commands
First thing to do is add the Firefox stable PPA

sudo add-apt-repository ppa:mozillateam/firefox-stable

then before we can install firefox we need to update the PPA

sudo apt-get update

Finally we can install Firefox

sudo apt-get install firefox

And thats it , firefox will now download and install itself , Simple and Easy !


FLEX ible Builder !

I recently attended a 2 Symposiums at some colleges whose name I don’t want to mention, I was a participant in Web Designing Competition in both . In the first one , I really did not plan , I just made a mash up with jQuery , but in the Second one, I put some effort into planning and I designed a really cool website with jQuery UI , I deserved  at least a 2nd  prize , but my tough luck would have it , I didn’t win anything !

I noticed then winners of both the competitions were students who created something very basic with Flash , My creating was comparatively complex and had more features , but Students who did Flash got real preference.

I set out to Solve this , I Applied to the program that adobe was offering Flex Builder 4 for free to students ,and I got a reply with a free serial Key .

AdobeEmail

Then I set out to Learn Flash under flex SDK 4.1.

This was a bit more difficult than I Thought , but I Finally managed to Understand MxML and Action Script .

Armed with this Knowledge I made a Simple Calculator (http://j.mp/ewBMmM )

UseLessCalc1

Being a guy who Likes Open Source stuff , I have made the source code available for free.

Just Right Click  –> View Source

Calc3

In view source mode you get to see the source code and also to download a Zip version .

A nice Feature that is easily built with Flex Builder .

image

I was surprised to Learn How simple Action Script really is .

Action Script ,JavaScript ,Java , C++ … all these languages are like cousins , You Know one , the other is really similar .

MxML on the other hand is pure XML , but its very easy with Autocomplete Enabled.

So the First Step of My Flash Learning Process is officially complete.

Now I can officially add this to my Resume` .


The new and redesigned WebApplinkPage

WebAppLinks 

image