Friday, March 28, 2008

This week has been a nice vacation in Thailand in between a week of work in Penang, Malaysia and two weeks starting next week in China for a school trip with my MBA class for our international study program.

Last week in Penang, I meet up with the academic staff at the computer science department at USM (University Sains Malaysia) in Penang. We had a great time talking about how to bridge the gap between the research the students are doing and commercial applications. (I suggested that they work more closely with their alumnus to come back and teach classes on this very topic.) I walked the faculty and students through the technology used at my old company, Corzen-mostly the statistical models (cluster analysis), data mining algorithms, and grid/distributed computing. The student's eyes lit up.

IMG_1020

The whole reason why I was there was due to my friend Jihad Hammad, he invited me. Jihad was born and raised in Palestine and is taking his masters at USM. (This is his first time out of Palestine.) He is the founder of the Palestinian Information Technology Center (PIT), a non-profit to help people in Palestine learn about technology and PalDev, a Microsoft .Net User Group in Palestine-with 100+ active members at each meeting, a user group that sometimes has no place to meet so they meet at a refugee camp.

Jihad and I met online five years ago and collaborated to build the PIT and PalDev; we have been partners and friends for 5 years.I helped get the PIT center funding from various sources in the USA and helped get Microsoft recognition for the center (plus free software) as well as INETA membership for PalDev. While Jihad did all the hard work, I was able to lend him a helping hand over the years by making the right introductions to the right people.

This was the first time we met in person.

This is the power of the web, it brings people together and helps them do wonderful things. Two people who never met before can easily build trust, a friendship, and make a difference by using technology in a war zone to give people hope (and hopefully one day play a very small role in ending the violence.) This would not have been possible 10 or so years ago. That is the power of the WideOpen Web. Anything is possible, even peace in the Middle East via .NET. :)

Ok back to the mixed drinks by the beach...

Friday, March 28, 2008 10:48:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Friday, February 22, 2008

It was my birthday on Wednesday and we decided to go to the Pyramids with all of the investors of DashSoft as well as the entire team of local Egyptians. There is nothing like going to the Pyramids with locals. But the adventure started before we even got there.

Riding a taxi in Cairo is always an adventure. The adventure starts before you get into the taxi, when you have to negotiate the fair. Vassil was the butt of our jokes since he paid LE 90 (about $17) to get from the hotel to the office on Monday when we paid about LE 15 ($2.75). Vassil is not the best negotiator but desperately wanted to make amends. We got the inside scoop from the locals that it should cost no more than LE 35 from our hotel to the Pyramids. I warned Vassil that the taxi driver may start at LE 200 and he will have to knock him down. Vassil asked the first taxi for a price and the taxi started at LE 50 and Vassil immediately said 40, not something like 5! Oh well....

As we rode through Cairo, we were due to meet Remon at the Pyramids. He was traveling with the whole team of developers and testers from the office. All of the developers have been to the Pyramids just once in their lives and it was on a school trip. Remon rented a bus, a bus we were not on.

Back in the taxis, Vassil was filming me practicing my Arabic with the drivers of other cars since we were stuck in traffic. After we got to the highway we lost the third taxi in our caravan, holding Richard Campbell and his wife and friend Mike. Our taxi driver phones Richard's taxi and we pull over to the slow lane  of the highway and stop and wait for them. I decide to get out and have some fun. I tell my taxi drivers I want to buy my taxi. They start to compete saying who's taxi is better. The fun got even better when a random third taxi appeared and thought we were broken down (I was taking photos of the taxis) and when I explained to him that I was attempting to buy a taxi, he offered his. I had him down to about $700.  My driver then shooed him away. Finally Richard's taxi drove by and the look on their faces was priceless, I was walking around on the highway taking photos and they did not expect to see me. Oddly enough, Remon's van passed us by and Reem noticed me on the side of the road taking photos and joking with the taxi drivers. So they pulled over and picked us up. We paid our taxi drivers and took their photos and left for the Pyramids.

IMG_0809a

Entering the Pyramids you learn that it costs LE 100 ($20) for a foreigner to enter the Pyramids and LE 4 (< $1) for an Egyptian! I pose for a photo with my Egyptian wife Lamees and try to pass myself off as an Egyptian to no avail. I did show my student photo from my MBA program and pay the LE 50 student rate.

IMG_0817a

We enter the grounds and go inside the Great Pyramid. Unfortunately no cameras are allowed inside and we climb up to the room where the king's body and gold was stored. After climbing up for 15 minutes in the heat and no oxygen, we finally get there. It is an empty room. But a 4,000 year old empty room. Very cool.

We get down and then start having more fun. We take tons of silly photos. The Egyptians were just as excited as us foreigners.

IMG_0834a

Next we move on to the camels. Yes camels. What kind of trip to the Pyramids would be complete without camels?!?! I have been to the Pyramids about 7 or 8 times so I do not ride a camel but take tons of photos.

IMG_0854a

We then move to the Sun-Boat museum where the Pharaoh's boat is stored.  The admission fee is LE 40 and I once again try to pass myself off as Egyptian. The best I can do is say I am the professor of all of the locals with me, Lamees gives the man her Student ID card and we buy 10 local student passes (LE 20) and one foreigner student pass (LE 20) and go inside. One foreigner costs the same as 10 locals! We meet up with Richard who I instruct to call me Professor.

IMG_0892a

Next we drive in the bus to the paranoiac view point of all three main Giza Pyramids. We take a team photo.

IMG_0896a

The locals want to ride horses down to the Sphinx. Most of us get on a horse but some are afraid or want to ride a camel. Some are just plain old boring and take the bus down. (Richard and his crew.) The camel/horse guy double crosses Michael (the local who negotiated the deal) and we are taken down to the Sphinx and then back to where we started. So we take the bus down to the Sphinx to meet Richard and crew.

IMG_0932a

By now we have been at the Pyramids for about 5 hours and are hungry for lunch. There is a Pizza Hut right across from the Sphinx. I say "let go in there!" and our only dissenter is Remi who says "I can get Pizza Hut in the Netherlands but not Falafel." The locals really want American fast food, who can blame them! I tell Remi that I can get falafel in New York, but not Pizza Hut. (True) So we split up and get some Pizza Hut. The view of the Sphinx inside of Pizza Hut is awe inspiring and my photos are better then outside due to the height of the second floor.

IMG_0943a

After hanging out and shooting the breeze we take the bus back to the hotel, which contains the largest shopping mall in the Middle East and shop. I decide to hang out in Starbucks and wait for the girls.

We then depart for the Nile where Remon has arranged a boat ride, dinner, and birthday cake as well as Arabic music and dancing. It is a full moon and we cruse along the Nile for a few hours, eating, dancing and having a blast. Several happy birthday chants were sung in both English and Arabic. 

We head back to the hotel, have a drink and pass out. It sure has been an interesting 36 years so far.

PS: flickr photos are here.

Friday, February 22, 2008 10:21:09 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]Trackback
 Friday, June 22, 2007

The 2007 version of the Pakistan Developers Conference was great. I had an amazing time in both Lahore and Karachi.

In Lahore I presented:

TSQL Tips and Tricks. Code and Slides here.

Database Design Patterns. Code and Slides here. (I also presented this in Karachi and TechEd Orlando so you can download too.)

Agile Development: Introduction to Scrum. Slides here. (Karachi too.)

In Karachi there was also:

WCF Overview. Code and Slides here.

Building a Scalable Environment for ASP. NET. Slides here. (Don’t forget n+1!!!)

Thanks for all of the memories, especially doing the Punjabi dancing at the end of the sessions in Karachi!!!

Say cheese:

 

Friday, June 22, 2007 12:44:56 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Sunday, October 29, 2006

Check us out in Bulgaria on .NET Rocks.

Check out Martin's great blog post here.

Sunday, October 29, 2006 7:54:40 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Tuesday, October 10, 2006

Bulgaria has great food, beautiful women, and great rakia. Learn more from Carl.

Tuesday, October 10, 2006 8:31:18 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Wednesday, August 30, 2006

Malek and Richard started a rumor that girls in the Middle East like me.

Maybe this is a case of believing your own hype, but I think I have something here with Turkish rock stars. First there was Candan Erçetin. I met her in Istanbul last April. She liked me. Then the infamous incident of the beautiful young rock star (Sebnem Ferah) last December in Istanbul. (I won't say anymore to protect both the guilty and innocent.) Now Hepsi. They have made a song where they shout TEMPO TEMPO FORTE FORTE FORTE!

Maybe I should move. :)

You can watch the video of the song here:

Wednesday, August 30, 2006 12:18:07 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Friday, June 30, 2006

The 2006 Pakistan Developers Conference is a smashing success! Today is Day 3, boy have they worked me hard, 3 sessions each day. The code downloads for my sessions will be available in about a week, the presentations are here for XML Part I, XML Part II (XQuery), SQL Everywhere, ASP .NET Design Patterns and Writing Secure ASP.NET Code (All user input is evil!).

I love Pakistan, I hope to be back next year. Tonight Richard and I do the closing keynote, we will be showing 3-D rendering and collaborating with WinFX (.NET 3.0), Vista, Office 2007 and Sharepoint Services 2007.

 

 

Friday, June 30, 2006 12:53:43 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Tuesday, May 23, 2006

Whenever the Dutch put on a conference, things get a little crazy. Luckily you can listen in on some of the fun on .NET Rocks as well as Mondays.

My red light district story is 21 minutes in to the .NET Rocks, just don't tell my mom....

Tuesday, May 23, 2006 7:19:56 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Monday, April 10, 2006

Today I saw one of the most amazing things in my life. So subtle yet so powerful. While on my way to speaking at the Gdansk .NET Users Group we passed the docks. The place where communism died.

 

Not everyday you can walk past something so historical and so important in the history of the world. What is funny is that my friend Michal Chaniewski just said very casually as we passed: “Oh here are the docks. You know we had strikes here in 1980 led by Lech Wałęsa.” I said “they were not just strikes man.” I studied the Solidarity movement in Poland very closely in university and Michal was being very modest. He said, “I guess. What happened here did change Europe.” I replied: “What happened here changed the entire world.” We went on to talk about Lech Wałęsa and communism and then of course .NET.

 

Just across the street we went to the offices of Computer Services Support, an old communist era building to have the first ever user group meeting of the Gdansk .NET Users Group. I was honored to be the first speaker. While talking about the Model-View-Controller design pattern, I was amazed that I was standing just meters away from a place that changed the world. You can see the docks from the classroom.

Monday, April 10, 2006 5:04:05 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Friday, March 31, 2006

I was in western China visiting Buddhist caves when Katrina hit and missed most since I did not have access to TV and news. When I got to Shanghai a few days later I was horrified. When I finally got home a few weeks later, I donated money to the cause. I supported the president when he said we will rebuild no matter how much it costs. I have to admit, around the beginning of this year I had started to forget about it. The news stopped talking about it. Then recently there was a “Katrina 6 months later story” on the news here. I felt very guilt. So I decided to visit New Orleans and see what I can do.

 

This past weekend I visited New Orleans. I stayed with a very good friend who just got back recently. Lucky for him, his home, near the French Quarter, is on a hill and sustained no damage. Quite amazing, his little area was relatively ok. Some roof damage and down trees, but all is ok.

 

Then we went for a drive. It was night and day. Only about a mile away the roads started to break down into potholed paths and the destruction was all over the place. The place is still a complete mess, 6 months later. Entire neighborhoods are wiped out. I felt like I was on a “Day After Nuclear War” Hollywood set. House after house on street after street, neighborhood after neighborhood was wiped out.

 

We drove down streets near the water (lower 9th ward) and it is worse then the worst street I ever drove down in sub-Saharan Africa after a bad rain storm. Garbage everywhere, homes gutted, crushed and destroyed. The compete absence of life except for grass.

 

I can’t even start to describe the destruction. And this is 6+ months later, cleanup has already started. We drove down some streets and got out and walked around. Every single home was destroyed. You heard echoes! In a crowded city street, so quiet, echoes. In areas where the homes were not completely underwater, they were under between 3 and 6 feet of water, so all was lost.

 

Every single home in New Orleans was searched house to house by the authorities. They spray painted on each house an X that indicated in each quadrant of the X some search information. On the top was the date it was searched and on the left side the agency who searched (National Guard, etc) and on the bottom the number of dead found. (Thankfully there were “only” about 1000 deaths in Katrina. Compared to the Tsunami or the Pakistan Earthquake this is very little.)  Dead dogs and cats found were also indicated. It was a sad and gruesome thing to see.

 

Only 200,000 people are back so far. Businesses that want to reopen can’t since they can’t find workers-there is no place to live. My friend is a chef (a famous one actually!) and we visited a restaurant where he knows the owner. He told us that they had an ad in the paper for over a month to find the workers and only now are starting to hire some people, but at most they will be at 50% power. The waitress told us about the rents getting jacked up since there is now a limited amount of living space.

 

Having lived through 9/11 and its aftermath on my city, I really have started to live my life differently and look at the world differently.  Residents of New Orleans will most certainly do the same. Being a New Yorker I feel that the rest of the world and the country has forgotten the pain that we went through, just 4.5 years ago. I fear the same is happening to New Orleans.

Friday, March 31, 2006 10:55:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Wednesday, February 08, 2006

That is all I have to say, besides a very very late night celebrating with the locals over the win in the Africa Cup semis.

Wednesday, February 08, 2006 2:07:03 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]Trackback
 Saturday, February 04, 2006

I have to hand it to Microsoft. Just when I get pissed off at them for Office Service Pack 2 (don’t ask) they remind me why I am in their camp.

 

I am in Cairo, Egypt at the moment with the anti-suck gang (the four founders are all here: me, Goksin, Malek, and Clemens) preparing for the 2006 Middle East Developers Conference. What is amazing is that we have 5,000 developers turn out for this event.

 

Why I give Microsoft so much kudos for putting on this event is that the developing world needs to build a rock solid technology based economy and Microsoft is right there leading the way. The charge for this conference is very low (about $8.75 USD) and the entire amount of money collected won’t even cover Clemens’ mini-bar bill. Microsoft has made such a commitment to the developing world, it is quite impressive.

 

I’ll be giving 4 talks:

 

XML in SQL Server 2005: The XML Data Type

Ranking and Windowing Functions in SQL Server 2005

Building Enterprise Applications with SQL Server Mobile 2005

Writing Secure ASP .NET Code

 

Saturday, February 04, 2006 11:05:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [3]Trackback
 Sunday, October 09, 2005

I know that all my firends in Pakistan read my blog, and let me say my heart goes out to you. You and your country really touched me on my most recent visit.

While most of my firends are safe in Karachi, I had to search for Saqib Ilyas in Lahore, much closer to the epicenter. Thankfully he is ok.

My buddy Fahad Majeed reports about the earthquake here.

You can donate here.

Sunday, October 09, 2005 9:38:32 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]Trackback
 Wednesday, September 28, 2005
That was my time for a mile in the race this weekend down 5th Avenue. In some respects a mile that fast was harder than the marathon. Headed out to Redmond, Washington to visit the boys at Microsoft at the MVP Summit. Should have some good stories to tell in the old blog while I am out there.
Wednesday, September 28, 2005 3:30:10 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Wednesday, September 07, 2005

Back from China and ready to start the fall marathon season in New York along with the usual list of conferences, MVP Summits and the like.

 

A very quick synopsis on China, well it was pretty cool. Got to experience communism first hand (and made me not take for granted the freedoms I have as an American) and see some amazing historical, religious and cultural areas. I met so many everyday Chinese people, very excited to practice their English talking with me for hours and exchanging views and ideas.

 

While I went to several places in China (Beijing, Datong, Dunhuang, Xi’am, Shanghai, Hong Kong and Macau), I have to say two places really stuck out for me.

 

 

First is the Great Wall. It lives up to its reputation. It is steep, vast and goes on and on and on. I kept climbing on up, seeing in the distance a watchtower and figured to myself “well this watchtower should be the last one, I can then view over the other side of the mountain.” Then when I got there, there were just more and more and more. A truly amazing experience.

 

Second is the Yungang Caves, just outside of Datong in the Shanxi Province. These caves were carved out of a mountain by Buddhists 1500 years ago (yes 1500) and are a very special place-it was a bit of a pilgrimage for me. Started in 450 AD, Yungang is a relic of the Northern Wei Dynasty (386-534). It is a combination of Chinese and  Indian Gandhara Buddhist art. Chinese are not like the Buddhists in other parts of SouthEast Asia that are Theravada, the Chinese are Mahayana.

 

Anyway, I saw a ton of other great stuff, but don’t want to bore you all with the details. Time to get back to the Model View Controller Design pattern…..

Wednesday, September 07, 2005 8:01:09 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]Trackback
 Wednesday, August 24, 2005

Today we woke up and visited Mao’s Tomb. A brutal reminder that while economically free China is still a one party state without any elected government.

 

Climber the Great Wall, visited the Forbidden City and Summer Palace (which rocks), of course a visit to a Buddhist Lama temple rounded out some time in Beijing.

 

Now I am in Datong, where no English is spoken at all. Visiting some old Buddhist Caves and Monasteries tomorrow before off to Xiam to see the warriors.

(This does not suck)

Wednesday, August 24, 2005 8:52:46 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]Trackback
 Tuesday, June 21, 2005

last week I visited the unique Chawkandi Tombs outside of Karachi. The tombs are from the 15th to 18th century and very elaborate. The photos do not do they justice, they span for over 3 km. Here are the photos:

These are what most look like:

Here is one shaped like a mosque:

Tuesday, June 21, 2005 11:56:17 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]Trackback
 Tuesday, May 31, 2005

 

So last night during the geek night session at the SDC, the Dutch, inspired by Richard Campbell called me on my SMO Backup and Restore GUI that had a progress meter. They thought I was hacking it, not that I was actually providing a true representation of the progress made by the status of the backup. Here is the progress meter in action, as the database backup makes progress we update the progress meter:

 

 

 

To do a backup programmatically you can to use SMO (see yesterday). Begin by setting the variables to get started.

 

Server svr = new Server();//assuming local server

Backup bkp = new Backup();

 

Cursor = Cursors.WaitCursor;

 

Then you have to set the device to backup to and what database to backup. Notice in the comments the code to the progress meter

 

try

{

      string strFileName = txtFileName.Text.ToString();

      string strDatabaseName = txtDatabase.Text.ToString();

                       

      bkp.Action = BackupActionType.Database;

      bkp.Database = strDatabaseName;

 

      //set the device: File, Tape, etc

      bkp.Devices.AddDevice(strFileName, DeviceType.File);

      //set this when you want to do Incremental

      bkp.Incremental = chkIncremental.Checked;

 

      //progress meter stuff

      progressBar1.Value = 0;

      progressBar1.Maximum = 100;

progressBar1.Value = 10;

 

      //this gives us the % complete by handling the event

      //provided by SMO on the percent complete, we will

      //update the progress meter in the event handler

                       

      //set the progress meter to 10% by default

bkp.PercentCompleteNotification = 10;

//call to the event handler to incriment the progress meter

bkp.PercentComplete += new PercentCompleteEventHandler(ProgressEventHandler);

     

//this does the backup

      bkp.SqlBackup(svr);

      //alert the user when it is all done

      MessageBox.Show("Database Backed Up To: " + strFileName, "SMO Demos");

 

                       

                       

      }

catch (SmoException exSMO)

      {

      MessageBox.Show(exSMO.ToString());

 

      }

catch (Exception ex)

      {

      MessageBox.Show(ex.ToString());

      }

 

finally

      {

      Cursor = Cursors.Default;

      progressBar1.Value = 0;

      }

 

 

Here is the ProgressEventHandler, notice that I made it generic enough that I can call it from both the backup and restore methods!

 

public void ProgressEventHandler(object sender, PercentCompleteEventArgs e)

      {

            //increase the progress bar up by the percent

            progressBar1.Value = e.Percent;

      }

 

Tuesday, May 31, 2005 5:28:53 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]Trackback
 Monday, May 30, 2005

The Software Developers Conference in the Netherlands has begun. Today I show how to prevent SQL Injection Attacks in ASP .NET as well as other cool tricks. Lots of RDs here and lots of happy attendees. As usual at SDC I will show something very new and cool. I will show off some of the new SQL Server Management Objects (SMO) in the keynote tonight. Ill give you a preview here.

The SMO object model is a logical continuation of the work done in SQL-DMO. SMO is feature-compatible with SQL-DMO, containing many of the same objects. . To achieve maximum data definition language (DDL) and administrative coverage for SQL Server 2005, SMO adds more than 150 new classes. The primary advantages of SMO are in its performance and scalability. SMO has a cached object model, which allows you to change several properties of an object before effecting the changes to SQL Server. As a result, SMO makes fewer round trips to the server, and makes its objects more flexible. SMO also has optimized instantiation, meaning that you can partially or fully instantiate objects. You can load many objects quickly by not instantiating all the properties of the objects. To get started you have to set a reference to it and pull in the namespace:

using Microsoft.SqlServer.Management.Smo;

Now I will show you how to programitically do a database restore. You start with getting the SMO objects: Server and Restore.

Server svr = new Server();

Restore res = new Restore();

Now take a look at how easy you can do a restore, just a few lines of code:

res.Database = “AdventureWorks“;

res.Action = RestoreActionType.Database;

res.Devices.AddDevice(“c:\mybackup.bak“, DeviceType.File);

res.ReplaceDatabase = true;

res.SqlRestore(svr);

There is a lot more that you can do with SMO, but this shows you how easy it is to manage your server from code. A very cool thing to do it put some of the server monitor stuff into an ASP .NET page for viewing your server stats from a remote location.

More on SMO to come...