Tag Archives: Technical

10 Feb

Whats New-Google Buzz in Gmail Inbox, Mobile

This morn one more way of e-socializing introduced by google – Google Buzz.
It’s a one of the trending topic on twitter…

How to get Google buzz:

Well it’s being rolled out in phased manner directly to your Gmail, so if not now, your Gmail inbox should have this feature very soon.

To get Google Buzz:

  • Login into gmail.com.
  • Click on Buzz icon on left sidebar.  (Have you noticed it?)
  • Just like following & followers concept on Twitter and Facebook fanpages, Google Buzz will automatically display your following and followers Gmail users (They have considered people you email and chat the most).
  • So start buzzing then with Google Buzz. You can share photos in full resolution, watch inline videos without going to separate webpage.
  • You can also connect with activity on other website including: Flickr, Google Reader and Twitter. Whatever you do there will automatically buzzed up!!
  • Unlike email, Google Buzz is real time – any response made is delivered instantly to fire up the conversation and create buzz. Also, you can selectively follow few people and only see their updates. Bump into your Gmail account and test drive Google Buzz.
  • It is also available for mobile phone as well.
Seems like wave is not waving enough hence Google Buzzed!!!
Is it gonna kill tweeter and orkut!??
PS: I’m yet to receive Buzz in my Gmail!!
08 Feb

Stored procedure to add-remove prefix by rename table mysql

Here is one more procedure – (this time) for mass renaming of table. Adding and Removing table-name prefixes 🙂
A friend of mine was renaming 100+ tables by using replace methods in notepad.
I showed em a bit better editor: Editplus and then I thought of rescue rest of those who are still interested in some techie-solution to such things.

This procedure is outcome of that try and its as usual very simple one with two functionalities:

  • rename mysql table of a database by adding prefix
  • rename mysql table of a database by removing prefix
So below mysql stored procedure just not renames to add but also removes prefixes from table names.
Download the Procedure: prefix_all

How to use:
1. Execute / Create Stored procedure by downloading or copy pasting sql script.
2. Execute: call prefix_all(‘DATABASE-NAME’,’PREFIX’,0);
Where 0 will remove the prefix from mysql table name, while 1 will add prefix.
Code:
DELIMITER $$

DROP PROCEDURE IF EXISTS `prefix_all` $$
CREATE PROCEDURE `prefix_all` (in_db varchar(20),in_prefix varchar(10),in_add_rem TINYINT(1))
BEGIN

DECLARE done INT default 0;
DECLARE tbl_nm VARCHAR(30);
DECLARE ren VARCHAR(200);

DECLARE table_cur CURSOR FOR select table_name from information_schema.tables where table_schema=in_db;

DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;
OPEN table_cur;
  rename_loop:LOOP
    FETCH table_cur INTO tbl_nm;
    IF done=1 THEN
      LEAVE rename_loop;
    END IF;
    if in_add_rem=1 then #ADD
      SET @ren = concat("rename table ", in_db,'.',tbl_nm ," to ",in_db,'.',in_prefix,tbl_nm,";");
    else
      set @ren= concat("rename table ", in_db,'.',tbl_nm ," to ",in_db,'.',right(tbl_nm,length(tbl_nm)-length(in_prefix)),';');
    end if;
#    select @ren;
    prepare ren from @ren;
    execute ren;
  END LOOP;
CLOSE table_cur;
select table_name 'Tables' from information_schema.tables where table_schema=in_db;

END $$

DELIMITER ;
08 Feb

Oracle query-eliminate duplicate but one using rowid

Yesterday a friend came across an oracle query problem:

Consider below table:

cid cname.... cdata
1 x xxxx
1 x xxxx ..
2 xzzz fjnd
3 a evddd

Now the problem was cid is repeated and cdata column is having some extra characters but data is considered same (eg. xxxx & xxxx..).
so when he does
SELECT cid,cname....cdata FROM TABLENAME ....;

He kept on getting duplicated records which intern he wanted to have only one per duplicated cid.
It’s not by the way of table structure but by the way of query he wanted to have results.

I suggested him:
SELECT cid,cname....cdata FROM TABLENAME GROUP BY cid;

As far as I know this works with MySQL, but it gave error as I came to know that I have to include all SELECTed variables in GROUP BY clause.
This is Oracle 🙂

Well later I came back to my place and recollected something called ROWID of Oracle, may be that can help!!

Then I created similar table in MySQL to “stimulate” Oracle rowID:

rowId cid cname .... cdata
1 1 x xxxx
2 1 x xxxx ..
3 2 xzzz fjnd
4 3 a evddd

And finally I got the solution as:

select cid,cname….cdata from tablename where rowID in (select min(rowID) from tablename group by cid);

So finally I decided to give it a try on Oracle and it worked 🙂

select * from TABLENAME WHERE rowid in (select min(rowid) from TABLENAME group by DUPLICATECOLUMN);

08 Jan

My Google Exploitation – Web History Graphs 2009

Well no doubt I’m a google freak. I’ve learnt a lot through it and I have searched a lot.
But I wasn’t much aware about my intencity of googling stuffs.
I hope you know there is something called Web History.

In case you’re unaware: www.google.com/history/

Google Web History includes:
– View and search details across webpages you’ve visited in the past
– trends on your web activity, such as your most visited sites and top searches
– Search strings and your visited sites
– Google Web History do allow you to notice unusual web activities (incase intruder is not smart enough) you may change your password.

Well now let me show you my Google Search activities / statistics in year 2009.

Daily search activity:

daily-search-activity

Monthly search activity:

daily-search-activity

Hourly search activity:

daily-search-activity

Ofcourse you should be logged in while googling and you should have your google history enabled to get this graphs.

Am I exploiting google too much?

I didn’t know many things I searched for, but I know them now 🙂
My love for Google shall sustain forever…
Hoping to break these limits in 2010 !!


-- Kedar Vaijanapurkar --