Retrieve Coordinates from Google Maps on Click

Technical Level: Beginner

Problem: Retrieve the coordinates from a click event on html/javascript google maps.

Required Tools:

Solution:Very simple solution, a Google map click event passes the coordinate as a parameter. I Use JQuery in my implementation of this map because I intend to make AJAX calls. If you are not familiar with JQuery, then the following codes can be substituted in the as follows:

$("#SomeIDOfATextBox").val("Some value");
//Can be replaced by:
document.getElementById('SomeIDOfATextBox').value = "Some value";

Below is the javascript used to setup the map and grab the coordinates:

var map;
function initialize() {

   if (GBrowserIsCompatible()) //a check to make sure the browser is compatible for GEmaps.
   {
     map = new GMap2(document.getElementById("map_canvas")); //assign the div to map var
     map.setCenter(new GLatLng(18, -77.4), 13); //centering the location
     map.setUIToDefault(); //setting the default location to the center.

    //The GE event for clicking the map.
    GEvent.addListener(map, 'click', function(overlay, point) {
    map.clearOverlays(); //clearing the previous marker
    var lati = point.lat(); //Function to extract latitude
    var longi = point.lng(); //Function to extract longitude
    var marker = new GMarker(new GLatLng(lati, longi), { draggable: false }); //Setting the marker to clicked location
    map.addOverlay(marker); //adding the marker to the map
    //JQuery function to assign the lat and long to the values of textboxes.
    $('#LatTxt').val(lati);
    $('#LonTxt').val(longi);
   });
}

//This JQuery Function operates almost the same as the onload function, except more earlier
$(function() {
   initialize();//call to initialize the map.
}
<div id="map_canvas" style="width: 600px; height: 400px;">
 </div>
<label>
 Latitude
 <input id="LatTxt" disabled="disabled" type="text" />
</label>
<label>
 Longitude
 <input id="LonTxt" disabled="disabled" type="text" />
</label>

Below is a screenshot of my extended version (I’ll show how to get Geo-coded locations in a next post):

PS. Google Geo-Code service sucks for Jamaica. I’m now seeking alternative data sets.

Claro Jamaica Internet Review

Since there are no review sites for products and services in Jamaica, I’ll just rant about my little problem on my blog in the hopes of saving potential customers from getting ripped off. This review is based on northern St. Elizabeth location for Claro Internet Service . They claim they do not do refunds if you get a service, even if your service is crap.

Review: Rating based out of 5.

  • Product Service – 2.
  • Customer Service – 0. (Cust Serv is a complete joke).
  • Setting up – 5. (They make no joke in collecting your money and sign you up).

My Rant

I was informed by claro representatives at 2 different resellers and customer service that in my location, EDGE is available. I bought a claro modem with 1 month’s internet service, brought it to my area in which I indeed have EDGE. So before I get into the technical aspects of my rant, I’ll give a little lesson on the technologies I am working with:

There are multiple types of data transfers that Claro offers. Their best type is 3G. In my location I have GPRS and EDGE. These are the speeds that these 2 data transfer should give from this network:

  • GPRS – 7kbps down.
  • EDGE – around 25kbps down.

Now back to my rant. The modem frequently switches back and forth between GPRS and EDGE, but most of the time, it stays on EDGE. When on EDGE, I get a maximum down rate of 2kbps. Yep 2kbps of the 25kbps of what I should be getting. When it switches to GPRS, I get a maximum down rate of 7kbps. So here we have it, the lower performing service is out performing the better service.

I waiting a day or two before contacting customer service, they turned out to be very nice people who understood my problem very inefficiently and auto responded with “We are aware, technicians are working on the problem”. So after a few calls to their customer care service, I gave up and turned to a governmental organization called Consumer Affairs Commision. This very nice lady was assigned to my problem, she contacted Mr. Randolph Nelson (Customer Service Manager from Claro).

Mr. Nelson along with a technician tried to temporarily fix the service on GPRS until they fix the cell site in the area so EDGE would work properly. Weeks passed, each time of contact, telling me that they have not visited the cell site yet. 2 months passed until I told the assigned technician I need a refund. She claimed she would pass it on to Mr. Nelson, who suddenly decided to stop replying to my emails. The lady at consumer affairs contacted him again to inform him about the refund, she replied to my email with the following:

Mr. Nelson has just responded to me by stating thatClaro wouldn’t be able to refund you because there is connectivity on the modem, just not at the speeds you would like.

This is the last I have heard from them since I bought the modem 4 months ago with 1 month of unacceptable internet service. In total, I wasted around $11,700.00 JMD on this modem and the 1 month service.

I’d like to thank Petra Young, the lady who looked after my case from consumer affairs. I’d also like to thank Randolph Nelson, who was just doing his job (I think hiding away from my emails is a part of Claro’s internal rules).

Conclusion

Claro is a typical Company that does not care about customers. They are unethical and their customer care reps are well trained with bullshit. I can safely say, being a digicel customer, they’re customer care is on par with Claro’s. Their prices are also very high, but because there is not much competition, people run to them as I did (for a lower quality service).

Names may or may not be removed upon request.

ASP.NET Client-Server tool.

This is a tool I whipped up. Its a simple one-click application that acts as a localhost server and runs an asp.net application.

The core works fine without any crashes yet. I need to do a few improvements so I can submit my game in 1 package and start the project without navigating to it. Stay tuned for more updates on this little application.

The download is located on the left in a Box.net widget. The file is called XorianaServer.exe.

Requirements:

My machine is vista sp2 and I’ve tested it on a windows 7 also. But this is what I think it requires:

.NET 3.5 SP1.

Official Description:

Xoriana Server is a local client server that can run ASP.NET 3.5 and under projects the same way visual studio’s internal server does.  (WebDev.WebServer.exe) There are many servers like this around including those used by commercial 3rd party control creators such as Telerik, ComponentOne and Infragistics. This is where I got my idea from.

Instructions:
Start XorianaServer.exe.
Browse to the root path of where you project is located. That is for example, the folder that Default.aspx is located.
There is a default port and virtual path set, if they are already in use, you can change them.

License:
Anyone is free to use this tool, distribute it or whatever.

Future Updates:

  1. GUI tuneup, icons, etc.
  2. Parameter Passing.
  3. Minimize to System Tray.
  4. Memory Optimization. (This currently uses 23MB+ Ram)

Merged Search Textbox and Button

soon to come

Windows Live Writer Facebook Sharing Plugin

Technical Level: Beginner

Content:

  1. Creating a Windows Live Writer  Plugin.
  2. Performing instructions after a blog is posted with Windows Live Writer.
  3. Using the Facebook API with the .net framework to share a link.

Tools Used:

  1. Visual Studio 2008.
  2. .Net Facebook Developer ToolKit.
  3. Windows Live Writer.
  4. Facebook Account.

Solution:

Incomplete. Check back in a week.

Facebook Setup

Developing the Plugin


Forming Game Development Team Jamaica – Imagine Cup 2010

Hello,

I am trying to form a team located in Jamaica for the Imagine Cup 2010 Game Development Competition. We do not have to be at the same university or location. If you feel you can step up to the challenge and join my team, leave a comment with contact information and what skills you can offer which is listed below for each person. We shall meet at least once a month, work across the internet and telephone calls, we all should have internet access 24/7 with access to high speed internet at least 1-2 hour a day.

I am a .NET developer with relevant experience in listed technologies for the game i have in mind below.

  • C# – my primary .NET language
  • Silverlight (XAML, 2D, 3D, Animation, UI structure)
  • Windows Azure (live services, sql services, .NET services)
  • Live Mesh
  • WCF
  • SQL Server 05/08 – Data connections with ADO.NET Entity Framework and LINQ

I am looking for 3 other people with the following skills:

Person 1: (Frontend, User Interaction, User Input person)

  • Versed in latest .NET Framework. (preferably C#)
  • Silverlight. (Graphics, 3d, 2d, hit testing, animation great HCI skills)
  • XNA skill is a plus.
  • Music Dev is a plus.
  • 3D programming skills is a plus.

Person 2: (Backend, server, algrithms person)

  • Versed in latest .NET Framework. (preferably C#)
  • Silverlight. (Algorithms)
  • WCF. (Database interaction, ADO.NET Entity Framework or any LINQ experience required)
  • XNA skill is a plus.
  • Music Dev is a plus.

Person 3: (Graphics, Presentation Person)

  • High level of HCI skills.
  • Graphics (2d texturing, 3d modeling, great conceptual design skills)
  • Must be extremely good at presenting and marketing (advertising)
  • Able to break down complex solutions and problems into simple presentable information.

The key for this team to be sucessfull is DEDICATION meaning everyone will be pulling their own weight, having fun developing a game in an online team environment and have the will to learn and gain knowledge of emerging technologies.

Imagine Cup 09 results

We did not make it to the top 12. I think we got what we worked for so judging was fair and square. What ever the team put out is what we got back. The results sourced from the imagine cup blog is:

Software Design

First place: Romania — SYTECH

Second place: Russia — Vital Lab

Third place: Brazil — Virtual Dreams

Embedded Development

First place: South Korea — Wafree

Second place: China — iSee

Third place: Ukraine — Intellectronics

Game Development

First place: Brazil — LEVV It

Second place: United States — Epsylon Games

Third place: United Kingdom — Sanquine Labs

Robotics and Algorithm

First place: Czech Republic — Lukáš Perůtka

Second place: Canada — Byron Knoll

Third place: China — Lin Fuming

IT Challenge

First place: Romania — Cosmin Ilie

Second place: China — Wu Chang

Third place: Bolivia — Miklos Cari Sivila

MashUp

First place: United States — CURIOS

Second place: Poland — Monastery of Innovations

Third place: Singapore — PlanetKY

Photography

First place: Croatia —Voodoo Delirium

Second place: Singapore — Woolgathering

Third place: Japan — Terada

Short Film

First place: United Kingdom — Fulham Four

Second place: India — ChennaiCoolers

Third place: Ukraine — Just4Fun

Design

First place: Brazil — Willburn

Second place: United States — eXchangeFun

Third place: France — Paindepices

Interoperability Award:

First Place: Brazil — Proativa Team

Second Place: Poland — Fteams

Third Place: Jordan — ECRAM

Unlimited Potential Design for Development Award:

First Place: Malaysia — COSMIC

Second Place: China — Unique Studio

Third Place: Malaysia — Capricorn

Unlimited Potential MultiPoint Education Award:

First Place: India — Trailblazers

Accessibility Award:

First Place: Saudi Arabia — ATST

Accessible Design Award:

First Place: United States — eXchangeFun

Parallel Computing Award:

•First Place: India — Biollel

Tablet Accessibility Award:

First Place: United States — Auratech

Second Place: Brazil — IC-UNICAMP

Live Services Award:

First Place: France — Help’Aged

Second Place: Serbia — BrainWave

Windows Mobile Award:

First Place: Croatia — Team Explorer

Second Place: Indonesia — Big Bang

Third Place: Brazil — Virtual Dreams

H.E. Mrs. Suzanne Mubarak Special Award:

First Place: Poland — kAMUflage

Second Place: Egypt — Big Buddy

Third Place: France — WikiChildProtect

Preparation for Imagine Cup 09 Finals

Today is sunday, the finals is Saturday and I’m still coding. No presentation script has been written for the demo as yet. We have our storyboard and outline for the demo. I need to upload our Azure project to the live windows azure server and our silverlight application into the live mesh and do some testing against those.

What needs to be done for finals:

  1. Complete local and live testing.
  2. Implement Crop rotation in the map.
  3. Configure map backend to work with elastic farming logic.
  4. Hook up live data to Farm and Crop Tab.
  5. Complete Crop Adding for Advanced.
  6. Setup PDA alerts tab with Mesh.

All of this can be done in the next 3 days if i do not sleep… else, I’ll be coding on the plane to Egypt …

Silverlight/WPF – Binding object properties to multiple elements

Technical Level: Beginner

Problem: Soon to come….

Generating Silverlight WCF Proxy Class Manually

Technical Level: Intermediate

Problem: For some developers, when using visual studio’s built in service reference proxy generator tool gives an error when generating the client code. This is when I try to add a service reference in the solution explorer of visual studio. Usually it would say “Not support relative URI” when it reaches the section to generate the proxy class. This problem occurred in silverlight 2.0 beta, 2.0, 3.0 beta development projects for 2 different machines.

Required Tools:

  • Silverlight Tools and SDK (Works with Silverlight 2.0 +)
  • Visual Studio

Solution: My solution only works if visual studio partially creates the webservice in the solution explorer. Meaning if you browse to the physical location of the project and view the Webservice folder in the Service References folder created by visual studio, there is a file called “Reference.cs” there.

If visual studio does not create anything at all for you, you can create this file and paste in the generated code(method shown below). You can add this file anywhere in your project.

  1. First of all, start the WCF service. Mine is hosted at “http://localhost:81/CME/CMEService.svc”.
  2. Go to this directory “C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Tools”  and make sure “SlSvcUtil.exe” exists. If that directory does not exist, just browse the silverlight directory for the SlSvcUtil.exe program. This tool generates the client/proxy code from the wsdl of your WCF Service.
  3. At the same directory as the tool, make sure that “System.Windows.dll” exists and also make a copy to the root of the C:\ drive. If you do not have this dll, search for it in the .NET folder or do a search of Program Files folder.
  4. Open command prompt ( Press Wnd + R then type ‘cmd’ ).
  5. For ease of use, change your directory to the folder of your tool, eg “cd C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Tools”
  6. Now to generate the service reference code. Type in command prompt {slsvcutil {Location of my wcf service} l /edb /namespace:”*,{Namespace in client project}” /ct:System.Collections.Generic.List`1 /r:”c:\System.Windows.dll”}. For eg. –  slsvcutil http://localhost:81/CME/CMEService.svc?wsdl /edb /namespace:”*,RAINLight.CMEWService” /ct:System.Collections.Generic.List`1 /r:”c:\System.Windows.dll”. You can change your default list type to ObservableCollection or any Generic type you want to be created as data is received from the service.
  7. A c# file with the generated code will be created in the folder of the tool with the name of the WCF Service. eg. “CMEService.cs”. Copy the contents of this file into the “Reference.cs” file in your project or the file you manually created to store this proxy class.

Conclusion: I have no idea why visual studio’s tool wont work and neither do I have any idea how to fix it. This problem shows up on 2 seperate machines with each having their own installation files of visual studio, silverlight tools straight from Microsoft’s website.