Antimalware Service Executable High CPU Utilization

After a recent Windows update I found that the Antimalware Service Executable’s CPU utilization was at a constant 20% on all cores, for days together There were numerous articles on the web suggesting that changing the properties of Windows Defender in the Task Scheduler would resolve the problem – specifically, unchecking “Run with the highest privileges” and unchecking all the boxes in the “Conditions” tab for “Windows Defender Scheduled Scan”. However, none of these steps seemed to help.

I finally found an article by Dell that suggested a clean boot and then enabling one service at a time. I tried this approach – first I hid the Microsoft services – there were about 40 non-Microsoft services. Then I enabled 20 services, then 10 more, then 5 and so on. The CPU utilization remained low until I enabled a service called “TrueColor ALS” or Ambient Light Service. The CPU utilization immediately shot up to 50% overall.

Once the cause was identified, I enabled all the services except for the True Color ALS and the CPU utilization is normal.

So the key is to try a clean boot and narrow the search down to one or more services that might be the cause. Hope this helps someone who has the same problem.

A link to the Dell article can be found here: https://www.dell.com/support/kbdoc/en-in/000102564/how-to-perform-a-clean-boot-in-windows-10-to-troubleshoot-software-conflicts

Your mileage may vary, but the Task Manager should look something like this, when idle:

Bird watching trip to Ganesh Gudi, January 2021

I left home at 7.30 p.m. on the 22nd of Jan. to reach the station around 8.15 p.m. You can take the green line metro to Kempegowda and then the purple line to KSR Bengaluru metro station, which is linked with the Indian Railways station.

The Miraj Special Express left at 9.30 p.m and reached Londa at around 8.15 a.m. on the 23rd.

The birding started at the hide (a viewing area conveniently located near the dining area) of the Old Magazine House, that is a Jungle Lodges property. The others in the group joined us from Hubli – Vallish, the skipper, Deepak and Aniket. We were able to spot the White Rumped Shama, Monarch, Emerald Dove, Oriental White Eye among other species.

Since it was the Republic day weekend, it was fairly crowded, with lots of people from Bangalore, Mumbai and other cities.

Day 2 was spent at the Timber Depot. Although it was foggy, we were able to spot some Pied Horbills. The fog made for a great atmosphere. Later, when the fog burned off, we were able to spot many other species including the Lesser Golden back Woodpecker and the Green Bee Eater at close range. In the evening, we headed to the river, where we were able to spot Hornbills flying.

On day 3, we were lucky to spot the Malabar Trogon (male).

On day 4, I spotted the Malabar Trogon (female) in the morning, but only a few birds overall, even though I stayed till 5.40 p.m. at the Old Magazine House.

On the last day, Govind dropped me at Londa station. On the way, there was a spectacular view point with the sun setting over the reservoir at the Supa Dam. I caught the Miraj-Bangalore Special Express at around 7.30 p.m. from Londa and reached Bangalore at 6.30 a.m. on Wednesday, the day after Republic Day.

The food at the Old Magazine House was excellent, with tea/coffee early in the mornings, buffet lunch and dinner and soup and snacks in the evenings along with a bonfire. Jungle Lodges did an excellent job as usual, but are a bit expensive.

Most of the birding action was between 5 p.m. and 6 p.m. with a bathing and drinking frenzy happening just after 5.30 p.m at the hide! There were also occasional sightings in the afternoon around 3 p.m. and also in the mornings.

Another great trip!

Birds spotted:

Day 1


White Rumped Shama

Monarch

Tickell’s Blue Flycatcher

Emerald Dove

Blyth’s Reed Warbler

Blue Capped Rock Thrush

Brown Breasted Flycatcher

Orange Mini Vet

Oriental White Eye

Rusty Tailed Flycatcher

Black Throated Munia

White Bellied Blue Flycatcher

Orange Headed Thrush

Fulvetta

Day 2

Monarch

Asian Paradise Flycatcher juvenile

Pied hornbills

Green Bee eater

Brown breasted flycatcher

Lesser golden back woodpecker.

Jordan’s leaf bird

Vernal hanging parakeet

Brown shrike

Racket tailed drongo

Bar headed flycatcher (sighting)

Grey hornbill

Ashy drongo

Oriental White Eye

Day 3


Rusty tailed warbler

Dark fronted babbler

Puff throated babbler

Flame throated bulbul

Asian fairy blue bird (M and F)

Malabar Trogon (male)

Most Day 1 birds in the hide

Day 4


Malabar Trogon (female)

Blue capped rock thrush

Monarch

Thanks to Aniket for providing the list of birds.

Breakfast

White Rumped Shama

White Rumped Shama

Monarch

Orange Minivet (female)

Lunch

Brown Breasted Flycatcher


Blue-capped Rock Thrush


Blyth’s Reed Warbler


Orange Minivet (male)


Blue-capped Rock Thrush


Monarch


Emerald Dove


Asian Paradise Flycatcher (juvenile)


Tickell’s Blue Flycatcher


Emerald Dove


Monarch


Tickell’s Blue Flycatcher


Orange Headed Thrush


Timber Depot


Pied Hornbills


Pied Hornbills


Pied Hornbills


White-throated Kingfisher


Shikra


Lesser Golden Back Woodpecker


Timber Depot


Green Bee Eater


Green Bee Eater


Pied Hornbills


Bonfire

Dinner


Wildflowers


Early morning walk


Wildflowers


Asian Fairy Bluebird


Goshawk


Malabar Trogon (male)

Malabar Giant Squirrel


Buffet Lunch


The Hide


Oriental White-Eye


Warbler


Emerald Dove


White Bellied Blue Flycatcher


Flame-throated Bulbul


Black-throated Munia


Malabar Trogon (female)


Lizard


Supa Reservoir


The End – Miraj-Bangalore Express at KSR

Thanks for reading!

Birdwatching Trip to Kothagiri, Nilgiris, December 2020

I left home at 7.30 p.m. on the 16th. Took the metro to KSR Bengaluru. The metro was mostly empty, so it was very convenient. There is a walkway from the metro station to the over-bridge at the Indian Railways station. 

The train arrived about 20 minutes early, around 9.30 p.m. The train was fully occupied in spite of the pandemic. Everybody was wearing masks.

The train reached Coimbatore around 6.30 a.m. – 20 minutes ahead of schedule. I was met by Swarup, Aniket, Vivek and Vinod at the station.

We then proceeded to Swarup’s friend’s house where we had breakfast before heading to Kothagiri. 

Kothagiri is located about 30 km from Ooty. It was cold, but not too bad. We had to show our e-passes to enter the Nilgiris district.

The first day we spotted the highly sought-after Kashmiri Flycatcher. In the evening we spotted a sloth bear near a rocky area surrounded by tea estates. A leopard and black panther were also supposed to frequent the area.

On day two, we headed to Sims Park, Coonoor, where we spotted the following:

Nilgiris Flycatcher

Bar winged Flycatcher Shrike

Blue Capped Rock Thrush

Black and Orange Flycatcher

Tickell’s Blue Flycatcher

Emerald Dove

At another location near an abandoned gold mine, we spotted the following:

Malabar Parakeet

Hill Myna

Streak Throated Woodpecker

Lesser Golden Flame back Woodpecker

Great Tit

Oriental White Eye

Golden Oriole Female

Asian Fairy Bluebird

Verditer Flycatcher

On day three, we saw the following:

Nilgiri Sholakili (NIlgiri Blue Robin)

Malabar Crested Lark

Orange Minivet 

Red Breasted Flycatcher

Long tailed Shrike

On day four, we spotted the following:

Asian Paradise Flycatcher

Orange Minivet

Golden Oriole male

Chestnut-Headed Bee-Eater

Blue-capped Rock Thrush male and female

Indian Gaur

Lunch and dinner at the resort (Thillai Garden Cottages) were excellent – chapathis wih kurma, rice, sambhar, rasam and curd – very homely!

We picked up homemade chocolates and tea at Kothagiri, at the Cake O Clock Bakery.
On the last day, Aniket, Swarup and I visited Marudamalai, Perur Patteeswaram temple and Eechanaari temple, that are located around Coimbatore.

The climb up to Marudamalai was quite a hike, but not as steep as Pazhani. 
We had dinner at Aryas hotel opposite the railway station at Coimbatore. 
I caught the Kanyakumari Bangalore Express Special at around 10.45 p.m. and reached Bangalore on Monday at 7.25 a.m. – took 215H back home.

An excellent trip with the highlights being the woodpeckers, Asian Fairy Bluebird and Asian Paradise Flycatcher.

Some images from the trip:

Kothagiri

Tea Estates

Kashmiri Flycatcher

Nilgiri Flycatcher

Blue-capped Rock Thrush

Oriental White-eye and Bottlebrush

Black and Orange Flycatcher

Black and Orange Flycatcher

Mist

Lesser Golden back Woodpecker drinking water

Golden Oriole (female)

Hill Myna

Lesser Golden back Woodpecker

Lunch

Nilgiri Flycatcher

Orange Minivet (female)

Red-breasted Flycatcher

Indian Gaur

Chestnut Headed Bee-eater

Monkey having a field day

Flower

Group photo – the driver, Swarup (skipper), Aniket, Agal (guide), Vivek and Vinod

With the guide

Vehicle used during the trip

Birdwatching Trip to Ganesh Gudi, October 2019

I left home at around 7 p.m. on the 16th of October – took an auto to the metro station and Rani Chennamma Express at 9.15 p.m. My coach was S9 and berth number 38. Fortunately, Swarup was in berth 35, in the same coach!

We reached Londa the next morning at around 7.40. Swarup had arranged for a car and we reached Ganesh Gudi in about an hour. Ganesh Gudi is located at the northern end of Karnataka near the Goa border.

 

The name of the resort was Old Magazine House managed by Jungle Lodges. After checking in to the room, which was quite spacious, we had breakfast and immediately got into birding.

 

We were later joined by Don from Karur who took the bus from Bangalore to Dandeli. About mid day we were joined by Hari and Jeyachandran who flew to Goa from Chennai and took a car from Goa to Ganesh Gudi. Due to the main route being closed, they had to take a circuitous route via Karwar and reached the resort only in the afternoon.

We had some great sightings on the first day itself.

 

The next day, after tea at 6 a.m., we went to the timber depot, which is a nesting area for the Great Indian Hornbill, Malabar Pied Hornbill and Malabar Grey Hornbill.

 

We easily spotted the Pied and Grey Hornbills and got some great shots of them feeding on berries. We also saw a monitor lizard climbing a tree and a few other bird species.

 

The remaining days were spent mostly at the Old Magazine House, with some great sightings. We went on walks starting early in the morning and the birding ended at 6 p.m. along with the sunlight. Although there were birds throughout the day, the peak times for spotting birds was 6 a.m. to 9 a.m. and to a greater extent between 5 and 6 p.m.

 

On the penultimate day, Hari and Jeyachandran left for Goa as they had an early morning flight to catch the next morning at 6.

 

I shared the room with Hari, while Swarup and the others stayed in the dorm. The accommodation was neat and clean and the food excellent!

 

We met another group who suggested that we join them for a safari in Kali Tiger Reserve. However due to heavy rain the previous night, we had to cancel the plan.

 

On the last day, Don and Swarup checked out around 11 a.m. as they had to catch their train from Londa at 2.10 p.m. However, I had the luxury of staying back for another full day of birding, when I spotted the Monarch, Oriental White Eye, White Rumped Shama and Blue Capped Rock Thrush. I was also very luck to spot a pygmy woodpecker.

 

Govind, who dropped Swarup and Don at Londa came back to pick me up precisely at 5.45 p.m. I asked him to wait for 10 minutes as it was peak time for the birds – they showed up in large numbers in the bird baths.

 

I left the Old Magazine House at 6 p.m. and reached Londa in 45 minutes. I caught the Rani Chennamma Express at around 7.50 p.m. The train had no pantry, so I had to get some dinner at Hubli. Hubli station was like an airport, however the biryani was average.

 

There was a person from Kerala called Venu who was in my cabin. The next morning we discussed our days spent in the US and exchanged greetings before going our ways.

 

The train reached Bangalore at 7.20 a.m. Monday morning (the 21st), and I took 215M reaching home by around 9 a.m.

 

We spotted 46+ species in 4 days including a spider and scorpion.

 

It rained heavily on one of the days and during the last night at the Old Magazine House. There were leeches and I was bitten once, while Hari was bitten several times – so were the naturalists, but that didn’t deter us from our birding activities. Besides, the leeches there were small compared to the ones in Munnar and Thattekad!

 

Swarup did an excellent job organizing and managing the trip. He is also a marine engineer in the Merchant Navy and had some great stories about his life at sea, for 6 months in the year.

 

The Old Magazine House is a great place to spot birds and the food is excellent, accommodation very decent and the location exotic!

 

Some of the bird species we spotted were:

 

Day 1

 

1.Red whiskered bulbul
2.Malabar trogon
Malabar giant squirrel
3.Black throated Munia
4.Green warbler
5.Brown cheeked fulvetta
6.Tickell’s blue flycatcher
7.White bellied blue flycatcher male and female
8.Ashy drongo
9.Puff throated babbler
10.Indian blue robin
11.White rumped munia
12.White rumped shama
13.Orange headed thrush
14.Yellow browed bulbul

 

Day 2 morning near timber depot

 

1.Malabar grey hornbill
2.Pied hornbill
3.Scarlet minivet male and female
4.Coppersmith barbet
5.Brown headed barbet
6.Chestnut headed bee eater
7.Blyths starling
8.Grey wagtail
9.Vernal hanging parakeet
10.Yellow tit
11.Golden fronted leaf bird
12.Yellow fronted green pigeon
13 Green fronted green pigeon
14.Monitor lizard
15.White throated kingfisher
16.Malabar parakeet
17.White browed wagtail
Crocodile
18.Common Iora

 

Day 3

 

1.Crimson Backed sunbird
2.Purple rumped sunbird
3.Leaf bird
4.Flame throated bulbul
5.Velvet fronted nuthatch
6.Scarlet minivet male and female repeat
7.Crested yellow tit
8.Yellow naped woodpecker sighting only
White rumped munia repeat
9.Dark fronted babbler
10.Nilgiris flower pecker
11.Asian fairy blue bird sighting

 

Day 4

 

1. Brown Breasted Flycatcher
2. Blue capped Rock Thrush
3. Crested Goshawk
4. Oriental White Eye
5. Pygmy Woodpecker
6. Monarch
Malabar Giant Squirrel repeat
Flame throated bulbul repeat
Velvet fronted nuthatch repeat
White Rumped Shama repeat

Indian Yellow Tit repeat

Also spotted something similar to a quail.

 

NIK_4040
Pair of red vented bulbuls
NIK_4070
Tickell’s blue flycatcher
NIK_4103
White rumped shama
NIK_4151
Orange headed thrush
NIK_4161
Indian blue robin
NIK_4195
Malabar pied hornbill
NIK_4220
Malabar grey hornbill
NIK_4249
Malabar grey hornbill
NIK_4254
Yellow fronted green pigeon
NIK_4258
White throated kingfisher
NIK_4263
Sign in Ganesh Gudi
NIK_4291
Monitor lizard
NIK_4327
Crocodile
NIK_4358
Malabar giant squirrel
NIK_4387
Spider
NIK_4472
Leaf bird
NIK_4477
Scorpion
NIK_4764
Wild flower
NIK_4865
Malabar giant squirrel
NIK_4984
Oriental white eye
NIK_5004
Pygmy woodpecker
NIK_5077
Monarch

 

OLYMPUS DIGITAL CAMERA

Rani Chennamma Express at Londa

OLYMPUS DIGITAL CAMERA

Londa junction

OLYMPUS DIGITAL CAMERA

Buffet at the Old Magazine House, Jungle Lodges, Ganesh Gudi

OLYMPUS DIGITAL CAMERA

Lunch

OLYMPUS DIGITAL CAMERA

The bird viewing area at the Old Magazine House. The best viewing times are in the morning between 6 a.m. and 9 a.m. and the evening between 5 p.m. and 6 p.m.

OLYMPUS DIGITAL CAMERA

Myself, the driver from Goa, Don, Jeyachandran, Swarup (skipper) and Hari

OLYMPUS DIGITAL CAMERA

The end (KSR Bengaluru)

Birdwatching Trip to Ooty and Masinagudi – March 2019

I left home at 12.30 p.m. on the 8th of March and took the metro to KSR Bengaluru. There, Uday Express was waiting. It’s a double-decker train. As soon as you enter, there is a stairway that leads to the upper deck and one to the lower deck. My coach also had a pantry built in. There was an LCD display showing the number of kms to the destination (Coimbatore), ETA, distance to the next station, ETA and number of minutes late. It would be beneficial to have the same set up in the normal trains.

NIK_3176

KSR Bengaluru – Coimbatore Uday Express

It left promptly at 2.15 p.m and reached Coimbatore at 9 p.m. sharp. I had dinner at the station (chapathis with kurma) and then got a call from Karthick that there was another person named Srihari who would be joining us. His train was 1 hour late. Very soon, we located each other using our cellphones and the Innova that had Karthick, Deepak, Aniket, Jain and Stalin, our driver. Deepak and Aniket were from Chennai, while Jain was from Nasik and Srihari from Kollam.

We reached Ooty at around 1 a.m. The drive was mostly unincidental, except that there were many twists and turns.

The accommodation that we stayed in was called Treebo Lighthouse. The room was immaculate and so was the bathroom.

The next morning, we got up at 6 a.m. and was joined by our guide (whose name I forget). He was from Masinagudi and quite an expert.

A little outside Ooty, we spotted a few birds, including the blue Nilgiri Flycatcher, Bar winged Flycatcher and Nilgiri Flowerpecker.

NIK_3203

Nilgiri Flycatcher

We then headed back for breakfast. It was a buffet with idlis, bread, butter jam, omelettes, tea and coffee. We checked out, moved our luggage to the Innova and sent it to Masinagudi, while we continued our foray in Ooty. We headed to the botanical garden in a Jeep. It was easily 30+ years since I came there last, during my school days.

At the botanical garden, we saw the Black and Orange Flycatcher and a few other birds.

NIK_3236

Breakfast

NIK_3246

Botanical Garden, Ooty

NIK_3273

Black and Orange Flycatcher

NIK_3283

Black and Orange Flycatcher

NIK_3292

After that we headed to Masinagudi. The road winds down through a series of 36 hairpin bends – quite hair-rising, but fun at the same time.

We had lunch at a restaurant in Masinagudi. Masinagudi is at the edge of the Mudumalai Tiger Reserve. We spotted the White Throated Kingfisher, Crested Eagle, Malabar Hornbill, White Rumped Shama, Deer, Jungle Fowl, Peacocks, Eurasian Wry Neck.

NIK_3323

Crested Eagle

NIK_3362

Jungle Fowl

NIK_3425

Chameleon

NIK_3434

Common Indian Dove

The accommodation in Masinagudi was very nice – called Wildwood Haven. There were 6 beds and 2 bathrooms.

The next day, we got up at 3 a.m. and were out by 4, in search of Owls and Nightjars. We did not spot any, except one that flew away.

At dawn, we heard the calls of a hornbill – quite remarkable! Later in the morning, we saw a Pipit, Purple Sunbird, Indian Blackbird and Eurasian Collared Dove. We also saw the Malabar Giant Squirrel, a Chameleon and a Fantail. There were elephant droppings everywhere.

There was also a “Thiruvizha” and people decorated for “karagam”.

NIK_3467

Karagam

After the birdwatching, we checked out of our resort, said goodbye to the guide and took the 36 hairpin bends up to Ooty. We had lunch at an excellent restaurant (American Chopsuey with fruit salad and ice cream) and stopped by at the Indian and Nilgiri Bakery where I picked up some homemade chocolates.

We reached Coimbatore at around 6.30 in the evening and dropped Jain off at the airport and headed to the railway station. We kept our luggage in the cloak room and headed off to a local mall, where the others tried their hands at virtual reality games. We then returned to the railway station and had dinner at a restaurant opposite. I just had curd rice.

Karthick and the others boarded the Cheran Express, while we joined them for a while, given the nice air-conditioned interior as opposed to the sultry platform.

Eventually, Srihari and I took leave of Karthick and the others.

My train – Kanyakumari Express arrived at 11.15 p.m. about 20 minutes late. It turned out that 2 of us had been assigned the same birth in cabin C, but it turned out that a third person was actually on the waiting list. After the TTE arrived, it was sorted out and I took the upper berth, as my co-passenger was an older gentleman who gladly took the lower berth.

Next morning, the train reached Bangalore right on time at 7.20 a.m. I reached home by 8.30 a.m. and was soon joined by my cousins and their husbands from Chennai.

NIK_3489

Both Masinagudi and Ooty were excellent and we felt we were in the lap of nature away from the noise and bustle of cities. Also did some great birdwatching of some beautiful endemic species!

The trip was organized by Naturographers, a Chennai-based operator, led by Karthick and Swarup.

NIK_3488

The group – Clockwise from left – Jain, Aniket, Deepak, Srihari and Karthick (in yellow).

Binding AutoCompleteExtender to a Cities text-box in ASP.NET

In this article, we discuss how the Ajax AutoCompleteExtender can be used to display a list of matching cities given a country and the first few letters of the city.

The first step is to add a reference to the AjaxControlToolkit:

<%@ Register Assembly=”AjaxControlToolkit” Namespace=”AjaxControlToolkit” TagPrefix=”Ajax” %>

Create an instance of ScriptManager inside the form:

<form id=”form1″ runat=”server”>

<asp:ScriptManager ID=”ScriptManager1″ runat=”server” />

</form>

Next, create an instance of the countries drop down list (inside the form):

<asp:DropDownList ID=”ddlCountry” runat=”server” Width=”170px”      AutoPostBack=”true”
CssClass=”mediumblack” DataSourceID=”SqlDataSource3″ DataTextField=”COUNTRY_NAME” DataValueField=”CC” OnSelectedIndexChanged=”ddlCountry_SelectedIndexChanged”>
<asp:ListItem Text=”Select Country” />
</asp:DropDownList>

Note that the DataTextField has the country’s name, while the DataValueField (the selected value of the drop-down) has the country code (CC).

Define the data source for the countries drop-down:

<asp:SqlDataSource ID=”SqlDataSource3″ runat=”server” ConnectionString=”<%$ ConnectionStrings:WhatIfGamesConnectionString2 %>”
ProviderName=”<%$ ConnectionStrings:WhatIfGamesConnectionString2.ProviderName %>”
SelectCommand=”SELECT CC, COUNTRY_NAME FROM COUNTRIES ORDER BY COUNTRY_NAME”></asp:SqlDataSource>

Define the data source for the cities:

<asp:SqlDataSource ID=”SqlDataSource2″ runat=”server” ConnectionString=”<%$ ConnectionStrings:WhatIfGamesConnectionString2 %>”
ProviderName=”<%$ ConnectionStrings:WhatIfGamesConnectionString2.ProviderName %>”
SelectCommand=”SELECT CITIES.NAME FROM CITIES, COUNTRIES WHERE COUNTRIES.CC = CITIES.CC AND COUNTRIES.CC = @CC ORDER BY CITIES.NAME”>
         <SelectParameters>
                <asp:ControlParameter ControlID=”ddlCountry” Name=”CC”                                                        PropertyName=”SelectedValue” />
         </SelectParameters>
</asp:SqlDataSource>

Next, define the text-box that will display the cities using auto-complete:

<asp:TextBox ID=”txtCity” runat=”server” CssClass=”mediumblack” AutoPostBack=”true”
ontextchanged=”txtCity_TextChanged”></asp:TextBox>
<Ajax:AutoCompleteExtender
ServicePath=”Cities.asmx”
ServiceMethod=”GetCities”
MinimumPrefixLength=”1″
CompletionInterval=”100″
EnableCaching=”false”
EnableViewState=”true”
CompletionSetCount=”1″
TargetControlID=”txtCity”
ID=”AutoCompleteExtender1″
runat=”server”
FirstRowSelected=”false”
UseContextKey=”true”
CompletionListElementID=”Panel1″
CompletionListItemCssClass=”listitem”
CompletionListHighlightedItemCssClass=”hoverlistitem”
>
</Ajax:AutoCompleteExtender>
<asp:Panel ID=”Panel1″ runat=”server” style=”font-family:Calibri; font-size:medium; color:White;”>
</asp:Panel>

The panel, Panel1 is defined to display the auto-complete items in a particular font.

The styles for the auto-complete items are defined as follows (in a .css file):

.listitem {

     background: SteelBlue;

     color: White;

}

.hoverlistitem {

     background: Blue;

     color: White;

}

The AutoCompleteExtender’s TargetControlID is set to “txtCity”. The service path and service method refer to the web-service that will return the list of cities:

ServicePath=”cities.asmx”

ServiceMethod=”GetCities”

In the ASP.NET code-behind, define the following methods:

In the Page_Load event-handler, insert the following:

if (!IsPostBack)
{
      ddlCountry.DataBind();
}

Define the selected index changed event-handler for ddlCountry:

protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
try
    {
         SqlDataSource2.DataBind();
         AutoCompleteExtender1.ContextKey = ddlCountry.SelectedValue;
     }
catch (Exception ex)
    {
         ErrorLabel.Text = “ddlCountry_SelectedIndexChanged(): ” + ex.Message;
     }
}

The country code (ddlCountry.SelectedValue) is assigned to the ContextKey parameter of the AutoCompleteExtender.

The following event-handler is optional and used only when a GridView will be populated with matching cities:

protected void txtCity_TextChanged(object sender, EventArgs e)
{
    try
    {
     SqlDataSource2.SelectCommand = @”SELECT CITIES.NAME FROM CITIES, COUNTRIES
     WHERE COUNTRIES.CC = CITIES.CC
     AND COUNTRIES.CC = @CC
     AND CITIES.NAME LIKE ‘” + txtCity.Text + “%'” + // Add a % before txtCity.txt to match    the pattern anywhere in the city name
     @”ORDER BY CITIES.NAME”;
     SqlDataSource2.DataBind(); 

     GridView2.DataBind();
    }
    catch (Exception ex)
    {
      ErrorLabel.Text = “txtCity_TextChanged(): ” + ex.Message;
    }
}

Now define the web-service that will be consumed by AutoCompleteExtender1:

using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Configuration;
using System.Windows.Forms;
using System.Web.Configuration;

/// <summary>
/// Summary description for Cities
/// </summary>
[WebService(Namespace = “http://processwaresystems.com&#8221;)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]

// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Cities : System.Web.Services.WebService
{
string m_connectionString = ConfigurationManager.ConnectionStrings[“WhatIfGamesConnectionString2”].ConnectionString;

public Cities()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public string HelloWorld()
{
return “Hello World”;
}

[WebMethod]
public string[] HelloWorld2()
{
return new string[] {“Hello World”, “Hello India”};
}

[System.Web.Script.Services.ScriptMethod]
[WebMethod]
public string[] GetCities(string prefixText, int count, string contextKey) 
{
   try
   {
     //return new string[] { “A Test1”, “B Test2”, “C Test3” };

     string selectCommand = @”SELECT CITIES.NAME FROM CITIES, COUNTRIES
     WHERE COUNTRIES.CC = CITIES.CC 
     AND COUNTRIES.CC = ‘” + contextKey + “‘ ” +
    “AND CITIES.NAME LIKE ‘” + prefixText + “%’ ” + // Add a % before prefixText to match the         pattern anywhere in the city name
     @”ORDER BY CITIES.NAME”;

     //MessageBox.Show(selectCommand);

     SqlConnection Connection = new SqlConnection(“Data Source=                <machine_name>;Initial Catalog=WORLD;User ID=’Ganesh Gopalan’;Password=<password>”);

     SqlCommand cmd = new SqlCommand(selectCommand, Connection);
     cmd.CommandType = CommandType.Text;
     SqlDataAdapter da = new SqlDataAdapter();
     da.SelectCommand = cmd;
     DataTable dt = new DataTable();
     da.Fill(dt);

     if (dt == null || dt.Rows.Count == 0)
         return null;

     string[] l = new string[dt.Rows.Count];

     int i = 0;

     foreach (DataRow row in dt.Rows)
     {
         l[i] = row[“NAME”].ToString();
         i++;
     }

     return l;
}
catch (Exception ex)
    {
         MessageBox.Show(“GetCities(): ” + ex.Message + “\r\n” + ex.StackTrace);
         return null;
    }
  }
}

The HelloWorld and HelloWorld2 web-methods are purely for testing. The real work is done by the GetCities web-method.

Note that the signature for the web-method that will fetch the cities must match the following signature exactly (including parameter names), or else the auto-complete will not work (e.g. if you change the first parameter from prefixText to prefix, you will get no results):

public string[] GetCities(string prefixText, int count, string contextKey) 

Screenshots of the database (country codes and country names and cities for country code = ‘AS’ (Australia)):

Countries

Figure 1 – Countries table.

CitiesAustralia

Figure 2 – Cities table showing cities for Australia. The total no. of cities for all countries is 2,881,140.

AutoComplete

Figure 3 – Autocomplete for cities beginning with ‘Mel’ for Australia.

The cities are available courtesy GeoDataSource.com (World Cities database free edition) and have been populated into the database.

That’s it. Comments and feed-back are welcome!

 

 

Privacy Policy

We do not collect any private information and do not distribute it under any circumstances. In the case of location based services, your information is used purely to locate you and is not disseminated or used in any form other than in the app in which it is collected.

Payment information for the app is managed by Microsoft and Microsoft’s privacy policy applies there.

Pushkar Mela

The Pushkar Mela or Pushkar Fair was held between November 9th and 17th, 2013 at Pushkar, Rajasthan, India. Throngs of tourists (both Indian and foreign) filled the street through the main marketplace in Pushkar. Some were there to visit the only temple in the world built for Brahma. Others were there to take a dip in the holy Pushkar Lake which is considered auspicious, especially on Karthik Poornima (November 17).

OLYMPUS DIGITAL CAMERA

Pushkar Lake

OLYMPUS DIGITAL CAMERA

Langurs near one of the ghats of Pushkar Lake

OLYMPUS DIGITAL CAMERA

A young visitor in traditional head-gear

However, the main attraction is the vast collection of camels and horses for sale. There were plenty of camel cart rides and camel rides, as well as camels being decorated or shorn to create exquisite patterns on their bodies.

The foreign tourists like this part of the fair the most and many could be spotted with cameras sporting huge telephoto lenses.

During the sales proceeds, camels and horses can go for as much as Rs. 50,000 to 70,000 apiece.

OLYMPUS DIGITAL CAMERA

Beautifully decorated camel

OLYMPUS DIGITAL CAMERA

Decorated camel with cart

OLYMPUS DIGITAL CAMERA

Camel with exquisite pattern

OLYMPUS DIGITAL CAMERA

A large number of camels camped in the desert

OLYMPUS DIGITAL CAMERA

Horses for sale

OLYMPUS DIGITAL CAMERA

Horses feeding

OLYMPUS DIGITAL CAMERA

Closeup of camel decorations

OLYMPUS DIGITAL CAMERA

Chilims or clay pipes

You can also see Rajasthani men and women in traditional attire.

OLYMPUS DIGITAL CAMERA

Rajasthani men in traditional attire

OLYMPUS DIGITAL CAMERA

Men and women in traditional attire

Later during the fair there are other forms of entertainment such as traditional Rajasthani style dancing and other performances, but I did not stay for that.

Overall, a breathtaking experience and a must-see, at least once, for those who have not been there!

My Experience with App Development for Windows Phone

Some time back, I decided to become a Windows Phone developer. You have to sign up through http://dev.windowsphone.com and pay a small fee. For US based development the fee is $19 per year, while if you’re in India it is INR 860.

I developed 2 versions of a Photo Calendar. A free version that displays only the months in the current year and a paid version that is a perpetual calendar that allows you to jump to a random month or year. The app includes 60 stunning photos taken in the US, Cayman Islands and India.

The target platform is Windows Phone 7, so the app runs on both WP7 and WP8.

The process consists of uploading your XAP (app) file, your icons and 8 screenshots for potential users. The icons include an app tile that is 300 x 300 pixels and a background image that is 1000 x 800 pixels. The background image could be used by the Windows Phone Store to showcase your app.

WPSSubmitApp

The Windows Phone Store app submission page.

If your application targets Windows Phone 7, you can upload up to 8 screenshots in WVGA i.e. 480 x 800. If, however, you target Windows Phone 8, you may have to upload screenshots in higher resolutions as well e.g. 768 x 1280 and 720 x 1280.

These images are in addition to the standard icons that are part of the XAP. The standard icons include the ApplicationIcon.png file, the Background.png file and the SplashScreenImage.jpg file. These are not uploaded separately.

On the Windows Phone Developer website, some information is automatically read from your XAP file, such as the version and size.

Once all the screenshots, XAP(s) and icons have been uploaded, Microsoft will begin the app certification process. This took about 5 days for me. Microsoft probably checks for crashes and app responsiveness. Once the app passes certification, you will get an e-mail from Microsoft that your app has been accepted.

Congratulations

Message saying that the app has passed certification.

If you have a Windows Phone, you can check out the free version (Photo Calendar Single) here: http://www.windowsphone.com/en-us/store/app/photo-calendar-single/3800f2b4-f2bf-4a2d-8cf8-4d2b335e3652

Photo Calendar Multi (the paid version with more features) can be found here: http://www.windowsphone.com/en-us/store/app/photo-calendar-multi/b592482e-ecf6-4fc0-90d8-4de0eb175a83

Comments and feedback are welcome.

PhotoCalendarSingleWPStore

The Photo Calendar Single app on the Windows Phone Store.

PhotoCalendarMultiWPStore

The Photo Calendar Multi app on the Windows Phone Store.

P1020917

The Photo Calendar Single app ready to installed on a Samsung Windows Phone.

 

Developing for Windows Phone 8

The Windows Phone 7 SDK can be installed on Windows 7, but the Windows Phone SDK 8.0 can be installed only on Windows 8.

Also, in order to use the emulator for Windows Phone 8, certain conditions need to be met on the system that will host the development.

  • The system must support Hyper-V (virtualization software on Windows).
  • The processor on the system must support Second Level Address Translation (SLAT), also known as Extended Page Tables on Intel processors. These are supported by any processor that begins with I such as core i3, i5 and i7.
  • Virtualization must be enabled in the BIOS.
  • Data Execution Prevention must be enabled.

A tool called Coreinfo, available at http://technet.microsoft.com/en-us/sysinternals/cc835722 can be used to check if the above features are supported.

Coreinfo -v must be run  from a cmd prompt with administrative privileges.

coreinfo

Coreinfo output on a system with virtualization and SLAT, but with Hyper-V absent (the – indicates the feature is absent, while the * indicates it is present).

Some systems (e.g. laptops bought in “emerging markets” such as India) have a basic edition of Windows known as Windows 8 Single Language or Windows SL. However, Windows 8 SL does not support Hyper-V, a must for running the Windows Phone 8 emulator. As a result, you may have to upgrade your edition of Windows 8 SL to Windows 8 Professional. This can be done by going to Computer Properties and selecting “Get more features with a new edition of Windows 8”. You will then be prompted to purchase a product key online.

Once the key is purchased, you will get a dialog that says “Adding New Features”, “This might take a while depending on whether there are updates. Your computer might restart more than once”. That’s it. There are no ISOs to download, no DVDs to use – the additional features (including Hyper-V) are installed automatically from the local Windows 8 SL installation on your hard drive.

SystemInfo

The “Get more features with a new edition” link in System Info (from Computer | Properties), on a system running Windows 7.

WindowsFeatures

From Control Panel | Programs | Turn Windows Features on or off. A system with Hyper-V absent. Once Hyper-V is installed, it will show up here.

Once Hyper-V is installed, you should be able to run the Windows Phone 8 emulator.