Friday, December 07, 2007

Expanding Tree SQL Query

I was working on my web site, and I wanted to implement expanding category view... I have done this many times, and I thought of sharing this with you all.

I have a category table like following..

catId int
catName nvarchar(255)
parcatId int

in which I will be entering categories, and this will allow me to have categories upto multiple levels.. for example I got parent category which has ID 1 and category name is Software Development, then I got categoies like Microsoft, Sun and Linux this three got catId 2,3,4 respectively and parcatId as 1.. then I got few more categories like .NET, MFC, Silverlight, WPF.. whcih got catid like 5,6,7,8 respectively and parcatId as 2.. so this allows me to have unlimited tree for categories.

now, what I wanted was, that if I say catId 8 which is WPF, then I wanted to have output which gives me all parent categories.. like Software Development > Microsoft > WPF... also I wanted if I give catId 1 which is Software development then to give me all categories belonging to that one.. so it gives me output.. Software Development > Microsoft, Sun, Linux > inside Microsoft > .NET, MFC, Silverlight, WPF.

to do the above thing.. following SQL Query I have written.

- to get explosion from top to bottom.

WITH ExpandedCat(catId, catName, parcatId) AS
(
SELECT Cat1.catId, Cat1.catName, Cat1.parcatId
FROM Categories AS Cat1
WHERE Cat1.catId=1

UNION ALL

SELECT Cat2.catId, Cat2.catName, Cat2.parcatId
FROM ExpandedCat, Categories Cat2
WHERE ExpandedCat.catId = Cat2.parcatId
)
SELECT DISTINCT catId, catName, parcatId
FROM ExpandedCat
ORDER BY parcatId


and to get explosion from bottom to top.

WITH ExpandedCat(catId, catName, parcatId) AS
(
SELECT Cat1.catId, Cat1.catName, Cat1.parcatId
FROM Categories AS Cat1
WHERE Cat1.catId=8

UNION ALL

SELECT Cat2.catId, Cat2.catName, Cat2.parcatId
FROM ExpandedCat, Categories Cat2
WHERE ExpandedCat.parcatId = Cat2.catId
)
SELECT DISTINCT catId, catName, parcatId
FROM ExpandedCat
ORDER BY parcatId

Sunday, December 02, 2007

3D Max Tutorial on Ashtray at learnitonweb.com

I have uploaded 3rd video at http://www.learnitonweb.com on how to create or model Ashtray in 3D Max and apply materials (textures) to it and make it look like ceramic 3D Ashtray.

Check it out, and leave your comments on the site.

Sunday, November 25, 2007

Spirit of Mumbai

This is what keeps Mumbai alive :) - http://www.mumbaimirror.com/net/mmpaper.aspx?page=article§id=15&contentid=200711232007112304331879696dff8fb

Thursday, November 22, 2007

Future Currency or Money

Back in time………. There was no concept of currency or money, and probably these words never existed. Back in time there was no valuation of things, it was just give and take… what you can do I can’t do, and what I can do you can’t do… so you give me what you have and I give you what I have, and of course there was no measurement instruments in those days, so things were given without proper valuation and without measurement. Now lets keep measurement issue apart and talk about valuation, later on it came into picture that to make particular thing one needs to put it huge amount of efforts and other person is putting less efforts to do the what he can do, but both are giving each other same of goods or almost same amount of goods, so valuation of both goods were same regardless whether it took huge amount of time to produce 1st product or 2nd product… things were going on, and later on there a concept of Gold coins came in, but yet they were not used for valuation, they were used to give rewards, again no valuation of goods happened, but valuation of work started happening, because of that people understood the valuation o f the goods, and coin age started, transition from barter system to gold coins to coin age never happened instantly it took huge amount of time, and also it never happened everywhere at the same time, at some places it was going through centuries some places it was just introduced and some places they never heard about it. Coin age started valuing the goods, and people started understanding the efforts, value and measurement s of the goods, and started exchanging goods for the coins they have (this is what we still do, but now we call it we are buying).

Now lets look at how things are going… now the era of hard money is going on, bank notes… no coins… and now its going towards Plastic Money what we more popularly know it as Credit Cards, Debit Cards, etc… when we bought something we gave money now when we are buying something we are giving them plastic card to swipe.. and while making payment to a credit card company we are still not giving them money but we are sending them cheque or sometimes cash but most of the time its cheque, when we are giving cheque again transaction of cheque is done digitally no hard money is involved.. they are just numbers going from here to there… and this transition from money to plastic money is happening very quickly, the reason for this is the whole world is connected. Why plastic money is become so popular… if you look earlier people started valuing about the goods but they time was never valuable… now people have started valuing about the value of goods as well as of time… and plastic money saves a lot of time… now there have been huge amount of cases happening all the time regarding fraud credit card transaction, etc… now people needs to also value security… and I see future currency to be my bio genetic print… wherever I am going.. and I want to make transaction… give my fingerprint of any other bio genetic print and transaction is done…. Welcome to the future.

Monday, November 19, 2007

learnitonweb.com

Finally after a long long long work and waiting... I am finally launching http://www.learnitonweb.com/.

still site is not completely done, but the main purpose why I started is done and is working :), I am working on its new design in Microsoft Silverlight 1.1 and will be done with it very soon, but will not be launching it till Microsoft gives it go at least till Beta.

so if you want to learn programming, computer, system admin, networking, database administration learnitonweb.com is the site :), I will be posting lots of video tutorials, along with the code.

Please visit it, have a look at them.. and leave your comments, and spread the word.

its - Learn IT On Web

Friday, November 09, 2007

Travelling, Meetings and Calls

This week’s three days were really busy for me and I was able to check up the limit of my cell phone battery, how hot it gets, and my running strength and time time time.

Monday I was in event where Steve Ballmer had come down, it wasn’t that busy, but looking at Tuesday it was really hectic day… morning get up reach at Microsoft India Mumbai office at Kalina from Goregaon, local trains are great very crowded and a huge bag with me :P, reached for meeting.. meeting for 3 hours, I was expecting meeting to last for 2 hour, had scheduled another meeting in next 2 hours, but this meeting got extended for 1 hour, hence I decided to do that meeting on phone, while was in meeting was travelling and was heading towards town side, had to reach there by 3:30 PM and it was already 2:45 PM, running talking on phone reached finally at 3:20 PM and of course call on phone ended right on time.

Third day was again very hectic, morning 2 meetings, and phone meeting was great, so did 4 meetings on cell phone, and finally had to reach Worli for one more meeting, completed meeting in just 1 hour, and returned back from there , reached home 9 PM.
Fourth day wasn’t much hectic but was really nice smooth day but again with 2-3 meetings on cell phone.

My cell phone isn’t able to last its battery life compared to my last cell phone… oh btw my last cell phone i-mate JasJar I sold it and got new one HTC Touch, but this is really good one very light weight so talking a lot doesn’t make my arms pain.

And my running strength is same as before, just that I get a bit tired easily… hmm calls me for exercise, yeah am planning to join swimming… but no idea when plan will be implemented.

Wednesday, September 12, 2007

CHM and Windows Vista or Windows XP SP2

I was struggling to open up .chm file, which is a legacy Help file, I was trying to open it up in Windows Vista it opens up but when I try to navigate through chm file all I see is navigation is canceled, this is not just with Windows Vista, but Windows XP Service Pack 2 (SP2) also faces same problem.



I was going through file properties and noticed something, and clicked on Unblock button and then tried to open it up and yes it opens up :)

Thursday, August 16, 2007

Updates

I am excited to tell u all about my new site coming up soon... design, programming and testing is done, I am right now working on content for the site... once I am done with a handful of content am gona start posting on it and will publish it... right now I have not published my web site, I am expecting to be done with content by end of this month, or starting of next month.

Friday, July 13, 2007

Live Stream

I am planning to stream myself 24/7, so sooner you will see me what am doing where am going.. all on internet :)

just have a look at http://www.justin.tv/ to get more idea.

I am goin to get EVDO - Reliance or TATA Data Card and stream myself :)

Tuesday, June 12, 2007

Apple iPhone Developer Announcement WWDC 07

Steve Jobs, yesterday in WwDC 2007 keynote talked about iPhone, they are launching it on 29th June at 6PM, also they talked about third party application on iPhone.. now before I go ahead...

they also announced Safari browser on Windows.. good news, now back to iPhone, iPhone will support third party applications, now good news in this is that you dont need to download any new SDK, learn something new... but you can use your existing knowledge of AJAX and xHTML and CSS meaning Web 2.0 and your application will run on Apple iPhone, to run your application it needs Safari browser which is already present on iPhone, now the question that I have got is, this means that you will need internet connection whenever you want to use third party application, and internet connection on cell phone using GPRS is expensive or does it allows you to download web 2.0 application? that is not clear, ok now thats that.. now one more disappointment is that, its web 2.0 meaning application will not be able to access platform features, meaning this applications will not be able to access iPhone :( but lets wait till launch and see whats in the store... so far it doesnt look good and also not enough information in hand.. so will wait till final launch.

but iPhone looks great.

Friday, June 08, 2007

Celebrating Decade

I am celebrating a decade :P, its been 10 years I am using internet :D yeah 1997 is the year when I got my first ever internet connection from VSNL for 3,000rs for 100 hours :D on dial-up at speed of wooping 36kbps :D and later on 56kbps.

And also I am celebrating decade for a programming :D, yes I am completed 10 years of me into programming and now I am spending very less time in programming more into business and meetings into architecturing.

Remembering good old days… when…
- Your best friend for coding was none other than notepad.
- You did debugging using paper and pen.
- You did dirty debugging by putting write to console line of code to just see that values are computing proper.

Today also dirty debugging works, when debugging tools doesn’t help you out.

- Internet was just a place where you chat, check email and download games.
- You liked telnet kind of internet a lot than browser internet.
- You used internet only for hour so that you don’t run out of hours and telephone bills.
- There was handful of reasons to use internet.
- You spend more time watching TV rather than surfing on internet.

Plus, lots of things are there, I am just too happy to celebrate decade in this industry.

Tuesday, May 29, 2007

Closer

day by day I am getting closer to finishing website learnitonweb.com and also in a month I will be launching.. I am going to finish the site design and programming by 10th June.. and will start testing after 10th June.. and launch in July :) so stay tuned for screen shots.

Thursday, May 17, 2007

The future of Software

Since 3 days, I have been trying to understand the way software industry has evolved and is evolving and will evolve. It’s been a long time software industry has not gone through a radical change, if we notice it’s same kind of software we are still developing but including more features and functionality, its jut because hardware has become more powerful, but software never been able to take advantage of the powerful hardware, and we can blame operating systems for the same, but they are not 100% in a blame, we have to blame ourselves software companies and developers for this.

Let's look at what I am trying to say in a bit more detailed manner, to give you a basic problem which I face a lot of time is as follows:
Most of the time whenever I am saving a file, I save file on a desktop, I click on desktop and save a file, and next time when I again want to save file it takes me straight to Desktop, that's really nice and worth, but one application is there in which if I want to save file, before that I use explorer to check the path, the path that I get, I copy that path and paste it in a window which asks me where I want to save a file, now next time when I save file from the same application it opens up the same path where I saved file earlier, which is not at all good for me, because every time I want to save file from that application, I always go through explorer and copy the path, so the best thing will be if application can understand that I am copying path all the time for this application and for other application I am always saving on desktop, that will be really great and would be really wonderful and a lot time saving, so what I mean is, software should become more intelligence rather than being just a guided software application by users.

Tuesday, May 15, 2007

Hooked to Microsoft Flight Simulator X






this days I am very much hooked to this game Microsoft Flight Simulator X http://www.microsoft.com/games/flightsimulator/ this is one really exciting game.. I been playing this game since its realease of Flight Simulator 2002 and then I have never stopped playing this game.. but in between I was not in touch with this game.. but now I have again started playing this game.. check out the screen shot.... I have captured screenshot of the game.. and then I have used photoshop to make it a more realistic, 1st one is game screenshot and 2nd one is photoshoped screenshot.. click on images to view larger. I have not done a great job in photoshop but just tried to make it look good. :) comments and feedbacks always welcome.



Saturday, May 05, 2007

Yahoo still rocks for the speed

me and one of my friend we are just great fan of dazzling speed of Yahoo! but since a long time we never spent looking at Yahoo! speed and we thought Google is catching up with speed, so we thought to still give a test at Yahoo! we managed to block our traffic to such extent that no single site opens, even DNS request fails most of the time, and we gave a test to google.com and yahoo.com, google.com failed to open and yahoo.com opened.. Yahoo! still rocks :P

we were also looking at Yahoo! Messenger and found this wonderful stuff, http://webmessenger.yahoo.com/index.php its again dazzling fast, it has really nice graphics, but its just too fast on dial up as well.. must try it out.. its super duper fast.. I am impressed with the speed of webbased yahoo messenger, just because its using heavy graphics yet faster.

Sunday, April 29, 2007

Good news for all Asian for Internet

It's really great for everyone internet is going to be a great in Asia very soon now..

check out the following links:

http://www.engadget.com/2007/04/28/india-could-get-free-2mbps-broadband-internet-by-2009

http://www.engadget.com/2007/04/28/500-million-underwater-fiber-network-to-link-asia-america/

Wednesday, April 25, 2007

Situation or Situational or Task Based Services

Today everyone is talking about Location based services, few talking about location aware services, but almost no one is talking about situation based services.

Situation-al based services can be really breakthrough advancement in software and the way people are able to get their work done.

Let’s understand what is Location based services, Location aware services and then we will understand situation based services.

Location Based Services:
LBS, these services are executed when you are around particular location. Let’s take a simple scenario: You got your cell phone and your cell phone is loaded with the software which enables you to know the location at which you are, and this software is constantly running in a background, you have also subscribed to the live services provided by the software manufacture, you are in your office, you get a call from your mother asking you to get some grocery when you are on the way to home, later you get a call from your girl friend wanting to meet you, and you decide to greet her with flowers, you note all this information down, and you open up the software loaded in your cell phone and put all this information saying that as soon as you leave office, remind you to buy groceries for mother, and to buy flowers to greet girl friend, all information is punched into a software, and now you don't need to remember or care, you can be a free... Now your work is done, it’s time to leave office, you reach office gate and you get reminder to buy groceries for mother... You drive to grocery shop, get the groceries, on the way when you are approaching flower shop, your cell phone reminds you to buy flowers for your girlfriend, you reach home give groceries to your mother, and leave to meet your girlfriend, on the way while you are approaching your cell phone informs you about romantic movie being played nearby movie hall, and tickets are available at rate of 90.00rs (approx 2 USD), you decide to buy tickets and again while approaching cell phone informs you there is a traffic on the way and advice you to take another route, you reach on time, and you give good surprises to your girl friend, you feel proud of yourself and all this is done through LBS.

How LBS work?
Your cell phone is switched on, and software is running which provides LBS, this software keeps on monitoring the location which you are at, software does it using cell tower information, whenever you enter particular cell, software queries the cell and gets information which includes cell id, signal strength etc... User enters information into software based on that, for example I know that when I reach my office gate I am at cell tower 22, I get this information through software and I give it a friendly name - my office gate, so in software I will enter information when cell enters into my office gateway which is tower 22 remind me to buy groceries, and similarly I configure other reminders, auto notification like traffic and movie hall nearby are given to me by software which is connected to software manufacture through internet using GPRS.

So that was about Location Based Services, now let’s look at Location Aware Services.

Location Aware Services:
These services are executed when you are at the particular location, let’s take a scenario for this one as well: you are having a mobile device which is connected to GPS receiver to get the exact location where you are presently, software is loaded on your mobile device to get the data from GPS receiver and perform actions, you are at office working and you get a call from your friend and you both decide to meet up place where you never been, and you are not sure about the direction, you start the software and with the help of GPS, software is able to give you your perfect location and is able to direct you to proper location.

How LAS Works?
LAS, works using GPS device, GPS receiver gives your longitude and latitude along with many more information, e.g. speed at which you are travelling, altitude, etc...

The difference between LBS and LAS is, LBS cannot get the accurate location as it is working on cellular tower information, and cellular tower covers a good amount of distance making software unable to determine the exact location, whereas LBS communicates with GPS satellites and gives you your perfect location.

Now, let’s look at Situation based services.

Situation Based Services:
SBS, very rarely anyone is talking about this, but once this services gets implemented it can do wonders for everyone, there is just no limit to what it can do, we will better understand it by a good scenario: you are at office working, you get a call from a friend and you both decides to meet at 6:00 PM, but you are too busy with work and not sure if you can make it, in situation based service providing software you enter information like if you are still in office at 5:00 PM, message your friend saying "I will get a bit late, I will message you when I leave from office." and you also set message for if u still in the office at 6:00 PM "I am really sorry, I am still at office, lots of work here, we will meet some other time." and you set one more message for if u leave office before 6:00 PM "I am done with my work, I am leaving now.. Meet you in next 30 minutes." after doing all this, you get busy with work... Its 5:00 PM now and you forgot about your friend, but the software remembers and sends SMS to your friend what you had set for 5 PM if you still in the office, you done with your work at 5:30 pm, you leave the office, software reminds you that you have to meet your friend and also sends message to your friend about meeting you in 30 minutes.. You will meet by 6 PM, software doesn't send message which you set for not meeting at 6:00 pm, because you are not in the office.

The above scenario is very simple but yet excites a lot; there can be lots of reasons and possibilities for which you can use Situation Based Services. This is the future of connected world.

How SBS Work?
Working of SBS is combination of LBS and LAS; you need cell tower information as well as GPS information.

Welcome to the future :)

Monday, April 16, 2007

Sound Projection

I always had this at back of my mind.. I always wanted some kind of projection system, which can project sound at particular direction, for example.. now a days we have got a TV on which we can have multiple channels going on.. at home this happens many time.. my bro wants to watch something else and I want to watch something else, we can watch but we cant really listen.. we can listen either of them.. and I always dreamed about a Sound projection system, which can project particular sound to particular person only.. and other person should not be able to head that sound.. and I was kind of thinking on this, how it works or how it can be done, etc... I started a bit working on this.. and I figured out we can use Infra rays, as Infra rays are directional ways compared to sound waves.. I somehow got this thing that we probably can use Infra ways with Sound waves and might be able to project sound in particular direction.. but I dint knew how to do the whole thing....
now after about 2 years, just today morning I was watching Discovery channel, yeah me not feeling well.. so was at home.. and they were talking exactly same thing, and some company already done research on it, and they are working on it, and to my surprise they are usign Infra rays.. eyeyyeyey.. but along with something more.. its great.. I can be inventor :P but thats apart.. its great to have a sound projection system.

Thursday, March 22, 2007

2 web sites

I am a bit busy with working on 2 web sites, which I am going to launch very soon... one is dhavalfaria.com coming back again.. and its not going to be only on blog, but a bit more things in it..

and second site that I am working on is going to help a lots of people into lots of things, but ofcourse only into IT, but lets see I might put something more as well, as the site name is such.. but anyways I will keep you all updated with it.. as site is in good shape right now.. I am planning to put it next month.. as I have to save some money so that I can host... I spent lots of money in few months :(, so a one month delay.

more information on second web site will be soon available.

Friday, March 02, 2007

Yahoo! Messenger old sounds

Dont like Yahoo! Messenger's new sound? cant live without hearing those chimes sound?? well, I really dint like new Yahoo! Messenger's sound.. as they are very low and really cant hear when u put voice low.

here is the answer, how to get back old sounds.

download from http://us.i1.yimg.com/us.yimg.com/i/us/msg/8/old_sounds.zip
and here u get old sounds :)

Friday, February 23, 2007

Blog Survery

Hello everyone,

those who have got a blog - click on this link - http://www.zoomerang.com/survey.zgi?p=WEB2266FZBLEPH and please fill up the survey.. as this is going to help MBA student.. they have got some project in college on blogger survey. I am sure you would do this for a good cause :)

Thanks.
Dhaval Faria.

Tuesday, February 06, 2007

Old Days

Great good old days :)... reminds me back and comes back :P

After a long time got back in touch with one of my friend in US, as he got a some free time from him work so we are now spending good quality time with some useful chat, which we used to do in past. It's amazing and reminds me back my old days, and me back in my earlier enthu energetic role to do full time research :P

Sunday, February 04, 2007

School Chale Hum

I been searching for this song since a long time, couldnt find anywhere.. finally found it on youtube.com but no way to download.. so here my friend comes to help me :D Kaustubh Gujar..

he got a site through which you can download youtube videos - http://www.dlyoutube.com/

it works great, and I have downloaded school chale hum video and enjoying the song.. now am gona extract audio from video :)

Thanks Kaustubh :D

Thursday, January 04, 2007

Happy New Year 2007

after 2 and half months of leaving blog space, am back now.. I got very much busy with work and dont wanted to concentrate anything else.
IN between lot of thins happend.. my laptop knocked off.. bought new one.. thanks to Sarang Datye, for suggesting wonderful new laptop.. HP Pavilion dv6114tx.
Lot of payments stuck, but now slowly they are releasing.. so no worries abt that as well.. my bro is gona get engaged soon now, very happy for that :D.
hmm and thats about it.. lets see how I blog more and how often I update it.. I have kept blog to low priority always, will see if I can shift it to a higher priority in my schedule :), it does require good amount of time :P
anyways, Happy New Year everyone.