Monday, August 24, 2009

Export Map Image URL From ArcGIS Server

Trust me, until now, I didn't find any code that does just that, so I decided to write my own.

When you press the tool it will extract the image from ArcGIS server Map into a URL Image that can be used to do various things. The image will be a snapshot of the current map including the symbology and the current enabled layers.

In the sample I open the image into a new Page. You can manipulate this URL (it looks like this http://yourserver/agsOutput/_ags_mapd106d2f23eff437a81c65aec65177759.png) in both the Server and the Client side to do whatever you want, like send it to Twitter, Facebook, email or simply print with a particular web template.

Don't bother yourself digging through the code, the code is few lines only and all written in this class "ExportImage.vb"


I hope you it will be of use. Enjoy

This is the source code in 9.2 VB.NET 2005.

Sunday, August 23, 2009

Firefox 3.5 is Buggy! (Poll)

Is it just me or is Firefox 3.5 has gone out of whack?

Since I installed it (both in my Mac and Windows) It never cease to give me the message "Well, this is embarrassing" or in my MacBook "We're sorry". I get this message approximately everyday.

I found the previous releases much more stable than this one, here some of the errors I've been getting in both windows and Mac.





Here is a quick poll


Do you find Firefox 3.5 unstable?










Saturday, August 22, 2009

A Cool Mashup of Google Maps + Google Earth + Yahoo Maps + Bing Maps


A lot of Maps applications are being developed recently. Each with its pros and cons, I recently wrote an article that compares Google Maps VS Bing Maps. People seem to like it.

So the Punch line, I decided to create a cool mashup that combines 4 Maps applications,
  1. Google Maps
  2. Google Earth
  3. Bing Maps
  4. Yahoo Maps
When you zoom or pan in Google Maps ALL 4 Maps are getting updated instantly!

Click Here for the MashUp

Your comments and suggestions are most welcomed.


P.S.
My website has been featured in Kim Kamando show in 1-9-2009

Friday, August 21, 2009

How to add Social Bookmarking to your Blogger (Sharing is Sexy)


Writing great content is indeed the best method to make your blog popular. It would be even greater if you could allow people to easily share your posts over their favorite social media.

Sharing is Sexy is one of the easiest and coolest way to bookmark your posts. I just installed it in my blog, thought it might be interesting to add it to your blog too.

For Blogspot
Follow this link for the full tutorial for blogspot users.

For Wordpress
Wordpress users its actually a built-in plug-in download it here.

I discovered it from this post

Thursday, August 20, 2009

Tuesday, August 18, 2009

An Idea: Vehicle Reader



Traffic Police (in Bahrain) make a phone call to the main office to get the details of a given car by specifying the plate number.

So if they want to know if a car is registered or not, they either stop the car or take the number and call the office.

The Idea
Here is the idea with a proof of concept that make this process much easier.

Install a Gadget in Police cars that can scan and read and interpret Cars plat numbers. The plate no. is sent via a GPRS to a web service where it connects to the Car registration database and fetch all these information.

1. Registration Date
2. Number of Tickets
3. Owner Name
4. Last Ticket date
5. Car Color
6. Car Picture
7. Number of Accidents
8. Insurance information

Here is the beauty of all these, it directly displays these information with a green matrix like font on the Car front mirror.

Now the police officer just points that reader on a given car plate number while driving to fetch all this information, and only if necessary he stops the car.

I don't know if this is already implemented but I guess it will be an added value. Moreover its not so expensive to develop.

Saturday, August 15, 2009

CodePaste: Share your Code Online Easily

Ever wanted to share some code snippet in your blog or in a forum? You know how ugly it becomes when you directly pasted it there. Work with the tabs and variable declarations

CodePaste.net is a great site I found allows you to share code snippets, format it based on the programming language and allows others to add comments too.

It supports the following languages
  • Visual Basic .NET
  • HTML, ASP.NET, JavaScript
  • JavaScript
  • CSS
  • XML
  • SQL and TSQL
  • Power Shell (Monad)
  • FoxPro
  • Java
  • C++
It also has an API for developers who want to utilise this great service.

Tuesday, August 11, 2009

Free Prize Marketing - My Story with Nissan

Kids used to buy Kellogg's Corn flakes just for the toy that comes with it. That toy costs almost nothing to Kellogg's and yet it generates huge sales.

Kellogg's folks placed a prize with no cost, lets call it a free prize.


Nissan Car Service Story
I went to service my car yesterday at Nissan Service Center. They told me it will be ready tomorrow "We'll call you, sir". They offered me a free ride home, I liked that. (This was a free prize)

Lost Prize #1: Rent a car
Since I didn't have a car I needed to rent one. So I went to Budget.

How much it will cost to provide the customer with the option to rent a car for (8BD) 20$ a day! It is better then sending him to Budget.


Lost Prize #2: Time and Convenience
Today, they called at 8:30 am, "Your car is ready, sir". Great, now how can I go and take the car and come back to work? Where shall I leave the rented car? So I went home with the rented car and asked my father to take me to the service.

I lost 4 work hours due to traffic.

Nissan have my address, why not to ask the customer if he wishes that Nissan delivers the car to his address? Add a 3$ or make it free!Lost Prize #3: Fueling the Car
When I received my car it was clean (Another free prize), I paid 80 BD (220$) for the total service. But the car was out of gas.

Fuel the car for the customer, he will notice.
Spreading the Word
Fuel the car for the customer, he will notice. Nissan had 3 potential free prizes and they lost it. If I had these services, I will go and tell all my friends about this service, and maybe just maybe they will come to try it and they tell their friends.

How many Free Prizes are there in Your Business?
You too, think how many possible free prizes are there. Maybe you can add a free prize to your product?

I recommend reading Seth book Free Prize Inside.

Sunday, August 9, 2009

18 Twitter Books


I have compiled a list of Twitter books, didn't expected this large sum of Books to be written for Twitter.

  1. Twitter Power: How to Dominate Your Market One Tweet at a Time by Joel Comm, Anthony Robbins, and Ken Burge
  2. The Twitter Book by Tim O'Reilly and Sarah Milstein
  3. Twitter Tips, Tricks, and Tweets by Paul McFedries and Pete Cashmore
  4. Twitter For Dummies by Laura Fitton, Michael Gruen, and Leslie Poston
  5. Twitter Revolution: How Social Media and Mobile Marketing is Changing the Way We Do Business & Market Online by Warren Whitlock and Deborah Micek
  6. Twitter API: Up and Running: Learn How to Build Applications with the Twitter API by Kevin Makice
  7. twitter means business: how microblogging can help or hurt your company by Julio Ojeda-Zapata
  8. The Twitter Technique by Elliot Webb
  9. Everything twitter - From Novice To Expert: The Unofficial Guide to Everything Twitter - THE BLUE BOOK (Black & White Edition) by Monica Jones and Steve Soho
  10. Twitter: Free Social Networking For Business - 100 Success Secrets To Increase Your Profits and Sales Using Twitter Business Strategies by Daniel Clark
  11. Twitter: How Short Messages Can Make A Big Difference To Your Business by Joel Comm
  12. The World According to Twitter by David Pogue
  13. All a Twitter: A Personal and Professional Guide to Social Networking with Twitter by Tee Morris
  14. Twitter in Plain English by Lee & Sachi LeFever
  15. Twitter Top Success Secrets and Best Practices: Twitter Experts Share The World's Greatest Tips by Paul Hall
  16. Underground Twitter Secret Manifesto by Dean Shainin
  17. Getting Started with Twitter For Dummies by Laura Fitton, Michael Gruen, and Leslie Poston

More Twitter books here .

Wednesday, August 5, 2009

6 ways to optimize ArcGIS Server

I wrote a previous post about ArcGIS server performance part1 where I focused on the development reasons of why ArcGIS Server Performance is degrading. In this post though I'm going to list a quick methods I usually use to boost the performance.

We recorded new episodes dedicated just for teaching ArcGIS Server, click here

Here I compile 6 ways to optimize ArcGIS Server

Optimizing ArcGIS Server
In my experience, ArcGIS Server performance degrade is mostly due to the "bad" customization of the product and adding some tools that just don't work in harmony with ArcGIS Server's black boxes. I already talked about this in the first post.

I would try these tips to increase the performance

1. Clear logs
The larger the log file get the more time it requires to update, so cleaning it from time to time slightly increase the performance. Remember those files don't contain errors only they contain every single context releasing and creation story.

2. Schedule a service to restart the SOM
Create a batch file to restart the Server Object Manager service every 4 hours or so to release any hanging server contexts.

3. Use IPs instead of DNS for the SOC machines configurations
When you add SOC machines to the SOM, its is a always better to use the Network IP directly instead of the hostname. Locating the host name takes fraction of second each time a request is needed. Sum that up and you have an acceptable performance.

4. Server Object Parameters
This is the sexy part, those parameters are so important that If tweaked properly, they can tremendously increase your performance.
I loved this guide from ESRI site.

5. Minimize Number of "ON" layers
If you're creating your Server object from an MXD document make sure that you turn off all the layers by default and make only the major fast-loading layer on (if your client is ok with that).
Lets say you have 5 layers Water Distribution, Water Transmission, Electric Distribution, Electric Transmission and Landbase. I would turn all the layers off and enable the Landbase layer only, then save the MXD.

This will load the your document much faster.
5. Layer file Scale Dependency
It is really important to set the scalability of your layer files correctly, because this will tremendously boost your performance of your Web app. Just make the busy layers with a smaller scale so they will appear as you zoom in.

6. Enterprise SDE Optimization
If your MXD document is reading data from an enterprise SDE geodatabase, make sure that the SDE server name is saved with the IP instead of the hostname. SOC machines will suffer trying to resolve the hostname to an IP each time they want to connect to the SDE.

Hope those were useful.

Tuesday, August 4, 2009

If Newton is still alive


The power is equal to the force times the distance divided by the time.

When to use a Recycling Cursor

If you are new to ArcObjects, you must have seen this Boolean parameter when you want to create a search cursor. This might be confusing for some new developers. I didn't know about it in the beginning so I used to insert a false there every time.

Actually this very Boolean parameter can really ruin your entire application and produce unexpected results if used in the wrong context.

What is Recycling?
Recycling is reusing the same memory location for creating features or rows.
To make a long story short, I'm going to explain it with pictures.

Here is a picture with a non-Recycling Cursor

Click the image to enlarge


Here is another one with a Recycling Cursor


Click the image to enlarge



When to use Recycling?
Recycling cursor is much more faster than non-recycling one. It is great for populating lists and printing values in the screen.

Here are some cases you want to use Recycling in
  • Populating Features' attributes in a list
  • Saving certain primitive features attributes (like objectid) in a collection

When not to use Recycling?
When capturing the feature or its geometry (or any other non-primitive reference) , DO NOT use Recycling cursor. If you did you will simply get the same feature (probably the last one) in all your collection because it is using the same memory location.

Here are some cases you must not use Recycling in
  • Union the geometry of all features in a given cursor
  • Saving the feature geometry in the Grid Tag or collections
  • Comparing features

Hope that helped!

Monday, August 3, 2009

In Year 2038 Something terrible will happen!


What will happen?
In the 19th of January 2038 03:14:07 UTC, some computer systems will crash, applications will stop working, database data will be all messed up.

Why?
If the Computers are saving Time/Date as a signed 32 bit integer, the date will reach its maximum value at exactly this date and time 19 January 2038 03:14:07 UTC causing the decimal number to switch to negative, thus flipping back the date to 1901.

You scared me how to fix this?
Fixes can be done easily but at some binary compatibility cost.

They said the same for the millennium however, in 2038 the life is more dependent on computers then it was in 2000.

I hope we live to see this day!

Saturday, August 1, 2009

3 simple ways to make your Boss listens

You have a great Idea!
You may have encountered this. You have a presentation to the top guys about this brilliant idea! An idea that you think it will change and alter the way you do business or the way you create a product or the manner you provide a service or perhaps a new totally unique mechanism of doing a particular job that will dramatically cut costs. You are so optimistic.

You got Disappointed
You start the presentation and by the end of it you realized that it didn't make the impact you have imagined.

OK, currently we have limited resources, we cannot apply the idea sorry. But thanks for bringing it up! keep up the good work.

Why they didn't like you?
You have worked hard.

You have done it right.

You thought it was the ultimate idea.

But they didn't like it

When you have an interesting idea. The idea is playing in your brain like a Beethoven Sonata.
You see it crystal-clear, but your Boss doesn't!

Yes people don't know why it is important. They don't know what tune is playing in your head. They want to get your idea
(in a limited amount of time). They are busy, they are getting calls, emails, text messages and other meetings.

This is what you can do.

1. Make them care
You have to make them care. First you have to put them in a serious and critical situation. Describe a problem and show them statistics and charts that keep on empowering the problem. So they live in a temporary moment of fear.

2. Don't gun-shoot your idea FIRST
Don't talk about your idea in the beginning. Leave it till the end. Let them be convinced that they are in a need to change.

3. Fire the idea when they are Vulnerable
Now hammer them with your fantastic idea. OK you want to solve that problem? Here is my idea. The urgent need for a solution will leave them no choice but to pick you.


I convince my Management this way (I hope they are not reading this).
Made to Stick is one of the greatest book I've ever read. One factor of making an idea stick is to tap into peoples emotions. There are other 5 factors in the book. Get it. It gave me the power to write this post.

Double Slit Experiment



Click on the image to enlarge.


If you are familiar with Quantum physics you may already know this great experiment. This is a small comic strip I created using StripGenerator.

You can watch the experiment video here in details.