Blog from a software professional, Passionate to work in latest cutting edge technologies in order to get better results in business.
Friday, May 27, 2011
Salmiya Garden Distance
Today, i thought we need to find the distance we walk in the salmiya garden situated in 10th Block. We usually go for two rounds and some times more, based on the energy level :). Thanks to ArcGIS explorer which made our quest simple. its easy to do as well... Please see the screen shot below which shows a clear picture.
Answer: 1.048 Kms
Sunday, May 22, 2011
Where Am I ! A sample on Geo location using ArcGIS API
Hi
I have created a Geo location finder page using ArcGIS api. It is a test page to display the current location of the browser. I am sending to friends across the globe to evaluate. Please try from your end and reply whether it works fine or not & your browser version. mostly it is supported in all latest versions.
Live Sample : http://www.kuwaitfresh.com/WhereAmI.htm
We have used the following web-service in this sample:
http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
Observation as on 1 July: For some friends in IE 8 it didn't work. Rest for Firefox version greater than 3.5,Chrome, IE9, It worked once the user allowed "share my location" option. and we have also tested in Iphone which is upgraded with version 4.3.
ArcGIS JavaScript API sample to display the current latitude and longitude
Here is a sample of ArcGIS Javascript API using google maps web services. To use google web services we need to register with them. After registration with google, they provide a API Key specifically for our domain, say for example in our case it is KuwaitFresh.com.
About the Sample, it helps us to fetch exactly the current Latitude and longitude on mouse click on the respective position. Please click the link below to navigate to the live sample. Thanks
Live Sample
Thursday, May 19, 2011
Sample of ArcGIS online Viewer using Javascript API
Created a sample Map from API viewer in ArcGIS to display some cities in kuwait. Embedded the code in a page in my website as well... click the image below to view the page below.
http://www.kuwaitfresh.com/ArcGIS_MapViewer_sample.html
ArcGIS Explorer online : Oil spill in Gulf of Mexico over time
Wednesday, May 11, 2011
Searh for a text in whole database SQL
There was a requirement to search for a text in the whole SQL database. found this Stored procedure very useful. though it is worth sharing...
Resource: http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm
-- SearchAllTables ''
CREATE PROC SearchAllTables
(
@SearchStr nvarchar(100)
)
AS
BEGIN
CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
WHILE @TableName IS NOT NULL
BEGIN
SET @ColumnName = ''
SET @TableName =
(
SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
AND OBJECTPROPERTY(
)
WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
BEGIN
SET @ColumnName =
(
SELECT MIN(QUOTENAME(COLUMN_NAME))
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
AND TABLE_NAME = PARSENAME(@TableName, 1)
AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
AND QUOTENAME(COLUMN_NAME) > @ColumnName
)
IF @ColumnName IS NOT NULL
BEGIN
INSERT INTO #Results
EXEC
(
'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630)
FROM ' + @TableName + ' (NOLOCK) ' +
' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
)
END
END
END
SELECT ColumnName, ColumnValue FROM #Results
END