How to make your PDF files speak in Acrobat Reader

If you ever wondered how to make your PDF files speak, there is a very simple way of doing this. This has been there since the version 6.0 of Acrobat Reader.

First you have to press "Shift + Ctrl + V", this will enable Read Out Loud function in acrobat reader. Now you will see Read Out Loud menu item under View menu. In this you can select the reading options, alternativly you can start/stop reading using following key combination;

Shift + Ctrl + B- Read the whole document
Shift + Ctrl + V - Read the current page only
Shift + Ctrl + C- Pause
Shift + Ctrl + E- Stop

The voice will be your choosen voice in the text to speach section in the control panel. You can download alternative voices from here for free .

This is really cool and  a very helpful feature.

PermLink

MS CRM 4 Form Printing - "This form has been changed and must be saved before printing"

I have come across an issue with Printing a CRM 4 form today. The messege "This form has been changed and must be saved before printing" appeared when I tried to print a form even though the form data is already saved.
After digging into the problem I found that this perticular form had two custom controls (textbox and a command button), because of this CRM was assuming this form has unsaved (isdirty true) data.
There is a workaround to solve this issue by changing the printing javascript in the main form script file.
First you have to log in to the CRM applicaiton server and go to the following location;
":\inetpub\wwwroot\_static\_forms\controls"
In this location you can find a file named "form.crm.htc". Open this file and find the print function which should look like this;

function Print()
{
if (isDirty())
{
alert(LOCID_FORM_PRINT_DIRTY_MESSAGE);
}
else
{
var sId = _oSubmitForm.crmFormSubmitId.value;
openStdWin(prependOrgName("/_forms/print/print.aspx?objectType=" + _oSubmitForm.crmFormSubmitObjectType.value + "&id=" + sId + "&title=" + CrmEncodeDecode.CrmUrlEncode(parent.document.title)), "print" + buildWinName(sId));
}
}

You can edit the above function to skip the isdirty check for the perticular entity which has custom controls. This will bypass the above mentioned messege and will go directly to printing. Change would be to the if condition for isdirty checking which should be the following;

if (isDirty() && _oSubmitForm.crmFormSubmitObjectType.value != 112)

112 is the objecttypecode for Case, you can change this to your disered entities objecttypecode. Hope this will help you, please drop a comment if you have any issues.

Permlink

Happy New Year 2010!


TSQL – Retrieve only numbers in a string

With related to my earlier post which demonstrated how to retrieve only numbers in a string using C#, this is how you can do it using TSQL in SQL Server. This will be also become handy if you want to do this in a backend process (SP, Trigger, etc). This is a UDF which you can reuse in your TSQL codes.

USE [DBNAME]
GO
/****** Object:  UserDefinedFunction [dbo].[fn_filternumbers]    Script Date: 11/27/2009 17:59:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER FUNCTION [dbo].[fn_filternumbers]
(
@Src nvarchar(255)
)
RETURNS nvarchar(255)
AS
BEGIN

declare @Res nvarchar(255)
declare @i int, @l int, @c char
select @i=1, @l=len(@Src)
SET @Res = ''
while @i<=@l
begin
   set @c=upper(substring(@Src,@i,1))
    IF  @c IN ('0','1','2','3','4','5','6','7','8','9')
        SET @Res = @Res + @c
   set @i=@i+1
end

return(@res)
END

You can use this function in the following manner;

select  telephone, dbo.fn_filternumbers(telephone) from users

This will return telephone numbers by removing white spaces, characters and will only return numbers. (i.e +94 (475) 849 984 would return 94475849984)

Please feel free to drop a comment if you have any question on this.

PermaLink

C# – Retrieve only numbers in a string

I wanted to retrieve only the number in a string to clean up some telephone numbers users have entered in a system today. So I came across with this nice Regular Expression it is really simple and most importantly it was the fastest method I could found. Here is the code;

public String returnonlyNumbers(String stringValue)
{
           return string.Join(null, System.Text.RegularExpressions.Regex.Split(stringValue, "[^\\d]"));
}

The above code would return only the numbers in any given string. For example if you pass the string  “+94 (084) 849748 489748”  to this method it would return “94084849748489748”.

Hope someone would find this beneficial.

PermaLink

Ravana the Great on the Canvas

These are some paintings of King Ravana by Dhammika Ravindra Dissanayaka. The history has been very rude on King Ravana, but Dhammika has seen him in another dimension. It is really a great work since we have very few texts about the costumes of that time. Here are few paintings from his Exhibition which was concluded in Lionel Wendt on 22nd November 2009.



Time Travel on the Web

Time travelling is one of the most fascinating concepts in the world of science fictions. Is time travel possible in the real world? This is a question which most of us would have asked from our selves at least once in our life. Anyway it will be a question without a proper answer for another few decades or more.

At least it has become a reality for the web. Yes you can do travel through time in the web. For a example if you want to go to yahoo.com as it was in 1998, it is really possible  with the Way Back Machine. The internet archive a non-profit organization is having the worlds biggest digital library of web archives. Apart from the way back machine they also do provide various other tools to analyze the web archive for researchers, students and general public for free.

So go ahead and play around with the Way Back Machine http://web.archive.org/collections/web/advanced.html

PermaLink

Download Torrents without a Torrent Client

Yes it is! You read it correctly, you can now download Torrents as HTTP for free. KickassTorrents is one of the fastest growing Torrent search engines offers Http Torrent downloads for free. Apart from this magnificent feature this site is very user friendly and most importantly it is simple.
Hope most of you will enjoy this Torrent Search Engine in many more months to come.

When the Go gets Going (Google Go)


Google the search engine giant has introduced its newest programing language called "Go". This is the second programing language Google has released in the recent past. In july this year they released the language called Simple.

Go is a system language like C, C++ but as they claim it is an extremely fast for development like Python. Go works with Google's open-source technology Native Client, designed for running native code in web-based applications, but it is not known yet whether Go will be used in the new Google operating system, Chrome.

Here is the URL for Go language's official website http://www.golang.org. You will find tutorials, samples, compiler downloads and many more in this site.

Here is a video showing Go on the Go:



Permalink

MS CRM 4 - Hiding System (Public) Views

In CRM 3 when we want to hide a System view, we were use to hide it by sharing that view with a team which has no users.

But in CRM 4 Microsoft has removed this functionality of sharing views (Brilliant isn’t it). This leaves us no option to hide unwanted System views using CRM Customization. What is more painful is there is no way we can delete these system views either.

But as always there are two workarounds we will achieve this goal. Out of those two easiest and quickest one is updating the SavedQuerybase table in the MSCRM database. Even though it is not recommended by Microsoft this would be very beneficial when you are in a tight schedule. Now let’s see how we can do this.

First you need to find the particular view which you want to edit from the SavedQuerybase table. For that you can use the following query by changing the "systemviewname" to the particular view name you want to edit.

select * From SavedQuerybase where name like '%systemviewname%'

Then you must update the "isprivate" flag in this table to 1. The default is 0 which means the view is public. For the update you can use the following query. The 'systemviewname' must be changed to the exact name of your view which you could find using the earlier query’s result set (column name is “name”).

update SavedQuerybase
set isprivate = 1
where name = 'systemviewname'

This will remove that particular system view from user’s dropdown list.

Anyway there is another way of achieving this in a proper way by writing a CRM plug-in to change the SavedQuery entity. This needs some coding and of course deployment. Here are two great articles which will walk you through the process;

http://msdynamicscrm-e.blogspot.com/2008/02/hiding-view-in-crm-40-using-plug-in.html
http://mscrmuk.blogspot.com/2008/08/hiding-system-views-in-crm-40.html

If you are interested about learning more about CRM 4 development tricks, I strongly recommend buying following books;





Will Doomsday 2012 be a reality? - 10 Failed Doomsday Prophecies

The whole world (At least most of us) is wondering about the Doomsday prophecy in 2012. The main reason is the end of Mayan's long calender is due on 21st of December 2012. I am not going to argue on whether it is false or not. Purely because of there are millions of articles on the web on this.

Anyway today I found a very interesting article in www.nationalgeographic.com on 10 failed such propecies in the history. What is more interesting is all these are not from very distance past. Just have a look, you may be able to have some breathing space if you were so scared of being wiped out in 2012.


SQL Server - Error Rebuilding Indexes in Online Mode

In transactional Databases it is a must to have an index rebuilding job running frequently. Fragmentation of indexes is the major cause for any database driven system to perform slower or to crash. As modern database driven application's (Specially Web) are operated 24/7, it demands us to do this operation while the indexes are online.

But SQL Server does not support this operation if you have any LOB data type (text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml) column in your indexes. And this is the part of the error message your getting from SQL Server IDE;

"Online index operation cannot be performed for index 'cndx_PrimaryKey_Account' because the index contains column 'Description' of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index,..."

Sri Lankan Cricket Team's Indian Tour Schedule

Schedule:

Nov 8: Sri Lanka Team arrives at Mumbai.
Nov 11-13: 3-day Match at Ahmedabad Vs Board President`s XI.

Nov 16-20: First Test at Ahmedabad.
Nov 24-28: Second Test at Kanpur.
Dec 2-6: Third Test at Mumbai.

Dec 9: 1st Twenty20 at Mohali (D/N)
Dec 12 : 2nd Twenty20 Match in Nagpur (D/N).

Dec 15: 1st ODI against India at Rajkot.
Dec 18: 2nd ODI against India at Vizag (D/N).
Dec 21: 3rd ODI Match against India at Cuttack (D/N)
Dec 24: 4th ODI against India in Kolkata.
Dec 27: 5th ODI against India in Delhi (D/N).

Dec 28: Team departs.

Retrive only the date part from a datetime (TSQL)

This is one of the easiest ways to retrive only the date part from a DateTime value. Of course not some thing I invented but will be useful for others;

SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))

Reality of the Reality shows in Sri Lanka

I was watching "Derana Dream Star" on last Sunday (3rd October) and it was a judgment day for 12 contestants. By watching it for sometime I felt very much uncivilized about being a viewer on such a heartless show. The presenter was torchering those 12 young artists by keeping them on the edge for more than 45 minutes. It appeared that their intention was to cover the 1 hour allocated show time rather than just declaring the winners. Also it appeared to me it was like a fun game for the presenter. But sadly in the receiving end of that were those poor contestants and their relatives. They were marketing their tears and gloomy faces in a pathetic way and clearly it crosses the boundaries of a civilised society.

As we all know these shows are being following the footsteps of American Idol. Also some world famous talent shows like Britain's Got Talent. Which I happen to follow while I was in UK during this Summer. And when it comes to declaring winners it was really straight forward, I can remember in the final they did it within a minute. No unwanted dragging and so professional. If we are copying form them why we are not adapting good things, which is a very big question mark for me.

Cricket Commentators, Are they really expert?

We all know Cricket is a very unpredictable game. But have these so called expert commentators really understand that? Given the fact that most of them have played lot of cricket and matured with the game they should be seeing things beyond our view. Instead they predict things like armatures.

Find Modified date of a Stored Procedure

This will be very helpful since the GUI doesnt show the modified date of a SP in SQL Server.

SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
AND name = 'spname'

T-Sql NOT IN is not returning expected results in SQL Server

I ran into this problem several times and when ever I encountered this problem I used to change my query to avoid this. But today I had sometime to dig into the root of this issue. Here are the problem, cause and the solution;

Lets take a simple example where you have a Customer table and a Invoice table (this is my favourite scenario since a POS system was my first ever commercial project). Invoice table has a foreign key to Customer table. Let say you have come across a situation where you want to find out customers who doesn't have any Invoices against them. You would probably write the following T-SQL (There are few other ways you can write this, but I know most of the SQL coders prefer IN and NOT IN);

SELECT customerName FROM customer WHERE customerID NOT IN (SELECT DISTINCT customerID FROM Invoice);

Sanga and the team : We are proud of you guys

When our cricket team looses, most of the times we used to criticise them. But this T20 World Cup final was one of the rare occasions we feel proud about the team despite the loss. The passion and the spirit the whole team showed through out the tournament was outstanding. There was always someone who stood up and took the responsibility either in batting or bowling. I am really proud of them and whole world would never forget specially how Dilshan, Sanath, Sanga, Mahela, Murali, Mendis, Mathews and Malinga played in this tournament. You all have made Sri Lanka proud. Cheers to all of you guys!!!!

How Indian Cricket fans can show their anger in a peaceful manner

This is an innovative thinking from Nishi Narayanan from Cricinfo. But as we all know Indian supports are the last in the line to accept these kind of CIVILISED ways.

1. Send an anonymous tip to airport authorities regarding possible swine flu among the Indian team contingent. Getting them quarantined will be much more satisfying than breaking a few windows.

2. Hold a press conference. Have all aggrieved Indian fans stand on a stage behind Bishan Bedi, who will read out a hand-written letter telling the players what a bunch of wusses they are for not staging a walkout to protest the short-ball barrage by England.

3. Don't bawl or cry foul murder when reporters stick their mikes into your faces asking for reactions. Be cool. How do I feel now that India have exited the World Twenty20? A little constipated, but I think that's the Chinese takeout from last night.

4. Threaten to support England in the next tournament in that country. The concept of English grounds being filled by thousands of fans cheering for England is bizarre enough to mess the minds of the Indian players so much that they'll need John Buchanan to explain it to them.

5. Invite the players to parade in an open-top bus through the streets of Mumbai as a we-forgive-you gesture. If they survive the ride in the city's monsoons, organise a function for them to watch their post-match interviews where every "obviously" and "of course" is replaced by the sound of nails on a chalkboard.

6. Spread a rumour through the press that Shahrukh Khan plans to buy the whole team for his franchise. If the thought of playing for Kolkata Knight Riders doesn't depress them, the fear of fakeiplplayer leaking all their dirty secrets will surely get to them.

7. And finally, do as Gandhi would. Boycott products endorsed by cricketers. Don't buy shampoos, soaps, cellphones, colas, water, satellite TV, motorbikes, cars, clothes, electricity, chocolate, chips, air conditioners and refrigerators. That leaves books and maybe air. A refreshing and uplifting lifestyle. The Mahatma would approve.

LINK
 
Blog Directory - OnToplist.com