Archive for the 'Programming' Category

Some Fun and Useful Google Map Apps

I have been experimenting with Google Maps for a recent project and needed a tool to get latitude and longitude for any location. Here are two tools written to get the same:

  1. Get Latitude and Longitude for any address you enter
  2. Get Latitude and Longitude for any place you click on the map

These should be fun to play with and one can use those geocodes (latitude and longitude) in various applications.

Google now has support for calculating geocodes for any location (earlier people had to use Yahoo to get the geocodes)

Some other fun Google Map apps to try out:

  1. America’s top 25 meanest drivers cities
  2. A set of interactive Google Maps on different categories on the topic of the 7 Wonders of the World
  3. Ever wondered which map technology is better, Google maps, Live Maps or Yahoo Maps? Try this tool and see for yourself
  4. Da Vinci Code Locations
  5. Forbes Magazine list of the Drunkest Cities in America
  6. Google Maps + Craigslist to create a visual housing search page via dynamic overlays of Craigslist home listings on Google Maps
  7. Up-to-date gas price search with Google Maps station display
  8. Track your packages with Google Maps and RSS feeds! Track UPS, FedEx, USPS, and DHL
  9. Map a phone number area code to a location
  10. Helps you determine if you are paying too much in rent. Enter an address, apartment size, and rent. It maps nearby units and shows a meter of your price versus min, max and average

I am developing a special section called “tools” on this site, where I will put utility and fun tools and apps.

Popularity: 4% [?]

Find number of years, months and days between two dates using C#

Recently I ran into a situation where I had the start date and the end date and had to store the start date and the difference between the end and the start date (in terms of years, months, days) as string.

Here is a C# code to do that:

public static string DateDiff(DateTime startDate, DateTime endDate)
{
   string timeStr = string.Empty;
   int yr = 0;
   int mth = 0;
   int days = 0;

   TimeSpan ts = new TimeSpan();
   ts = endDate.Subtract(startDate);
   yr = (ts.Days/365);

   do
   {
       for(int i=0; i <= 12; i++)
       {
         if(endDate.Subtract(startDate.AddYears(yr).AddMonths(i)).Days > 0)
         {
             mth = i;
          }
          else
          {
             break;
          }
        }

        if(mth > 12)
           yr = yr + 1;
    }while(mth > 12);

    days = endDate.Subtract(startDate.AddYears(yr).AddMonths(mth)).Days;

    if(yr > 0)
                timeStr += yr.ToString() + "y";
    if(mth > 0)
                timeStr += mth.ToString() + "m";
    if(days > 0)
                timeStr += days.ToString() + "d";

     return(timeStr);
}
How would you have done this?
Technorati tags: , , , , ,

Popularity: 5% [?]

Programmatically Change The Data Range For A Chart In Excel

Sometime back I had to figure out a way to change the data range for a chart in excel dynamically at run-time based on certain conditions being met. This post covers provides a simplified version of the code with essential items and logic in it to help you put with the process.

The following function runs when the excel file is opened. It runs through a loop for all the charts in ”Sheet1″ and then finds a specific chart using the chart name (.Name). It reassigns a revised range for the various series of data in the chart.

Code:

Sub Auto_Open()
Dim chartCount As Integer
Dim i As Integer
Dim colName As String
Dim rangeStr As String
Dim chartOnSheet As Chart  

chartCount = ActiveWorkbook.Worksheets("Sheet1").ChartObjects.Count
For i = 1 To chartCount
  With ActiveWorkbook.Worksheets("Sheet1").ChartObjects(i).Chart
   If .Name = "Sheet1 Chart 103" Then
      colName = "D"
      rangeStr = "A84:" & colName & "84"
      .SeriesCollection(2).Values = Worksheets("Sheet1").Range(rangeStr)
      rangeStr = "A91:" & colName & "91"
      .SeriesCollection(3).Values = Worksheets("Sheet1").Range(rangeStr)
      rangeStr = "A85:" & colName & "85"
      .SeriesCollection(4).Values = Worksheets("Sheet1").Range(rangeStr)
   End If
  End With
Next i
End Sub

Technorati tags: , , ,

Popularity: 6% [?]

DuckSoup - Technorati API library In PHP

Kailash Nadh has published an API library in PHP for Technorati named DuckSoup.

The library supports all the Technorati APIs namely:

  • CosmosQuery
  • SearchQueryGetInfoQuery
  • OutboundQuery
  • BlogInfoQuery
  • TagQuery
  • TopTags
  • AttentionQuery
  • KeyInfo

It produces data in organized trees e.g.:

Read more »

Popularity: 2% [?]

Beginner Developer Learning Center From Microsoft

If you are interested in learning Microsoft .NET technologies from scratch then you are in luck. Microsoft has launched a new centralized learning environment on the web called Beginner Developer Learning Center.

I really like the way things are organized on the site. It will definitely help even a non-programmer to pick up things and not overwhelmed by the content. The site has huge library of learning content starting from the very basics and guiding you through step-by-step into becoming a fully-fledged developer.

The content is organized into two development tracks: Windows Development and Web Development. You can choose the track of your liking. They have nice lesson with options to follow in VB .NET or C#. The web track has extensive coverage of ASP .NET. 

Within a particular track the lessons are organized in 3 tiers, allowing you to choose lessons based on your skills:

  • Tier 1: Great place to start for someone new to programming
  • Tier 2: Cover a lot of the core concepts of Windows and Web development and assume prior understanding of foundations of .NET
  • Tier 3: Expand your knowledge of Windows and Web development with more advanced concepts such as data access and debugging

You can read the lessons online, download them as PDF files and even rate the lessons.

It would have been nice if you could login and track your progress on the lessons and the system kept a record of what all you have completed.

Popularity: 3% [?]

min-width CSS issue fix for Andreas04 template

One of the blog directories got back to me saying that my blog was not behaving well in IE. I am using Wordpress 2.0 along with Andreas04 2.0 by Tara Aukerman.

Myself being an avid FireFox user, had not done extensive testing on IE for my site. What was happening was that thing were getting squeezed when you decrease the width of the IE window and they were not even stopping at the min-width set to 760. The result was that all my sidebars used to drop out.

It seems that this due to difference in the way IE and FireFox understand min-width CSS property. I found a fix for it here.

Here is what you need to do:

1) Put the following style tags in your Style sheet file:

/* changes to fix the min-width problem */
.fixcontent {
border:0px solid #000;
padding:5px;
}

* html .minwidth {
padding-left:920px;
}

* html .fixcontainer {
margin-left:-920px;
position:relative;
}

/*\*/
* html .minwidth, * html .fixcontainer, * html .fixcontent,
* html .fixlayout  {
height:1px;
}
/**/ 

2) Modify the container id style so that min-width = 920 (you can choose any other number but make sure all .minwidth and .fixcontainer above have the same number (920 in this case)

3) Modify your index.php and Single.php files from the ThemeEditor on the Admin Panel to create nested divs like this:

<div id=”container”>
<div class=”minwidth”>
<div class=”fixlayout”>
<div class=”fixcontainer”>
<div class=”fixcontent”>

Make sure you close all the divs at the end of the page.

That should solve your problems and get you going. I hope that this fix is made an integral part of the template.

Technorati Tags: min-width, CSS issues in IE, Andreas theme, Wordpress

Popularity: 4% [?]

Scratch it!

ScratchScratch is a new programming language that lets you create your own interactive stories, games, music, and art. It has been developed at the MIT Media Lab’s Lifelong Kindergarten group.
Scratch is now available as a free download!

John Maloney of the MIT Media Lab’s Lifelong Kindergarten group had following things to say about Scratch in an interview he gave to The Weekly Squeak :

Since January of 2003 I have been working in the Lifelong Kindergarten group at the MIT Media Lab on a media-rich programming environment called “Scratch” (http://scratch.mit.edu). Scratch combines ideas from Squeak EToys, CricketBlocks (the precursor to PicoBlocks, see http://www.picocricket.com), and Logo to create a playful and engaging introduction to programming. Like EToys, Scratch programs are written by assembling colorful command blocks on the screen to control one or more sprites. However, Scratch has fewer commands and objects and more “training wheels” to get you started.

Scratch was developed under an NSF grant and is aimed at youth at after school centers. As we’ve developed Scratch, we’ve worked closely with the Computer Clubhouse, a network of 100+ after-school centers located in low-income areas in cities around the world. This is a very tough audience, since kids are free to choose what they want to work on and there is no “curriculum,” no classes, and no teachers. (The Computer Clubhouse relies on volunteer mentors.) Thus, we’ve worked hard to make Scratch be fun and easy to learn so youth will want to use Scratch and can figure out many things for themselves even if there isn’t a mentor around. But in addition to after-school computer centers, Scratch is also attracting attention from forward-looking teachers and educators, science museums, school computer clubs, and it has even been used as a first introduction to programming in several Harvard computer science classes.

[youtube jxDw-t3XWd0 nolink]

(Scratch Intro Video) 

Programming in Scratch is like assembling a puzzle and all you have to do is drag and drop pieces of functionality, customize them and link them on a dashboard. It is fun, educating and addictive.
Scratch is available for Mac and Windows and a Linux version is expected to be rolled out by the end of 2007.

Popularity: 3% [?]

Microsoft’s AJAX Framework

 I have been following this tool since the time it came out first and was known as “ATLAS”. It is indeed a very powerful AJAX Framework which has a client side library component and server side component.  Finally the 1.0 release is out.

ASP.NET AJAX is a free framework for quickly creating a new generation of more efficient, more interactive and highly-personalized Web experiences that work across all the most popular browsers.

With ASP.NET AJAX, you can:

  • Create next-generation interfaces with reusable AJAX components.
  • Enhance existing Web pages using powerful AJAX controls with support for all modern browsers.
  • Continue using Visual Studio 2005 to take your ASP.NET 2.0 sites to the next level.
  • Access remote services and data directly from the browser without writing a ton of complicated script.
  • Enjoy the benefits of a free framework with 24×7 technical support provided by Microsoft.

Some commercial applications/web sites that are using the framework are:

Microsoft as usual has gone through extensive documentation and has posted tons of video tutorials for users to pick up and adopt the framework.

Incase you are interested in a comparison of this framework with other frameworks out there, please look at this page by Daniel Zeiss.

Popularity: 3% [?]

Next Page »

Technology Blogs - Blog Top Sites Blogarama - The Blog Directory Technology blogs Technology blogs blog search directory