Google Plus Project Invites

I’ll keep this post short and straight!

If you are one of those who are still not allowed to use Google+ Project, then you can use following method to get/send an invite:

If  ’A‘ is a guy already using Google+ and ‘B‘ who wants to use Google+, then:

  1. Ask A to add B as a Gtalk contact.
  2. Ask A to create a new circle and add B as a contact in that circle.
  3. Then, A should update a status message in his stream marked to the newly created circle with B as a contact in it (as you do on Facebook using lock icon for lists).
  4. After the message has been posted, the B will receive an email which acts as an invitation email.
  5. That’s it! Enjoy!

This method worked for me. Let me know if it works for you as well or not.

Google+ Screens

Lately, Google released Google+ Project. Sadly, I wasn’t allowed to access Google+ Why? Cause, I am banned from Google Labs.. Reason? My account is marked malicious!

Today, @karansinghmagic sent me an invite :) and I got in! At first glance it felt much better than Facebook, at least visually!

Now for all who want a sneek peak of what Google+ Project looks like, I present following screens. So Enjoy!

Validating URLs

How many times have you struggled with URL validations? I have struggled a lot. Damn, those stupid regex(s). Well regex as a tech is not stupid, it’s awesome. but when u have a 10,000 regex expressions to choose from? and on the top of that every regex gives different result.

When I faced this challenge, I tested more than 80+ regex expressions, obviously not in a day :P . Then had to settle with a regex which had a least probability of producing -ve results.

Obviously as a programmer, I wanted better alternative. And I stumbled upon PHP filters. Well, it can be used for other things than validation as well such as sanitization, etc.

Why I would like to use filter_var instead of my or anybody else’s regex. Simply because, regex used in filter_Var are well tested and produce far less -ves. Moreover, being a native function, it produces results faster.

As far as my Codeigniter Application is concerned, I have extended the Validation library:


class MY_form_validation extends CI_form_validation {
function valid_url($str){
if(filter_var($str, FILTER_VALIDATE_URL)){
return TRUE;
}
else{
return FALSE;
}
}
}

Now all i have to do is:


$this->form_validation->set_rules('field_name', 'field_label', 'valid_url');

And I am all set *grins*.

Second view towards life!

Why do people tour? Especially on motorcycles?

So it’s time for my next road trip. Yay! It’s been several months since my last trip. Gosh! That was one hell of a trip. Thrilled? Hell yeah! This is much better than the weed I smoked this Friday. The only thing that is irritating me right now is the flu. I hope it gets cured before Thursday.

Coming back to the question. If you ask me, I have no f’ing clue! Though I heard it somewhere that people take up motorcycling because they lost their War of Love. Some say, cause they want to see the world. Seriously? People have their own perception about the things, I won’t be judgmental.

I do it cause, When I am on my bike, I am me. I like the smell of raw nature, that aroma which fills your lungs when you pass through a valley. Those endless roads and that sense of uncertainty.

Plus, It’s the freedom you have, you feel. No worries about work, about people. You don’t have to please anyone. You don’t have to fake your smile. You don’t have to hide!

Imagine yourself standing at the edge of a cliff 10,000 feet above sea level. You can scream your heart out and no one will question you :)

and, for those who couldn’t make out anything from above written text. Well, who cares!

Mating Processingjs and JQuery

In my latest weekend project, I wanted to integrate jquery with processingjs. The way processingjs is developed, it’s requires a little trick to fire up processingjs at will. Though after much struggling I came up with following.


$(document).ready(function() {

dom_el = $("#canvas").get(0);

code = ''; /* fetch source string using ajax or hard code it */

stage.set_stage(function() {
stage_instance = new Processing(dom_el, code);
});
}

Code is pretty much self explanatory. The real essence is the Processing() constructor. It takes two arguments viz: Canvas DOM element and the source code string.

You can always fetch source code from a file using $.ajax(). I am using $.get();

Visual Music

Lately, I have been playing around with soundcloud and soundmanager. I always wanted to create an web based music player. Only restriction was that streaming api was not available. Anyways, Soundlcloud’s api seems pretty interesting. I also tried myspace.com and last.fm apis, though i didn’t explored them much.

I am using Anton Lindqvist‘s soundcloud api wrapper along with soundmanager which happens to be the best api wrapper I was able to find for soundcloud so far.

soundcloud + soundmanager = free music 24x7!

I wanted to take to the next level. I wanted to add visualization to it. I still remember when winamp was released, it took world by a storm. It’s visualizations played an important role in it’s success.

And since, most of browsers now support html5 canvas. Then why not create a visualizer! I immediately started looking for canvas frameworks. Found a lot of them, but then decided to use processingjs. I am still playing around with processing. So, currently I don’t anything to show. Though I was able to make a ball bounce here and there based on DSP data. Will try to share some of the source code soon!

It’s a weekend project therefore, won’t be able to devote much time on it. And, since my last attempt to roll out a working product got stalled royally, I have decided to go slow with this one.

Looking Back

So, Yesterday I was trying to clean up the F: on my computer’s primary hdd. I was hunting for files which i didn’t even open for more than 5 years. I was about to press shift + del then just stopped. I thought, let me see the files before deleting them. Later, I thanked my instincts for not letting me pressing the keys.

I remembered how I used to sit for hours with a piece of C++ source code and try to figure out how to solve this freaking problem. I was quite surprised seeing the C++ code. I was in ninth grade and was doing system’s programming. I also found out a portable BOCHS installation configured to run as i386.

I also found out a 16 bit MS executable. I fired it up, ended up with a subsystem error! no worries though, I have MS 98 on VirtualBox. I fired it up again. found out that I was actually trying to clone Duck Hunt :D . There were couple of more MS executables.. hangman.exe, mosquito_repeller.exe, key_logger.exe etc.

I did upload some of the code on planet-source-code.com. well, those were days too.

As far as cleaning is concerned, I have moved all my data to Dump Folder.

Semantic Experiment

With social media growing like hell, There’s a wealth of information available over Internet. Be it a company, or a brand or even me for that matter, everybody is talking about everyone.

Put simply,

If you exist in the ‘real’ world, I am talking about you!

Well, this post is not about Social Media or it’s impact or whatever. I am a programmer for god’s sake! It’s about what you can do about this information and how to analyze it and an approach I would be using. Seems Interesting, eh? Yeah it is, but you see, now arises a problem!

The Problem

It’s information out there not just data, you Moron! :D If you want to get some knowledge, you have to work on information. Remember classic (data -> information -> knowledge) rule! It applies here.

Short answer: Take advantage of others and use their system to do the tough part on your behalf. There are a lots of systems that are available online for use. For eg. you can use OpenCalais to semantically analyse information to get knowledge. And/or you can use systems like Social Mention to get the popularity index for a ‘Information’.

Solution

I am currently working on a system which does this kind of processing and the system is working perfectly so far. I can’t give out techs or specs about it. Yeah, I could land up behind bars for doing that! :P

I am still working on it and discovering a lot of things everyday. I’ll post hows and whats of it when I am done building it.

Codeigniter 2.0

So finally Codeigniter 2.0 is here. With 2.0 a lot has changed. Primarily, Ellislab split up CI into two branches, Reactor and Core.

As they say,

CodeIgniter Core
Core is a slow-moving branch that will be used as the base for EllisLab commercial products such as ExpressionEngine and MojoMotor. It will continue at a similar pace that CodeIgniter has in the past and will be useful for large commercial applications that require the upmost in stability and backward/forward compatibility at a pace more typical of SLA backed Enterprise products. Core is publicly available with tagged downloads at BitBucket.

CodeIgniter Reactor
Reactor is a community driven branch of CodeIgniter that will enable faster adoption of the best community submitted code to the framework. This means the community can create a fork of the project on BitBucket and contribute bug fixes, new features, documentation improvements, etc and have it reviewed by a code-review team called Reactor Engineers. These Engineers are primarily responsible for driving the development of the framework.

In simple words, Reactor will be managed by community + Ellislab and Core will be managed solely by Ellislab.

Some interesting things I liked,

  • Support for PHP 4.x is gone
  • Application Folder now sits outside System folder
  • CLI support (I am still trying to figure it out)
  • Full Query String support
  • memcache and APC support

Also, Ellislab has changed the file structure a lot. Check out change log to know more.

In all, new version seems interesting. Though moving 1.7.x apps to 2.x is not easy. Since, Plugins have been deprecated, you will need to convert plugins either into libraries or helpers. Also, some of the libraries may not work with 2.x.

The only thing that is making me doubtful is why CI has been split up into 2 branches? Is Ellislab trying to make money by creating an Enterprise version? I hope they don’t.

Encounter with Deities

Recently I had to visit a temple courtesy my mother. I am an atheist so temples, deities don’t excite me and I can’t understand their purpose.

Anyways, I was asked (forced to be precise) by my mother to go and get some sort of ribbon tied around my neck. So I went. It was quiet an experience. I had to get up early in the morning (6 AM). I obviously couldn’t get up on time. I woke up at 7:30 AM. though I managed to get ready on time. I was more excited because if the fact that I’ll be riding my bike on a chilly winter morning.

Quickly, I realized  that there was no fuel in the tank. Damn.. I had to rush to nearby gas station. Soon, I was blazing through morning traffic at 117+ kmph. My brother was with me too. He caught cold :)

Anyways, we reached. Went to the priest, asked him to do his stuff. but to my surprise, he asked us for 2.5 kgs of grains with Rs. 51 as daskhina. Which I naturally didn’t know. So I asked him what can be done now? He Replied, “Alright, then give Rs. 250 and Rs 51 as Dakshina”. Only words that came out of my mouth were “What the Fuck?”. He couldn’t understand. I was pissed. So I decided to get grains from somewhere. And to my luck, I was able to find out one Ration shop. I bought some rice for Rs. 50.

Total Money got out my pocket, Rs. 101. And the string that he gave is still hanging around my neck. The only thing I liked about it is that it’s black in color :) and my mom is happy.

Though I am still thinking, If he’s a priest then why did he ask me for money? I mean, I can do it to. All it takes is one black string and two hands – A business opportunity? maybe!

ohh BTW, If you are thinking which temple I went to? It’s the one opposite to Pragati Maidan, New Delhi.