Wednesday, December 1, 2010

New English To Arabic Dictionary

Hello there,
Check my new English to Arabic easy dictionary...
Easy English-Arabic Dictionary is a simple English to Arabic dictionary that contains more than 60000 words, definitions and acronyms.
Easy English To Arabic Dictionary deployment is simple and direct and can be used on all operating systems that support Java, including Microsoft Windows, Linux, Mac and Others.
If you are interested check this link: http://products.alkumait.net/?page_id=7

Regards.

Saturday, June 26, 2010

Editing Graphics Geometry in Graphics Layer With ESRI Silverlight ArcGIS API

I have implemented Editing a polygon Graphic on a Graphic Layer, it is simple, we are going to bind Mappoint collection to a grid. deleting a vertex is also available in the grid.

Grid XAML:
 <data:DataGrid x:Name="dgRequestLocationPoints" AutoGenerateColumns="False" MaxHeight="500" Foreground="Black" IsReadOnly="False" >
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="Long" Width="90" Binding="{Binding X, Mode=TwoWay}" IsReadOnly="False" />
<data:DataGridTextColumn Header="Lat" Width="90" Binding="{Binding Y, Mode=TwoWay}" IsReadOnly="False" />
<data:DataGridTemplateColumn Width="50">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="DeletePoint" Click="DeletePoint_Click" Width="16" Height="16">
<Image Source="images/delete.png" Stretch="Fill"/>
</Button>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>


Binding the vertices to the gird:

Thursday, June 24, 2010

Implementing iPhone Button using SilverLight

Hello,
I've implemented an iPhone-like Button using Silverlight;
Here's my implementation; hope you enjoy it :)

http://www.blog.alkumait.net/arcgisserverblog/IPhoneButton.xaml


Regards

Sunday, June 20, 2010

SilverLight WCF Size Problem



Hello;
I've been recently developing an application using Silverlight 4 as with WCF service back end, so some of the functionalities in the project required to upload dome files and store them in a database, but I had a problem reagrding the size of the uploaded file, after googling a lot; all sites were talking about the configuration of the WCF service and the client (you know maxReceivedMessageSize and maxBufferSize="2147483647" and so...); but after changing the configuration it seemed that the problem remains.

The exception I kept receiving when the file is about 3 MB is:

System.ServiceModel.CommunicationException was unhandled by user code
Message=The remote server returned an error: NotFound…

Today I found out the solution in some site; it has nothing to do with the configuration of the WCF and SL client; it is related to the httpRuntime in system.web :)

So if you had the same problem just add this in system.web in your service config file:

Monday, April 12, 2010

I have officially Replaced Safari with Opera Mini

as per this THIS POST opera mini has been approved and realeased in apple store, i have tried it myself and compared with safari on another iphone, it is faster, so i replaced with the safari browser :)

Wednesday, March 31, 2010

Comparison of Creational Patterns

According to my experience, you may use each pattern as follow:

1- The Builder pattern is concerned with building a single complex object
(by including the concept of a director that depending on different factories).

2-
The Abstract Factory pattern is concerned with building families of related products (where there are many product hierarchies and a factory for each family of products).

3-
The Factory Method pattern is concerned with instantiating a subclass
of one class hierarchy (where there is a specific reason why one subclass would be chosen over another).

Saturday, March 27, 2010

C# implementation of Builder pattern

The builder pattern Separates the construction of a complex object from its representation.

The players in this pattern are:
1. Product (Room)
Represents the complex object which includes many classes(parts)
2. Builder (RoomBuilder)
Specifies an abstract class or an interface for creating parts of a Product object
3. ConcreteBuilder (WoodBuilder, GlassBuilder)
  • Constructs parts of the product by implementing the Builder class/interface
  • provides a way for retrieving the product
4. Director (House)
Constructs an object (room) using the Builder class/interface

So, you use the Builder pattern when:

  • the object to be constructed has many parts and might have different representations.
  • you need control over the construction process.

Monday, March 22, 2010

C# implementation of Abstract Factory pattern

The Abstract Factory pattern takes Factory Method Pattern step further, creating families of related products.
The abstract factory can be refined to concrete factories,
each of which can create different products of different types.

The pattern isolates the product definitions and their class names from the
client so that the only way to get one of them is through a factory. For this reason,
product families can easily be interchanged or updated without upsetting the structure
of the client.
An interesting aspect of the Abstract Factory pattern is that the whole product family
can be changed while the application is running.


Friday, March 19, 2010

Easy ArcGIS Library is now on Code Plex

Hi All, I moved my project Easy ArcGIS Library to code plex
http://eagl.codeplex.com/

Download the recent version with docs there.

Sunday, March 14, 2010

Java vs C# Performance Benchmarking

I'm a Java fan, but I use C# 99% in my job, so yesterday I was looking at a good EJB book (EJB 3 in action) while enjoying my coffee (the real one not the Java one ;).
I had a look at some EJB vs .NET benchmarks and I was shocked to see that .NET is much more faster than Java in the enterprise wild, so I decided to do some SIMPLE benchmarking myself.

Benchmarking Tests
I've wrote 3 really simple tests in both Java and C#, the first tests simply loops over an array 1000,000 times while doing some multiplication math, the second test loops over an array 1000,000 times too but while doing some more complex math, and finally the final tests that creates 1000,000 objects and saves them in an array.

I repeated each test 100 times, took the average of them as a final result, so I can be sure of the accuracy.

Friday, March 5, 2010

Programming ArcObjects is now easy

Have a look at the new version of EAGL, new namepace for graphics is added.
EAGL is open source C# .net library that facilitate programming with ArcObjects.

http://code.google.com/p/easyarcgislib/

Wednesday, March 3, 2010

C# Implementation of Factory Method Pattern

Factory Methods encapsulates the creation of related objects
(the Productes) by letting a class (the Creator) deciding which class to instantiate depending on a specific reason.
For example, in case that the creation process depends on user input .

In the world of GIS, there is a map which includes many various layers.
The client chooses what kind of Layers to be added to a given map .


Tuesday, February 23, 2010

C# Implementation of Singleton Pattern

In .NET, more than one thread can execute our Singleton concurrently
because .net is multithreaded.

If our class includes multiple static members, the first reference to
any of those members will trigger the type initializer. Also, class
instatiation will trigger them.

This implementation uses an inner class to make the .NET instantiation fully lazy.

The compiler guarantees the thread safety.

Wednesday, February 17, 2010

Synchronizing Two Feature Classes

In this Example We will see how to synchronize data between two feature classes, I'll use the TableSynchronizer class which I added to EAGL recently.

TableSynchronizer will synchronize data between and ITable instances, new rows in the source will be added to the destination, existing rows in both will be updated in destination, and rows that exist only in destination will be deleted.

You can use TableSynchronizer to synchronize data between feature classes from different workspaces, Feature Layers, Tables ...

Saturday, January 30, 2010

Using EAGL to export feature classes to .net data table

In this example we will see how to use EAGL library to export feature classes to the .net's DataTable type.

In this example we will suppose we have a windows application that contains a map control called 'ctMap', a list box called 'lstLayers' and another windows form that contains a DataGrid with public access modifier called dg, we will use this data grid to show the generated data table.


This function will load an Mxd file to the map control:

Friday, January 29, 2010

Save Source Code as HTML from visual studio

Hi All;
I found this great visual studio plug-in that exports the source code as HTML;
I'll use it here ;)

Easy ArcGIS Library 1.1 released

I'm glad to announce the new version of Easy ArcGIS Library (1.1)...

Please check the project site for downloads and documentations...

Saturday, January 9, 2010

Adding Loading indicator after using a custome tool from the toolbar that interacts with a Map control

Very often i see forum posts asking how to initiate a loading indicator or something to tell the user that this tool is doing something, please wait.. in 9.2 we had the choice to edit javascript of ADF controls, but in 9.3 its not supported anymore, all you can do is override javascript function, i have not really experience with that but i have got a quick fix for this.. the implementation is below..



server action of custom tool

 

adfMap = (ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)toolEventArgs.Control;

ESRI.ArcGIS.ADF.Web.UI.WebControls.MapPointEventArgs mapPointEventArgs =

(ESRI.ArcGIS.ADF.Web.UI.WebControls.MapPointEventArgs)toolEventArgs;

            ESRI.ArcGIS.ADF.Web.Geometry.Point adfPoint = mapPointEventArgs.MapPoint;

string JS = "GetSocumentList(" + adfPoint.X + "," + adfPoint.Y +");";

//call a javascript function in the default.aspx

adfMap.CallbackResults.Add(new ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult(null, null, "javascript", JS));

 

 

//the javascript function in default.aspx is, we are setting a panel visibility that has an animated gid in it

function GetSocumentList(pointXCoor,PointYCoor)

{

    expandConsolePanel('RigsDoc_Panel');

    document.getElementById('DIVLoadingPanel').style.visibility = 'visible';

    var message = 'GetRigsDocumentList';

    message += "," + pointXCoor + "," + PointYCoor;

    var context = 'Map';

    <%=sCallBackFunctionInvocation%>

}

 

//after we initiate the callback and we get back the finish processing we set the visibility of the div and display the results

 

private string GetDocumentsList(string RigName)

{

    //some time consuming process

    Map1.CallbackResults.Add(new  ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult(null, null, "javascript", "var newHTML ='" + x + "'; document.getElementById('lstDocs').innerHTML=newHTML;document.getElementById('DIVLoadingPanel').style.visibility = 'hidden'"));

    returnstring = Map1.CallbackResults.ToString();

}