-
DOWNLOAD ANYTHING!
Posted on April 30th, 2009 No commentsI recently started learning about Open Social and thought will write some useful application for orkut and here is one. I have named it as GFinder. You can find almost any files (pdf,mp3,avi) using google.Here is how it works
Goto http://www.google.com
Song Name = intitle:”index.of”(mp3|mp4|avi) “way back into love”Artist Name = intitle:”index.of”(mp3|mp4|avi) “green day”
eBook = intitle:”index.of”(chm|pdf|doc) “c++ complete reference”
eBook = intitle:”index.of”(chm|pdf|doc) “silverlight”
Using the above query in google will give you any files you want.This application does the same.You can add this application to your orkut. And no need to remember anything from above. Just query for anything and you will get it!.Orkut application is still on sandbox.Once it’s aproved by orkut team I will share the link.
-
Silverlight Tutorial
Posted on April 29th, 2009 No commentsFor Silverlight Startup you can refer to Why Silverlight?. This will give you top view of Silverlight.
-
Next Business Day in SQL
Posted on April 21st, 2009 No commentsThe other day I found myself needing to come up with a way to calculate the next business day including taking into account holidays. A recursive function turned out to be just the thing to use.
Scripts
To start with, you’ll need to create a table to hold the holidays: It can be any table which has just Holiday Date in it.CREATE TABLE [holiday] (
[holidayDate] [smalldatetime] NOT NULL ,
CONSTRAINT [PK_holidayDate] PRIMARY KEY CLUSTERED
(
[holidayDate]
)
)The function is
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GOcreate function fnGetNextBusinessDay (@startDate smalldatetime,@numDays int)
returns smalldatetime asBegin
Declare @nextBusDay smalldatetime
Declare @weekDay tinyIntset @nextBusDay = @startDate
Declare @dayLoop int
set @dayLoop = 0while @dayLoop < @numDays
Begin
set @nextBusDay = dateAdd(d,1,@nextBusDay) -- first get the raw next daySET @weekDay =((@@dateFirst+datePart(dw,@nextBusDay)-2) % 7) + 1
-- always returns Mon=1 - can't use set datefirst in UDF
-- % is the Modulo operator which gives the remainder
-- of the dividend divided by the divisor (7)
-- this allows you to create repeating
-- sequences of numbers which go from 0 to 6
-- the -2 and +1 adjust the sequence start point (Monday) and initial value (1)if @weekDay = 6 set @nextBusDay = @nextBusDay + 2 -- since day by day Saturday = jump to Monday
-- Holidays - function calls itself to find the next business day
select @nextBusDay = dbo.fnGetNextBusinessDay(@nextBusDay,1)
where exists (select holidayDate from Holiday where holidayDate=@nextBusDay)-- next day
set @dayLoop = @dayLoop + 1End
return @nextBusDay
End
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GOIf date is something like 24/04/2009 which is Friday and if Monday is specified as holiday in Holiday table. It will written 28/04/2009
-
TukLuk - Download Thousands of Hindi Songs on 1 Click
Posted on April 18th, 2009 1 commentI have came across one software which can download Movie songs at one go and it’s free source. :-). Use Tukluk to download songs and listen to them online. It’s the best I guess. Give it a try.
-
Handling WCF Exceptions in Silverlight
Posted on April 18th, 2009 8 commentsAs you know it’s not possible to handle WCF Exceptions on Silverlight side. As Silverlight plug in does not capture error thrown in 400-500 soap error range. It can only handle soap fault which are 200. So to handle any type of exceptions from WCF we need a work way round. We need to convert exception to 200 and use custom binding at Silverlight side. Here is the attached source code which will do the work for us. In Silverlight 2.0 we don’t have FaultException
so attached module contain SLFaultException which can be used to pass custom error messages to silverlight side. There are few changes required to adopt this to any silverlight application.
Add the following to Global.asax which is handling the job of converting fault service request to 200 so that silverlight plug in can handle it.protected void Application_EndRequest(object sender, EventArgs e) {
if (HttpContext.Current.Request.PhysicalPath.EndsWith(".svc", StringComparison.OrdinalIgnoreCase) &&
HttpContext.Current.Response.StatusCode == 500 &&
!HttpContext.Current.Request.Browser.Crawler &&
HttpContext.Current.Request.Browser.EcmaScriptVersion.Major > 0) {
// Set 200 if its a faulted service request
HttpContext.Current.Response.StatusCode = 200;
}
}and In app.xaml we need to register this new assembly
// Register faults
System.ServiceModel.SilverlightFaultMessageInspector.RegisterCurrentAssembly();and please note the binding It’s a custom httpBinding
EndpointAddress address = new EndpointAddress("http://127.0.0.1:52620/Service.svc");
BasicHttpMessageInspectorBinding binding = new BasicHttpMessageInspectorBinding(new SilverlightFaultMessageInspector());
ServiceClient proxy = new ServiceClient(binding, address);That’s it. Now Silverlight application can handle Fault Exceptions from WCF.
Source :
SilverlightFaultsSource.zipTo learn Silverlight follow this link.. http://www.dhaneel.com/whysilverlight/Which will give you a clear picture about silverlight.


