Monday, June 24, 2013

Play NES Games on your Android Device

We were talking the other day me and wife on how she misses the old NES games, and how really addicted there were compared to current mobile games.

I told her you know you can still play them on your android. She was delighted when I showed her how. 


Here you go as well.


1) Download NES Emulator from here, the app which will allow you to play the games.
2) Download your favorite game and save it to your phone





































3) Run the program and it will list all your games




Thursday, June 20, 2013

The Unorthodox Way to Compress a Replication-Enabled Versioned GeoDatabase to State 0

If you landed here chances you lost hope of all the links and by-the-book ways to compress your geodatabase. You probably have a versioned geodatabase that no matter how many times you compress, no matter how many users you kick out, how many connections you kill; The state is not set to zero.

You have one version SDE.DEFAULT and it is still pointing to state 8549347 or whatever and this state is referencing thousand of edits. So you are stuck with a huge performance issue on your database because of all the queries to the A and D table. Even if you reconcile and post all versions you still can't seem to get to state 0. Usually replication might cause this, so you might have few hidden versions pointing to state 0 . Therefore compress command will get confused when these versions with state 0.


BEFORE YOU DO THIS, BACKUP YOUR DATABASE, DO AN ORACLE DUMP OR A SQL SERVER BACKUP. ALTHOUGH THIS THING WORKED FOR ME THREE TIMES I CAN'T GUARANTEE JACK.


Buckle up, we are about to open the hood of the SDE Technology and loose few bolts in the SDE engine, change a fuse or two, start the engine manually and put the hood back.


1- Fireup your DBMS, connect as SDE user.

2- Open the SDE.VERSIONS





3- You may skip this to 4 if you just want to do the fix, else continue reading if you want to know how this works

Name: The Version Name
Owner: Who created the version
Version_ID: An ID for the version
Status: A status that tells whether this version if private, public, protected or even system
State_ID: To what state this version is pointing, the state
Description: Text, description of the version
Parent_Name: This is a stupid field, bad ERM design, there is a parent_version_id so we can get the name of the parent. Unless they did it like to avoid joining, thus speed up the query response time, then they are smart and I am sorry.
Parent_Owner: again, stupid field, never mind.
Parent_Version_ID: The parent version id there you go.
creation_time: when did this version is created

4- Now you might have different values, but look at the whole structure it should be the same





5- The geodatabase is not compressing because there are two states pointing to zero which makes the compress command thinks everything is rosy. So take your screwdriver lets screw this DB.

6- We will do a manual reconcile to those two hidden versions to point to the same state id as the default (that is reconciling basically) Change the state 0 in those two version to the state_id of the default as follows



7- Save and close

8- Go run the compress command

sdeversion -o compress [-N]  -u sde -p sde_password -i arcsde_service -s server_name
-D database




You should now see your state tree set to zero.






Monday, June 17, 2013

Water Thumb Drive




Digital Thumb drives can hold Gigabytes of data and transfer up to whatever USB 3.0 can handle.

Water thumb drives could hold Exabytes of data (the number of sand grains on Earth and Mars combined) and transfer up to whatever the molecular bonds can support.


Save one bit in a Hydrogen atom and we'll get there.

Sunday, June 16, 2013

Arc2Google Official Page

Arc2Google users grew more than I expected, therefore I'm gonna dedicate a page for any new releases of this tool.

Currently I will support ArcGIS 10.1 and above, Apologies for not supporting 9.3/9.3.1 as I don't have those versions anymore. 


Arc2Google Current version is 10.1.0.3

Feel free to email me at HUS DOT MHD AT GMAIL DOT COM



Saturday, June 15, 2013

Web Services, best invention since sliced bread






Probably you read about it in a tech blog or heard it in a conference.
If you end up here from a google search, you're probably searching for an easy definition for a web service.
Consider the following scenario:

Scenario #1
You at home watching TV in the living room, your mother is in the kitchen making dinner. She is out of cheese, so she asks you to get some from the store. You leave the house, buy some cheese, return home and hand the cheese.

Scenario #2
You are outside jogging in the park, your mother is at home making dinner. She is out of cheese, so she calls your cell, you answer, she asks you to get some cheese, so on your way you go to the store, buy some cheese, return home and hand the cheese.


First scenario is an application for local function calling. You have a software installed locally on your machine (kitchen and living room) that does something (getting the cheese)

Second scenario is a case where that function is online and you can access it from anywhere (home and the park) using a communication protocol (cell phone).


If a software can be called from anywhere it is called a web service. It is that simple, but some IT folks like to use words to make them sound sophisticated. Like REST and SOAP and SAAS etc...


It is its simplicity which makes it beautiful with so many applications.

Thursday, June 13, 2013

The Prestige in Programming

Please read this quote from the movie Prestige very carefully.

"Every great magic trick consists of three parts or acts. The first part is called "The Pledge". The magician shows you something ordinary: a deck of cards, a bird or a man. He shows you this object. Perhaps he asks you to inspect it to see if it is indeed real, unaltered, normal. But of course...it probably isn't. The second act is called "The Turn". The magician takes the ordinary something and makes it do something extraordinary. Now you're looking for the secret... but you won't find it, because of course you're not really looking. You don't really want to know. You want to be fooled. But you wouldn't clap yet. Because making something disappear isn't enough; you have to bring it back. That's why every magic trick has a third act, the hardest part, the part we call "The Prestige".



Every programmer has his own tricks on how he make his application stands out. Everyone see the output program or script or functionality and like it, let them enjoy the output, don't tell them anything else.

Once your programming prestige is revealed, that is it. You will start hear things like

"Oh, that's how he did it. I thought It's more complicated. "
"Aha you used that feature, everyone can do that" 
"No, my level of thinking and implementation was way beyond this"
"Instagram? I thought of that application before but didn't implement it"
"No my idea is way more sophisticated." 


Programmers are like magicians, they shouldn't reveal their tricks. Create tricks and keep them to yourself. Learn from others.

Wednesday, June 12, 2013

ArcFM Server, Do You Need it?





Lots of people requested me to write about this technology, so here it goes.

Good thing about this blog is it doesn't take sides, if I didn't like a product I simply say so. So when you hear something from me (good or bad) its probably coming from my sole experience with a product.

What is ArcFM Server? 
Let us start with what is ArcFM. ArcFM (Facility Management) has been created on top of ArcGIS platform by Miner and Miner as desktop application for utility users. Since ESRI was not focusing on Utility users, M&M has found a niche and tackled it with a solid product. Made a good money out of it.  Schneider Electric found this gem and bought it.

ArcFM Server is an extension for ArcGIS Server (now 10.2), allows you to support ArcFM functionalities on your GIS Services. They probably didn't say this in the brochures and flyers but ArcFM Server is won't work without ArcFM Desktop Editor. You need the desktop version to configure your geodatabase, upgrade it to support ArcFM etc.

Here is a live demo of ArcFM Server, it is on 2.4 at the time of writing this article.

Good thing about ArcFM Server?
At my company, we have implemented ArcFM Server for one reason. We didn't want to customize anything. We want a product that we can install, configure and voila!. We have ArcFM desktop fully configured with feeder manager, we implemented ArcFM Server and bang! we have all our electric traces right on ArcFM server page with some basic nice features with no single line of code.

Disadvantages
Lack of Support and Training
If you got error in the installation or configuration ArcFM server (and yes you will) good luck with that, you are on your own. The forum is filled with unanswered questions. No training yet offered for ArcFM server.

Silverlight
I said this to the guys at schneider electric and I'm gonna say it again. There is an elephant in the room and it is called silverlight. Why are you still supporting this? The only reason we are going Web 2.0 so that we can consume our services from multiple sources. Silverlight is not supported on any of the tablets or phones. HTML5 however is supported. Either build us native applications on mobile to consume these services or support HTML5.

Trace Tools are so slow
ArcFM Server Tracing tools take on average 40 seconds to execute. That is not acceptable in our business so we end up creating our own from scratch. My custom trace achieves the same result with only 0.5 seconds to run. 98% Less!

So I'll give this product a year or two to mature, and until ArcFM have a vivid strategy for this product.