Raba - Defend your code RSS 2.0
# Thursday, February 09, 2006

Last week Avi (my team leader) and I were in a meeting with Systematics the representatives of ESRI in Israel.
We ought to ask some questions about the GIS Server, and I will bring here some of the answers we've got:

  1. The GIS Server 9.1 won't work with the SDE 8.3
  2. The ADF(Application Development Framework) for .Net will help us to develop GIS applications more productively (using my favorite drag&drop action).
  3. While the ADF is very useful it is also very simple, most of the wanted features you would have to program by yourself, such as saving the maps history, calculate the distance between two (or more) points which are not in the same extent. (those two examples were implemented in our systems today and won't be provided in the ADF Controls functionality)
  4. The ADF.Net won't work with the .NET2.0, we should wait for the next release.
  5. The GIS Server based on the ArcObject model, which give you more functionality (the same as we have in the client) such as editing.
    No more activeXConnector problems.
  6. The performance in the GIS Server is not better than the ArcIms, which are both very slow (you can see it in the examples below)

Here are some demonstrations of the products:

  • An example of caching your maps,
    I loved the idea of using the cached maps (My Maps) on the right.
  • Simple example of tool tips on map (this one is damn slow, while we have only 4 layers).

   Those two still suffer from the known issues of bad performance, 
   even when they are only small projects.

Thursday, February 09, 2006 4:47:04 PM (GMT Standard Time, UTC+00:00)  #    Comments [2] - Trackback
.Net | GIS

# Thursday, February 02, 2006

I've added my Human-Debugger icon to my main page
so from now on - you can see the HD Icon on the left hand of your address bar and in your favorites.

All you need to do to enjoy my icon:

  1. Add my main page: the www.human-debugger.net to your favorites.
  2. I recommend to close the browser and re-open it (some of the browsers need this one for
    showing the icon).
  3. Browse to your favorites and view the link to my page. (it is already showing the new icon)
  4. Browse to the link and that's all - you can see the icon in your browser address bar.

Enjoy my new icon.

Thursday, February 02, 2006 9:03:04 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
My Site

# Sunday, January 29, 2006
Today, while I was sitting with Matan, a new programmer at our team, for a code review - I saw one of the worst practices that each new programmer and even experienced programmers are dealing with during their coding/reading in .Net, the Exception rethrow mechanism. I would like to show here two code examples for best and worst practices:
Sunday, January 29, 2006 11:44:02 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.Net

At my Team we work on different applications simultaneously, each application live in a separate solution.
The common denominator between those different solutions is one solution which hold some WebControls, scripts (for the web controls) and some other methods which serve the BL and Dal.

I am gonna talk about the WebControls and their scripts.
As you can understand, each application (solution) holds a reference to the WebControls DLL, but What are we going to do with the scripts? 
I prefer to write a pre-build event script which will deploy (simple XCopy) the scripts to the Inetpub and than each application could use those controls without copy the scripts to their private directory hierarchy.

Yesterday we start using another Solution, IEWebControls (which most of you probably know their controls such as tabstrip, treeview etc.), while installing the IEWebControls it will create a directory on your computer and after running their build script it will copy the scripts into the Inetpub.

We made a discussion about how we should use the the DLL and the scripts so all the programmers could make a simple get from the VSS, and every one could use those WebControls, there are two different opinions:
1) each programmer should make his get (only for the scripts) from the source-safe into the Inetpub directory (the references to the DLL is already exist in the relevant solutions).
2) each programmer should get the full solution and make a build, the build will cause the XCopy for the relevant scripts to the exact directory.

I prefer the second, because it will be exactly like our WebControls solution which I describe earlier,
also it will be similar to regular deploy to our the servers, finally I think that this is the right logic for all changes (if exist - DLL/scripts) to take place at one click (build).

I would like to hear your suggestions, What do you think about my preferred way.

Sunday, January 29, 2006 9:59:17 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
VSS

# Saturday, January 28, 2006

After the last Assembly lesson in "What is the difference between Const and Readonly?" post, many of you praised and asked for more from the ildasm subject, so here it is, a simple question about the assembly behind you code.

What going to happen if you'll try to write this code:

        public string HtmlSnippet
        {
            get
            {
                return m_HtmlSnippet;
            }
            set
            {
                m_HtmlSnippet = value;
            }
        }

        public string get_HtmlSnippet()
        {
            return m_HtmlSnippet;
        }

This one is simple, This is the error message at the compilation:
error CS0111: Class 'Sentence' already defines a member called 'get_HtmlSnippet' with the same parameter types.

Why is it an error?
while converting the C# Code into Assembly the compiler will transfer each property into method!
after all, there are no properties in assemblies.
The format of such transformation will be:
public PropertyType   get_PropertyName(){....}
public void               set_PropertyName(string value){....}

Saturday, January 28, 2006 4:35:52 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] - Trackback
.Net

Lately I found my self playing a lot with the Google search API, I would like to give my criticism about this one:

Cons:

  • Old API as we used to in C (WinAPI) with 8 and even 10 parameters, no overloading.
  • Only 10 results for each query, and they rudely ask for the maximum results wanted?!
    why isn't there any Const with maximum results so people could be aware of this 
    shortcoming.
  • There is no ability to get the page rank.
  • In their snippet result (where you can see intro of the text that found for this page) you
    will find it in HTML format, which I recognize as poor programming, there are thousands of 
    people who would like to see the results in WinForms, save into file or just read the text, why 
    should I make the formatting job (Isn't it all presentation stuff?)
  • Least but not last, documentation for the methods (can be found online only.)

Pros:

  • This is a productive tool for all the programmers out there, which can be easily download, install and use this fairly easy.
  • Written as WebService which help for compatibility.

conclusion:

  • As a programmer who need to search the web, I recommend this tool.
  • As a programmer who wrote this tool I would run fast as I could and fix those Cons, and there is even more from the place they came from.

The Cons talk on their own, Does Google made this API poorly to prevent us from using it, or maybe they not as good as they seem to be.

remarks:
I hope they won't throw me out from their Ranking Servers :).
you can found more data in this article:
http://www.mattcutts.com/blog/feedback-products/

Saturday, January 28, 2006 9:12:03 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.Net | Software Development

# Tuesday, January 24, 2006

I've found a great peace of code in JavaScript,
the source give us the ability to use String.Format() in our JS code, the same as we do in .Net.
I found this very usefull...

Tuesday, January 24, 2006 8:43:46 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
Scripting Technology

# Saturday, January 21, 2006

There are many people who asking me again and again about this question,
I've finally found some time to write about this and show you simple example for all of you out there so you can't forget this.

As we know (read somewhere but nor really remember) one is runtime and the other compile time...
so here is the code:
public const int IntConstField = 1;
public const string StringConstField = "shani";
public static readonly int IntROField = 1;
public static readonly string StringROField = "shani";

and this the usage:
Console.WriteLine(Class1.IntROField);
Console.WriteLine(Class1.StringROField);
Console.WriteLine(Class1.IntConstField);
Console.WriteLine(Class1.StringConstField);

Isn't It look the same?
so I disassemble this one for you...

IL_000a: ldsfld int32 [TestLib]TestLib.Class1::IntROField
IL_000f: call void [mscorlib]System.Console::WriteLine(int32)
IL_0014: ldsfld string [TestLib]TestLib.Class1::StringROField
IL_0019: call void [mscorlib]System.Console::WriteLine(string)

IL_000a: ldc.i4.1
IL_000b: call void [mscorlib]System.Console::WriteLine(int32)
IL_0010: ldstr "shani"
IL_0015: call void [mscorlib]System.Console::WriteLine(string)

The first four rows show the Readonly, where you can see the ldsfld which is MSIL instruction for pushing the value of a static field into the stack!
The other four rows show the Const, Where you can see ldc,ldstr instead of ldsfld which means that Const doesn't behave like Readonly, Const is very similar to to #define in c, don't have its own location as global, Const is just written as number/string (hard coded) at the compile time.

After we know this simple transformation at the compile time,
we will see an example including two DLLs:

A: hold the const vars.
B: uses A's const vars.
When we made a change at A (changing one of the consts) we can't only compile it and replace the DLL at the bin directory, we should also compile this with the DLL who use it (B in our case).
So it will change also the hard coded numbers!

PI, is a good const, but Unit Number or Dept Number (=180) isn't good enough.

Saturday, January 21, 2006 7:52:17 AM (GMT Standard Time, UTC+00:00)  #    Comments [4] - Trackback
Software Development | .Net

# Monday, January 16, 2006

In my daily work I am writing a GIS (geographic information system) application.
At my place we work for almost three years with ESRI product, which for a long time lead the market by far, although its critical disadvantages such as: performance problems, poor documentation and expensive price.
but, with no real competitors at sight we could do nothing but pay the greens.

I made some background checking about new GIS Tools mainly because of the performance problems but also because of the unsupervised growing prices.

First I found this great Wikipedia link, which show us all the progress in the GIS domain,
and summarize the known GIS tools. 

I would like to point on my favorite tools:
1) GRASS GIS - free tool for develop your own application, open source, run on MS-Windows, Unix and Mac Os, try this at home.

2) Map Cruzin - enter this site and see what you can do with this one,  couldn't find the API link but friend of mine tell me great stories about writing simple code and this is running extremely fast.

3) GeoTools - this one is my favorite, it has all the features you can only dream about.

I'll keep testing those three deeply throw this year, hope to find the best replacement for ESRI.
I would like to hear another point of view from you, thanks.

Monday, January 16, 2006 10:33:11 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] - Trackback
GIS

# Saturday, December 10, 2005

Every one who write queries in Oracle knows that for inserting comma (') into a varchar field you need to double it, which will look like this:

insert into shops(shop_name, description)
values ('Adam''s shop', 'selling bugs for free');

But I've found out this one too (and also found out that there are many of you that don't know this trick)
try to write the query with this special character - &  (And)
Oracle will think that this one is a parameter asking you to insert value.
so I said why not double it too.

update shops
set      shop_name='Lorel&&Hardy'
where  code = 69;

Do not try those tricks at home.

Saturday, December 10, 2005 8:20:08 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
DataBase

I came home last Thursday hopefully finish my little WebService project,
while i opened my project there it was - an error, something about cannot open web pages.
I've tried to open my Consumer Web Application project - same error occurred.
The really strange behavior was while trying to open my COM+  clicking on "my computer" tree node that cause in strange closing window?! no error written.

While surfing the net - i found explanation about how to fix the problem- which include full exhausting description about how to re-install your component services.
so continue goolge up some of my event log errors, and finally I found something that would be good try before starting the component services re-installation.

run those command lines:
regsvr32 oleaut.dll
regsvr32 ole32.dll
afterward, I've tried to enter the COM+ again and it works just fine.
And even my projects are running great (even my undocumented bugs disappear).

I hope it will be helpful for you too, it is worthwhile to attempt this before re-installing the COM+.

A little bit about ICQ - I always have strange problems when my bro install/upgrade versions,
I tell you don't mess with those people.

Saturday, December 10, 2005 8:00:51 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
Life

Archive
<February 2006>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
2627281234
567891011
Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Shani Raba
Sign In
Statistics
Total Posts: 145
This Year: 0
This Month: 0
This Week: 0
Comments: 97
Cool Stuff
Add to Technorati Favorites
Themes
Pick a theme:
All Content © 2012, Shani Raba
DasBlog theme 'Business' created by Christoph De Baene (delarou)