Tuesday, July 12, 2011

Connecting To Oracle From ArcObjects Using Oracle Provider For OLEDB

I was trying to connect to oracle from ArcObjects using the Oracle Provider for OLEDB, after some investigation on the subject; I found the correct method.

This function will create the workspace using the Oracle provider
private void connect()
        {
            string cn = "Provider=OraOLEDB.Oracle.1;Password= ;Persist Security Info=True;UserID= ;DataSource=server:port/database"
            IPropertySet pset = new PropertySetClass();
            pset.SetProperty("CONNECTSTRING", cn);
            IWorkspaceFactory fac = new OLEDBWorkspaceFactoryClass();
            fac.Open(pset, 0);           
        } 
 
Don’t forget to initialize the license before you connect.
private void initLic()
        {
            RuntimeManager.Bind(ProductCode.Server);
            IAoInitialize aoInit = new AoInitializeClass();
            aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
        }
Hope that was useful

Sunday, July 10, 2011

ArcGIS Silverlight Controls

Hello all;
I’ve published my new project ArcGIS Silverlight controls on codeplex, have a look on it
http://arcgisslcontrols.codeplex.com
Regards

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.