Katalist - Ready for alpha testing

Katalist - The new online social networking and collaboration tool is finally ready for an alpha testing - check it out here at www.katalist.co.cc

Note : If you reached this page from Katalist, leave your feedback as comments to this post.

Special thanks to everyone who helped me with this project.
To the God Almighty, for everything.
To Devaky, for being a constant support and encouragement, for the awesome pyjama parties, for pushing me to my fullest potential.
To Deepak, for the constant supply of ideas, for the inspiring designs, for being my best friend.
To Govind, for being a great team mate, for the wonderful contributions, for the all night coding sessions.
To Merin, for being a great team mate, for the several ideas, for the strong teas ;)
To Vishnu sir, whose inspiring wisdom and foresight helped us out at several tight spots.
To Shalini Ma'm, our project guide, for the guidance, for keeping us on schedule.
To our parents, for shelling out in times of need.
To Redbull, for keeping me awake, nights in a row.

This version of Katalist is just an alpha release to find out the improvements needed in the API. This is, by no means a test of the actual product. Your feedbacks and suggestions are welcome.

Note : If you reached this page from Katalist, leave your feedback as comments to this post.

Flex PHP Template Wrapper instead of default HTML Template Wrapper.

Flex PHP Template Wrapper instead of default HTML Template Wrapper.

Suppose, like me, you want to run your flex application as index.php instead of the default index.html - if you search around a bit, you'll find that you can change the index.template.html file to index.template.php and it will work - temporarily, but if your project is bigger, like mine, and have many applications, you will find that the only file you can launch is the index.mxml, everyone else will just refuse to show up.

Whats the proper way to do it, then ?

1. rename the index.template.html file in your html-template folder of your source to ${application}${build_suffix}.template.php

2. Right click any mxml applications you have in your project, and select Properties -> Run/Debug settings

3. Edit the required launch configuration

4. Set the url of the file to launch to index.php from the default index.html (incase of index.mxml, but you get the drift)

Congratulations, now you have a php template wrapper for multiple applications in your flex project.

suppressing output of a function in PHP. disabling echo just for a function in PHP

Have you ever had a situation where you had to call a function just to return its value without echoing anything ? May be disabling some errors or debugging messages ? I've been fiddling around with this for a while and I figured meddling with the Output Bugger might help.

function foo() {
echo "Flush!";
return true;
}

If you want to call foo() without echoing Flush! but you want $a to have the return value of foo().This is what you will do.

ob_start();
$a = foo();
ob_end_clean();

Just turn it on before you call your method that would output (not the function itself, but where you call it, you could wrap it around your whole script or the script flow, but you can make it as "tight" as possible by just wrapping it around the call of the method. For more information see http://php.net/outcontrol

Add a Focus Loop to Adobe Flex PopUpManager

This took me a whole frigging day to figure out.

In a project I created a custom PopUp, nothing big, just a custom component from the Group Class which will have some text inputs and a few buttons.

The Documentation about the IFocusManager states that a pop up will get its own FocusManager and its own tab loop. After some tracing I found that my pop up and its child weren’t included in the FocusManager as focus objects. In fact, there was no FocusManager for my pop up at all. The reason for this is that when the PopUpMangerImpl is about to create and configure the pop up, it checks if the pop up is a IFocusManagerContainer so that focus can be added. Unfortunately my popup was a Group which does not implement the IFocusManagerContainer interface. Naturally no FocusManager would be created. If you want to use a Spark Group as your pop up, the solution is to create a new class that extends from Group and implements the IFocusManagerContainer. Then use this class as the container for the pop up.

OR As a quick and dirty fix, you can just make your group container a "Skinnable Container" which implements IFocusManagerContainer automatically. Teh trade off here is that you will have the overhead of skinnable container in your project. 

au revoir 2010

2010 had been one of the most "happening" year of my life. I wouldn't say the best ever, but certainly the most happening.

One thing that I did, that I can be proud of myself any day, is www.wheelofhope.co.uk, A website I did for free, for a charitable institution taking care of destitute children in Kerala.

I brought my first ever bike, and I learned to ride one, which had been my ambition since I was a kid. I also had my first ever road accident where I had to go to a hospital to get patched up. ;)

Thanks to my few good friends, I started freelancing again, this time with better scope and profits.

I brought some things that I always wanted to buy but never did, because I wanted it to be from my own making, the list includes a business phone, a casual phone, a camera and several other nick-knacks.

I've had more online friends than in real life (loser ? oh yeah!) but it certainly is a great pleasure when you actually get to meet the people you've known for years in real life. I had that pleasure this year, twice!

I realized, money is only a very effective tool, but never a metaphor for happiness, and sad as it is, I learned it the hard way.

I met Mousey Manisha, who is undoubtedly and irrevocably my favorite blogger ever! And an aspiring web-designer, who inspired me to start/resume my blogging.

I've always wanted to do this personal project of mine for a long time, this year I finally got the chance to do it as my academic project. Its codenamed Katalist and will hopefully go live in about 4 months.

The most important thing that happened in my life this year? For the first time in my life I came face to face with the Lord, my God. Several times and several places, where I felt his grace, care and love, even when I knew I least deserved it.

BSNL Night-time, connect automatically using scheduler

If you have the BSNL or any other PPPoE connection that gives you free time, like from 2 AM to 8 AM as in BSNL and you want to schedule your heavy downloads for that time, read this post.

The key idea here is to schedule using Windows Task Scheduler or Scheduled Tasks according to the version of windows you are using.

First thing to do, create a dial-up connection named BSNL in "network connections", chances are that you already have one.  If you're using auto-connection where you get net if you just turn on the modem, you should configure your modem/router to connect via PAP. To do this, type in http://192.168.1.1 in the address bar of your favorite browser (this is in a default setup, if your router is located at a different IP, enter that). You will need to enter an username and password, this is generally "admin" "admin" but can vary with the kind of router you are using. This should take you to the configuration page of your router, where you will set WAN to use PAP instead of AUTO in PPPoE.

Next thing, create a batch file in System32 (I say, System32, you could do this anywhere you want) to do this, goto Start -> Run -> type in "cmd" without quotes and hit enter

Once you have your command prompt, navigate to System32, under a default windows installation, this is what you have to do type in "CD C:\WINDOWS\SYSTEM32\" Once you are in system32, do the following

COPY CON CONNECT.BAT
@ECHO OFF
RASDIAL BSNL USERNAME PASSWORD //Replace with your username and password
^Z  //CTRL+Z

You should type in the last line using CTRL+Z together don't literally type in ^Z. Now you made the connect.bat. Running this file should get you connected to the internet, you can test it by running connect.bat from command prompt.

Now open windows task scheduler and configure to run Connect.bat at 2:02 AM everyday.
Now using task-scheduler, you should also setup termination of connection and shutdown of machine at 8:00. You can do this either way, either you can simply disconnect the connection or shutdown the machine.

To disconnect the machine, setup a program to run at 7:58 every day. You could either run RASDIAL /DISCONNECT or to shutdown the machine, you can run SHUTDOWN.EXE /S /F /T 59

Hope that helped, if you still have any doubts, post it in the comments.

integrating facebook share or like with open graphics og tags on wordpress

There are a million different ways of adding a facebook share or like button to your wordpress site, there are plugins, there are tutorials, but those never works right.

What is the proper way of adding Facebook like button ?

More often that not, when you add the Facebook like button to your Wordpress website, the like button picks up the wrong content, the wrong image, and the wrong description and wrong link if you set it to work automatically, if you're a Wordpress developer who frequently uses premium themes like I do, there may be thumbnail images attached with the posts (sometimes you want the like button to display the first post in the page, in the home page, may be you want to display your logo) 

And if you've done enough research, you'd know that you should use the Open Graph Protocol og:tags, but og:tags works only in the header, may be the image you want to put up could be the generated within the loop, so how do you put an image that's in the loop ? Its simple, you create mulitple loops. Create a loop in the header (between the  tags) that will generate content for the meta data and then generate another one for your posts. Here's how I did it, if you're too lazy, you could copy my code.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" <?php language_attributes(); ?>>
<?php if (have_posts()):while(have_posts()):the_post();endwhile;endif;?>
<!-- Facebook Opengraph -->
<meta property="fb:app_id" content="your_app_id" />
<meta property="fb:admins" content="your_admin_id" />
<meta property="og:url" content="<?php the_permalink() ?>"/>
<?php if (is_single()) { ?>
<meta property="og:title" content="<?php single_post_title(''); ?>" />
<meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<?php echo wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) ?>" />
<?php } else { ?>
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:description" content="<?php bloginfo('description'); ?>" />
<meta property="og:type" content="website" />
<meta property="og:image" content="<?php bloginfo('template_url') ?>/path/to-your/logo.jpg" />
<?php } ?>