Wednesday, November 4, 2009

MailBox Support? Forgot Password?

Hey Guys..
Here's the story.. We all create mailbox on different servers depending about our social network n compatibility. But lemme tell you one thing today their support is rely crappy. I know they should be secure enough to protect your mailbox from being attacked by hackers and in this case spams I must say. But then what if I did forget my password and secret question and this was my 1st mail box so the alternate mailbox is out of question. Yes this is what has happened with my Yahoo mailbox. Some of us have a habit of creating mailbox with same name on different servers so do I and hence its getting on my nerves since I can't access the mailbox. I am even ready to pay for the services or the mailbox. I have tried enough since long and finally thought to vent out my feeling on this public portal. I would be glad if some1 does make a note of this and device some better way of maintaining the Mailboxes.

Saturday, July 18, 2009

SQL Tips : II (SHA 256 Encryption in SQL Server2000)

Heloo Every1,
This time it's encryption I dealt with. There are a lot of encryption Gurus and many forums full of algorithms. The only issue is none of them gave me a full implementation which is the most essential thing. Well I did implement the SHA 256 hashing algorithm in SQL server 2000 using extended stored procedure and in SQL server 2008 using assembly. I will explain you in detail what issues I did face and how did I overcome them.
First I will tell you how did I implement the hashing algorithm in SQL server 2000. I used the xp_hash_sha.dll which you can get from this link xp_hash_sha
Place this .dll file in you MSSQL/Binn folder. Now all you have to do is to register the .dll and create an extended stored procedure that can exploit the .dll file.
You can create a extended stored procedure using the following script.

USE [master]
SET NOCOUNT ON
GO
DECLARE @binn NVARCHAR(2000)
SELECT @binn = ''
CREATE TABLE #Temp(path NVARCHAR(2000))
INSERT INTO #Temp(path)
VALUES (@binn)
GO
IF EXISTS
(
SELECT *
FROM DBO.SYSOBJECTS
WHERE [ID] = OBJECT_ID('dbo.xp_hash_sha')
AND OBJECTPROPERTY(ID, N'IsExtendedProc') = 1
)
DROP PROCEDURE dbo.xp_hash_sha
GO
DECLARE @binn NVARCHAR(2000)
SELECT TOP 1 @binn = path + N'xp_hash_sha.dll'
FROM #Temp
EXEC dbo.sp_addextendedproc N'xp_hash_sha', @binn
GO



Now your extended stored procedure is ready. Now all you need to do is to create a function which can call the extended stored procedure.The procedure returns a varbinary and therefore the function must also have the same parameters.You can create the function using the below mentioned script

USE [master]
SET NOCOUNT ON
GO

IF EXISTS
(
SELECT *
FROM dbo.SYSOBJECTS
WHERE [ID] = OBJECT_ID(N'dbo.fn_hash_sha')
AND xtype IN (N'FN', N'IF', N'TF')
)
DROP FUNCTION dbo.fn_hash_sha
GO
CREATE FUNCTION dbo.fn_hash_sha (@plaintext VARBINARY(8000),
@bits INT)
RETURNS VARBINARY(64)
AS
BEGIN
DECLARE @hashcode VARBINARY(64)
EXEC dbo.xp_hash_sha @plaintext, @hashcode OUTPUT, @bits
RETURN @hashcode
END
GO



The problem it seems is solved but trust me here was the place where I was stuck. Actually the result is returned a varbinary where as the column of the table which I had to populate using this encryption was varchar. Now if I stored this result and tried to cast it to a varchar the output was really messy and totally undesired. To fix this I created one more function which did exactly what I wanted. Below mentioned script shows how to create the function.


IF EXISTS
(
SELECT *
FROM dbo.SYSOBJECTS
WHERE [ID] = OBJECT_ID(N'dbo.fn_plain_sha')
AND xtype IN (N'FN', N'IF', N'TF')
)
DROP FUNCTION dbo.fn_plain_sha
GO

create FUNCTION dbo.fn_plain_sha (@input VARchar(15))
RETURNS VARchar(75)
AS
BEGIN
DECLARE @t VARBINARY(75)
DECLARE @output VARchar(75)
set @t = master.dbo.fn_hash_sha (convert(varbinary,@input),256)
set @output= master.dbo.fn_varbintohexstr (@t)
RETURN upper (substring(@output,3,75))
END

GO



Here you see I hard coded 256 because I needed a sha 256. Also the first two characters '0X' was undesired so substring was taken. This functioned was used by me explicitly while populating the encrypted column in the required table.

Hope this documentation makes sense and helps a lot of people. Will update the process I used in SQL server 2008 shortly.

Note: The xp_hash_sha.dll is created by Michael Coles. You can also download the whole script for instatllation and unistallation of the .dll SHA.zip



References: http://www.sqlservercentral.com/articles/Administration/sql2000dbatoolkitpart4/2364/

Friday, July 17, 2009

SQL Tips : I

Image1



Image2





Heloo Evry1,
It's been sometime now I have been working on SQL Server and found somethings that are odd and some rely cool things about it. Though there is still an infinite left to learn I'm sure, I have some tips and tricks which were a hellava use to me. So thought of jotting them down.
Lets start with some thing very small and usefull. Many of you may have observed that the sql server 2000 is buggy in showing the dependency of the objects.
It is very irksome in SQL2000 Query Analyzer to find the dependency of the tables on different objects. Reason being most of the time the result is incomplete.
It’s just a matter of few moments now and after that you will be able to find dependencies of any kind of object be it a stored procedure, table or sql jobs.
NOTE: these queries are only limited to sql server 2000
We will utilize few systables for that purpose syscomments , sysobjects , sysjobs and sysjobsteps. You will need DBA rights to access these tables.



First let me show you how a dependency of a table is shown in the Query Analyzer in SQL 2000 GUI. Here we find the dependency of the table tv_family as shown in Image1.
Here 5 dependencies are shown which is incomplete. Now we will use the systables to find the actual dependencies of the table.
The Image2 mentions the query and the correct dependency.Here we see there are 161 objects of different types dependent on the table where as the GUI showed only 5.
Now let me give you a small brief as to how this simple query does this magic.
The systable sysobjects contains all the kind of objects created in the database concerned. They have a unique id now syscomments consist of text field which contains the whole script in case of a Stored procedure, Function, etc.. Now as the query suggests we essentially hunt for the text ‘tv_family’ in the join and extract the names of all the sysobjects and then order by as per our needs.

The above shown is a very generic query to find any object using a like query so you may get additional objects names than the name you are searching for.

Note: to be continued...

Friday, July 10, 2009

Chrome OS a causal Effect of Bing???



Look @ Future Of Desktops

 
So here is Google with it's Chrome OS as a more of Web User friendly OS. An expected but too quick a response to MS Bing. Or may I interpret it the other way round. Did MS knew about the OS launch and advance the release Bing. Well MS has done that a lot times nothing new about it. Whatever be the reason I'm really looking forward for the Chrome OS. Though I know it will be long before people accept changes, but we should not forget that before Google came up with the Search Engine none thought of it as a good field to invest resource and money. Thank God that Larry and Sergey didn't think of it this way. Where would we be without Google as we are today.
 
So now lets have a deep look what is Google promising in the new OS. Well it is a OS restructured around Linux and is for the people who spend most of their computing time on Web. It may be a hidden indication that much of development work which is based on MS platform will not be available and is quite understood. Well the Snapshots on the Header gives a look which not very far from present flavours of Linux available. The tough battle is not to give an amalgamation of existing OS but to make it run on the existing hardwares. Existing Linuxes available are still not able to run the desktops with existing hardwares. Trust me there are sleepless nights between installing and working on a Linux OS. Some of the variations have made commendable progress but still the job is not done as neatly as MS.
 
To be frank MS is prevalent only in developing countries, where civilians are computer literate in the manner that they how to switch it on and off and write a few docs and play games or surf on net. People get agitated when they bring a new hardware attach it to their comp and it doesn't get automatically installed. People don't have the literacy to install a driver on their own. They call up the support guy only to get a reply that they do not make drivers for open source. So people stick to MS where all they have to do is attach a device and start using it instantly. This has not been possible for MS also in a day it's been couple of decades and everyday a new patch is there to install. Bottom line is Google has to struggle a lot to impress people to use it's OS. But trust me proprietary race in the field of Software started by MicroSoft is going to end sooner or Later.
 
Well lets just wait and watch who wins the battle but 1 thing is for sure whatever happens it's the end user who will reap the benefit of a better OS. Keep Googling!!!

http://www.thinkgos.com/gos/download.htm

Tuesday, June 16, 2009

Bing : Does it make a Ring???


Well MS propitiatory search engine Bing is just an answer to the search monopoly Google has shared now for more than a decade. The front-end is innovative in the sense that it has a image in the background making it colorful however i did not personally find the image as impressive idea to attract people.

The successor to Live Search, Windows Live Search and MSN Search i.e. Bing is more of a Google flavour. It has technically same facilities on the home page as Google only difference is that it seems more like a Desktop Search.

However it has some Really Stunning and Market Capturing features which makes it Outstand Google. It's the intelligent use of Snippets and trust me its not at all irritating as is expected from a snippet. In fact it might be really helpful in our era of internet where most of the search result is just unrequired dump materials.

Well Google has nothing to fear I suppose as a decade of faith it has generated in people wont get washed away only by the use of a Snippet. MS has to work hard to get on board with Google on search battle. As the news is Google is to come up with a totally new Front-end called Google Wave, consiting of Mail, News and Chating on the same page. Let's see what the Future Searching would look like.

Regards,
Tushar Kanti

Wednesday, May 27, 2009

My Story Of "0 && 1" part 2

Sometime soon in 2nd year there was a Tech-Fest in IIT-G. We started preparing for the Fest. I got two Geared DC motors arranged from Delhi by my Best Friend ‘KID ’. We started making a Robot for "Maze-Finder" an Autonomous Robotics Competition in Tech-Fest IIT-G.
It was this time that I came to know so much about me. I had a tremendous amount of Energy to pull. We worked like hell for the Tech-Fest in IIT-G. We made the 1st DC robot(Chotu) of our life. Well let's say we just finished the mechanical part. Tuning and testing it was hell of a job. Along parallel tracks we also made a bot on Steppers(Guddu). Well Chotu was rely fast and tough to control. We used time delay to control its motion, only to realise that the distance varied after a period of time. We realised that the distance was not only dependent on time well a lot of it depended on the Potential too. So then started designing an optical encoder for its motion. Well it took us a lot of time to realize that making optical encoders was really a hectic job and the results were not worth a try given a situation of rely Limited Resources and no Legacy. Well Chotu was our 1st and Last attempt of makin robots on DC. We switched on to steppers which moved on a totally different funda. Guddu was moving really fine the only Issue was it power source. It sucked every time, we tried NiCd, NiMh, Alkaline and all sorts of batteries available or what we could visibly see available. Well finally we got those 9 volt batteries it sucked too but Fresh 1's were ok. So Finally the day we were about to leave Guddu was following the walls. We had confidence but little did we know what Fate had for us. Well had a truely amazing experience goin to Guwahati. The campus looked more like Fun place for the shades it had. But as we entered the campus area with the Buzz all around blood started to pump heavily in our veins. Well we went straight to our arena, it looked much similar to what we had expected. So that was a sigh of relief. A lot of intelligence still had to be embedded in Guddu. So we sat down jotting down all the possibilities of moves and then Porting it to a C program on a small UC. (Oh I almost forgot that we had a lot of Issues using 8051 so we switched to AtMega48. Surprised!! ya I too was when I came to know that this was available in India. Well i tried a few contacts on the list and a rely Humble Guy "Mr.Prakash" from bangalore helped me by shipping these Uc's to my place.) Well we finished as much as we could think of and then went back to arena. The next day was rely hectic we tested Guddu on the maze whole day around with extened power source. The algo seemed perfect in all senarios. We went back and I looked into other events which were more crowd pulling. The next day we were having our Slot but we wanted to take a later day slot when the sun's ambient light affected the IR sensors the least. So it all happened hardly a few could finish the maze, some had mechanical problem sm had sensors issues some had a bad algorithm. Well we were in the last slot. There was a break and we decided to fine tune Guddu's sensors before we had the final run. As we put Guddu in the maze we realised that it's battery had dried out. Well we had a spare but that was not fresh . Well we really started to panic. We didnt have any other power source to run our bot. We started inquiring about near by markets but it was rely late for that. Our turn was commin close. Suddenly Raja(technically Amarendra), one of our team members ,struck with the brilliant Idea to use our laptop batteries to run the bot. Well the Idea rely "CHANGED OUR LIFE". Guddu cleared the maze breaking all previous records and we stood 1st at the score of 1362 while the runners up were in couple of 100's . We were overjoyed with the Success. We called our homes at 5 in the morining and informed all our friends. Well the news spread like fire. And before we realised we like RockStar's in Colg. We were like Robotics Guru's of Colg.


Tushar.

Saturday, January 24, 2009

My Story Of "0 && 1" part 1

Heloo Every1,
I have been keen since Bachpan how the green lookin mother boards do work. What intelligence is stored in them that makes them capable of running a walkman, a fm transmitter and lot of other stuff. Whenever Dad gifted me a Toy I made it a point that it is an electronic device. Well the Story Goes On n I grow up wid the inquisition in my mind. Suddenly I realized that I do luv a subject called Physics specially semiconductor devices which work on Holes and Electrons.Well a lot of things work on Holes but this Subject in specific was real fun, along the same timeline I realised I cud draw FlowCharts for rely complex Logic. I always admired the Box with Keyboard and Mouse. I designed the CKT of a buzzer in 8th and got the circuit made. I knew all the part of it except the relays(1st CKT Breakers of Ma Life). Then came the most confusing Era of My Life i.e. +2. Will it be Biology or Maths was The Question of My Life. I was biased to Biology but Physics and Maths ment Better and Smart Career. So then started The Next Question will it be CS or EC in my Engineering Career. And I opted my Bachpan ka Instinct. Took E&TC as My BTech Degree in Colg. Well that was a real Rosy Era and will tell You about it Later.I studied a lot of Physics and Electronics in My 1st Year. So it happened in My 3rd Semester that I wanted to do something out of the Blue Moon. I recently happened to hear of a term "Tech-Fest" which Technically means a Festival for Technical Guys. It is a platform where the Techqies Test their Expertise in all the Subjects. I made a Technical Paper on "Snake-Bots" for TechFest in BIT-Meshra, well that paper was a huge success and I got my first share of LimeLight in Colg. I started visiting Techfests more often. During the end of the 4th sem I studied a subject called LIC. The same Bachpan Ka Instinct came back. I decided to make an audio amplifier. 714 relly sucks in a sense it requires more components than the kinda output it gives. Any how I made a CKT and found it relly tough to give the required potentials so as a result I ended up making a amplifier which actually reduced the sound rather than amplifying. Well then Started the Digital Era. MuX and FlipFlop came into My Life. Combination of these two was real Amazin. You know whenever you light a LED it glows bt when it glows in an output of a MuX it has a different feel. It gives a sense of Control, a Power that You can Command Something to do according to your Wish. Well I started making CKTs and enjoying Different Results which were not Even in Books. Like How Many of You Knew that a LED(Light Emitting Diode) can be Used As a Diode, as a Matter of Fact It is Primarily A Diode that has has Photo Properties too. We all are so keen in Observing the Photo property of the Diode that we forget its Basics. So Observations like this helped me get an inside look into my Subjects. It was during this time I heard of something called Microcontoller. This thing was a real Dude had a Geeky Combination of Mux and Diodes along with RAM ROM and IO ports and sometimes a Timer. Well it was the same time I meet With A senior from My Colg in Techfest of IIT-KGP who had made a robot made for calcualting distance it travlled. It never gave the correct observation bt it relly Impressed Me. Now I seriously wanted to start using a UC. I had no idea where to get these kinda UC's. One of my very close friends Nilav Ghosh (http://nilavghosh.blogspot.com) had got a few UC's from kolkatta during the same time. Now we needed a burner luckliy the same Senior had a burner for the UC. So we started wrtining small LED blinking codes and testing it. It was real fun writing codes and testing them but Programming UC was a real pain. So we thought of buying a UC programmer. Just then it struck our Laptop could act as a potential Programmer. I found out there were versions of UC's which could be programmed from our Laptop. All my friends were under impression that the UC's were unavailable in India. I had a friend in kolkatta who searched for the UC in kolkatta on my request. He sent me two UC's within a week and then we never had to go back to senior for programming a UC. We then started looking into small DC motors and TSOP sensors. It was the same time that few of us made a group, it was no decision it was just a mutual coherence that brought us together. And trust me we are still so together some unsaid rules do bond us always together.


Tushar.

Wednesday, January 21, 2009

Life's Jst Started!!!

Heloo Evry1,
This is not a blog you should searching for peace nor any geeky contribution to world of Electronics. You should be searching here for yourself and finding small packets of happiness. That's what life is all about breaking up the whole life into quantum packets of happiness and enjoying every stage of life.
It's never late to start living yourself. Confused? Let me tell you something, we feel we know ourselves the best but do you know the best way to find yourself is leave yourself open. Get out of a relationship and spend days in solace. You find your self a serene moment that you had in your life that gave happiness to you and only you. You know life is as complex as you make it and as simple as you keep it.
I had many moments of happiness but only a few in which I was Happy. Its tough to explain its tough to make You Understand but It will be too easy for you to Feel it for Yourself.
Dont think you are happy cause all round you is happy. May be you are confused and think you are happy while you are not. Try and find the reason for your happiness. The day you find it you will slove so many mystries of your life in seconds. What you want to do in life? Whom would you like to b in a relation with? What kind of a parent you will be? The list is endless.
The best past is you will stop repenting in your life. Its rely never late to realise and trust me the day you realise you will happen to be the best person in the world to know what is Happiness.


Tushar