Panchang mahurat

Aug 27 2010

In India we belive a Lot in good work begining in good mahurat. In the current world of everyting available online, I thought that the panchang should also be available online. I found ot these two linke whcih proved to be very helpful to me.

The following gives the sunrise – sunset times based on the geographical location you are in.

http://www.mypanchang.com/

And the following link will give you the mahurats according to the day panchang.

http://www.astrogyan.com/panchang/language-eng

Cheers,

Janak

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

Make Phone Calls in Gmail

Aug 27 2010

You can actually feel Skype quaking in their boots. Earlier this week Google announced that users would be able to make phone calls to any traditional number right from the Gmail interface.


It’s free after all, as long as you’re calling someone in the United States or Canada, and the promise of international calls billed as low as 2¢ a minute doesn’t hurt, either.

So here’s how to do it:

Log into your Gmail account, and under the Chat section on the left side you’ll notice a new option that says Call phone. Click on it

Upon clicking it, a traditional phone dial pad will pop up. You’ll need to install the Google Chat and Video plug-in for your browser before you can make a call, but there’s a link provided right in the call interface and it doesn’t take too long to set up.

After you’ve set that up, make sure you’ve got a microphone hooked up to your computer, input a number for someone you’d like to call and hit the Call button. It rings, acts and sounds exactly like a regular phone call, and the best part is: it’s free!!

Head over to your Gmail account and check it out today!!

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

Archiving in GMail

Aug 27 2010

Archiving

One of the first concepts that you have to get used to with Gmail is that of “Archiving”. The overall power of Gmail is in its message management, searching and archival capabilities. In order to really leverage this, you need to get past the “I have to delete everything because I don’t have enough storage space” mindset. With 1GB of storage, the average email user will have enough storage space to hold several years worth of emails. Yes, there will always be emails that you simply don’t want to keep. Don’t fret, despite some speculation, you can always delete any message you want. You aren’t required to retain every email you ever received or sent.


OK, so what’s Archiving? Archiving a message simply tells Gmail to remove the message from your Inbox screen and keep it in your “All Mail” screen. Simple enough, but what does this mean? When you receive an email, it first goes into your inbox. You can read it, reply to it, forward it, etc. You can apply a label to it (more on labels later), you can trash it, or you can report it as Spam. Pretty typical functions. All emails will remain in your inbox until you specifically “Archive” them. Archiving simply removes the message from your inbox screen.

But what happens to it? Don’t worry, all messages are always accessible through the “All Mail” screen. Archiving simply cleans up your inbox. Once a message has been archived, should you ever want to, you can easily move it back to the inbox, but there really isn’t a need for that.

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

C# Generic List – Copy by value

Jul 14 2010

Yesterday I came across an interesting issue. We have a source for our product information. This product are then published onto two websites with different tenant id. Now if we process 116K items two times, we are looking for ways to improve the performance. So what we did was we selected those SKU onlys once and updated them into a list twice with different tenant id each time.  Here’s the code to explain it.

More coming soon …


  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

SQL Search in database from Management Studio

Jul 10 2010

Have you ever wanted to change one of he fields in the database table? I am sure changing the field is not a problem but the issue is a huge issue when we try to find out where in the whole database is this column referenced. There is a brilliant too by Red Gate called Sql Search. Its very quick and its Free as well! Worth giving it a go.

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

Translation to & from Gujarati.

Jul 09 2010

I have always wanted a good translator to translate to and from gujarati. It has got loads of features like Phonic keyboard for those who need to see what they are typing. Its got a dictionary, Opposites, Thesarus, Idioms, Proverbs and other interesting features. Please visit Gujaratilexicon for more info

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

Disposing Proxy calls to WCF Services

Jul 08 2010

How many times have we had this issue, you call a WCF (of infact any other service) and due to some exception the the call to the service is not disposed and will eventually eat up all the resource.

A classic example of such issue is

<pre>
<pre>	public void Save(Message message)
	{
		IService _service = new ServiceClient();
		SaveMessageRequest request = new SaveMessageRequest{Message = message};
		_service.SaveMessage(request);
	}


To resolve this ussye we will make changes in two steps.

Step 1:

We will define a partial class with dispose method.


    public partial class ServiceClient : IDisposable
    {
        /// <summary>
        /// A partial class for ServiceClient
        /// Used to correctly close or abort a WCF proxy call.
        /// You MUST wrap the proxy call with a USING statement as DISPOSE will ALWAYS be called
        /// </summary>
        void IDisposable.Dispose()
        {
            // Check to see if the call has faulted
            if (State == CommunicationState.Faulted)
            {
                // We must abort the proxy as closing it will cause an exception
                Abort();
            }
            else
            {
                // Close the proxy
                Close();
            }
        }
    }

Step 2:

 We will change the save method to look as below. This will make sure that before the execution exits the using, the dispose method is called to dispose the service client.  

	public void Save(Message message)
	{
		using (ServiceClient smsProxy = new ServiceClient())
		{
			SaveMessageRequest request = new SaveMessageRequest{Message = message};
			smsProxy.SaveMessage(request);
		}
	}
  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

Online Chess Puzzles

Jul 08 2010

I came across these two online chess puzzle websites. I think this is a good way to improve your tactical game!

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

AJAX & JQuery Paging with ASP.NET MVC

Jul 08 2010

I am currently doing a small project on MVC. With web development, there is a basic requirement for presentiong data. paging … you will find a lot of articles on both this. I came across an article which was very useful. This article by Martijn Boland is a very good article if you want to use microsoft ajax.

Of course, in these days, nothing is ever good enough if it’s not using JQuery. I have done a small demo app to show this. You can download the demo app from here.

Right.  After a bit of tweaking I have the code ready. I have used the sample application of NerdDinner for this demo. So you can get the code from Codeplex and make the necessary change. Please complete the following steps to make the changes.

Step 1:

We will first Add a list Model. We will call it DinnerListModel. The definition of which is given below.

<pre>using System.Collections.Generic;
namespace NerdDinner.Models
{
public class DinnerListModel
{
public IEnumerable<Dinner> Dinners { get; set; }
public int TotalRowsCount { get; set; }
}
}

Step 2:

We will Add a partial view to show the paged data. The contents of the partial view is listed below.

<pre><%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DinnerListModel>" %>
<%@ Import Namespace="NerdDinner.Models" %>
<ul>
<% foreach (var dinner in Model.Dinners)
{
%>
<li>
<%= Html.ActionLink(dinner.Title,"Details", new{id=dinner.DinnerId})%>
on
<%=Html.Encode(dinner.EventDate.ToShortDateString())%>
@
<%=Html.Encode(dinner.EventDate.ToShortTimeString())%>
</li>
<%
}%>
</ul>

Note that the partial class is now inheriting from DinnerListModel instead of IEnumerable<Dinner>. Also the foreach loop now selects from Models.Dinner instead of Model.

Step 3:

The contents of content placeholder “MainContents” will look as follows.

<pre><pre>	<script type="text/javascript">
	    function pageselectCallback(page_index, jq) {
		    $.get("/Dinners/", { page: page_index, pageSize: 10 },
				   function (data) {
				       $('#ListResults').html(data);
				   });
		}

		jQuery(function ($) {
			$('#Pagination').pagination('<%= Model.TotalRowsCount %>', {
				callback: pageselectCallback
			});
		});
	</script>
	<h2>Upcoming Dinners</h2>
<div id="ListResults">
<%
Html.RenderPartial("~/Views/Dinners/DinnerResults.ascx", Model); %>
</div>
<div id="Pagination"></div><br />
	<p>
		<%: Html.ActionLink("Create New", "Create") %>
	</p>

The changes we have made is replacing the foreach loop to show data by a div tag called “ListResults” which will load the partial view. Also added is a div tag for pagination. The JQuery code will fetch the records based on page selected and number of record per page. Here as well the Page tag will change to

<pre><%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DinnerListModel>" %>

Step 4:

Don’t forget to add the Jquery files to script folder and Pagination.css to Content folder. These will be referenced in the site.master file by the following lines.

<script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.pagination.js" type="text/javascript"></script>

You can download the JQuery library from here. The pagination css can be downloaded from here.

Step 5:

After this I will a a new Method Called GetDinnerResults on DinnersControls.

<pre>        private DinnerListModel GetDinnerResults(int? page, int? pageSize)
{
IEnumerable<Dinner> upCommingDinners = _repository.FindUpCommingDinners().ToList();
IEnumerable<Dinner> selectedDinners = upCommingDinners.Skip((page ?? 0) * (pageSize ?? 10)).Take(10);

return    new DinnerListModel
{
Dinners = selectedDinners,
TotalRowsCount = upCommingDinners.Count()
};
}

Step 6:

The Index method will change to

<pre>        public ActionResult Index(int? page, int? pageSize)
{
DinnerListModel dinners = GetDinnerResults(page, pageSize);

if (Request.IsAjaxRequest())
{
return PartialView("DinnerResults", dinners);
}
else
{
return PartialView(dinners);
}
}

The above code indicates that we should load the partial onto the index page when the code is executed for the first time. For all other subsequent pages it will not the load he whole page but only load the partial view DinnersResults.

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

How to use Inversion of Control containers

Jul 08 2010

Today I came up with a very good blog entry on IOC  by Krzysztof Koźmic. This, together with RichP’s blog would form a very good understanding on IOC.

  • Print
  • PDF
  • RSS
  • Share/Bookmark

No responses yet

Older posts »

  • Buzz
  • Facebook
  • LinkedIn