Friday, July 08, 2005

Sandy Roach began the group meeting with a presentation of delegates and event handling.  Sandy tried to show us some simple examples of delegates in Visual Basic – including a sample which uses delegates to invoke a class’s instance and shared (static) methods.  Sandy also covered multicast delegates, which invoke multiple methods from a single call.  The power of delegates is that you can write code to call a single method, and then use delegates to have that one method call actually make calls to multiple methods.

Reading that sentence, it seems unclear.  So let’s try it with an example.  Suppose we have a program which deals with books.  We have two significant functions: PrintTitle and Totalizer.  If we create a delegate for each of those two functions, we can pass the pointer to the functions into a method call: ProcessBooks.  ProcessBooks with then either print the title of the book or perform the logic in the totalizer function, depending on which delegate was passed to it.  Notice that these two functions do nothing like each other – one handles strings and the other handles numbers.  The fact that the delegates for both have the same signature (number of parameters) means that you can use either delegate from the same method call.  Check back with the original post I wrote covering D’s presentation on delegates to the Mobility User Group.

— Matt Ranlett

posted with BlogJet

 

7/8/2005 1:33:40 PM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Thursday, July 07, 2005

I took one of those disposable cameras with me to Hong Kong so I wouldn’t risk losing something valuable.  Here are some of the photos I took while in the Far East.  Let me just say in advance that I’m slightly disappointed with the quality of the photos.  Oh well.

The view from my hotel room:

023_23 Nice pool.  Never went in it.

 024_24 The sky is indicative of the weather every day I was there – overcast and rainy.

Random shots of populated areas:

008_08 I know, it’s blurry.  This is a photo of the “Ladies Market”, an open air market named after the ladies who shopped here when it used to sell clothing.  Now it’s a free-for-all of thousands of different kinds of products, notably copy watches and handbags.  You can get some good deals here!

019_19 This is Stanley – an area of Hong Kong Island famous for an open air market and the Murray House (the two story building in the center-left).  The Murray House was built by the British in the early 1900s and later moved block by block to this area of Stanley so it’s original location could be used for a gigantic skyscraper Bank of China building.  Now the Murray House is full of restaurants

020_20 Central Hong Kong.  What you can barely see is that between the tall buildings, in the middle of the photo, is a mountain wreathed in fog.  The entire city is built into and on mountains!  Lots of steep hills here.  I’m taking this photo from the dock where the Star Ferry arrives on Hong Kong Island.

022_22 This shot is really grainy, not sure why.  Anyway, the glittering glass tower on the right is the Bank of China building (I think) – the original site of the Murray House.  The city stretches on past what the eye can see.

Lantau Island is home to Hong Kong’s homage to Buddhism – the world’s largest outdoor, seated, bronze Buddha.  Apparently every country boasts that is has the worlds largest Buddha of some sort (standing, reclining, stone, bronze, etc).  This big guy is about 30 feet tall, on the top of a plateau.  To get there you have to climb 261 extremely slippery marble steps.  Underneath the Buddha is an educational museum and vegetarian dining hall.  The project to build this statue was conceived in the early 1970s and finally completed in 1991.

009_09 Standing on the ground, you can get a real feel for the size of the Buddha.  The 261 stairs are directly in front of me.  I’m currently standing in some sort of spirit circle.

017_17 016_16  In these two shots I’m climbing up to the top of the plateau.

013_13 

015_15 These bodhisattvas (there are six statues of them at the top of the platform) are shown giving gifts to Buddha.

010_10 Finally the fog cleared for a moment.  Long enough for me to take this photo.

011_11 Looking down from the top.  On the left you can see the spirit circle I mentioned before.  To the right of that is an enormous free standing gateway.  To the far right you can see the dormitories and study area of the monastery.

— Matt Ranlett

posted with BlogJet

 

7/7/2005 12:21:40 PM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Thursday, June 30, 2005

I have been using SharePoint for a while now as a user and have never really had much trouble with accessing the SharePoint sites I use.  Well I finally ran into a problem with one.  Here is the error I am getting:

 “You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.  

HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration.
Internet Information Services (IIS) ”

It turns out that Windows Authentication doesn’t always work so well with Proxy servers.  The solution to fix this is to use Basic Authentication and have SSL.  I will see if the guys I am working with will get this set up for me. =)

—Brendon Schwartz

Posted with BlogJet

 

6/30/2005 1:16:21 PM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Tuesday, June 28, 2005

Top announcement of the day: the mini Code Camp in Charlotte on August 20th.  Brendon and I are already registered.  Keep an eye on Maxim’s blog at www.ipattern.com for more details as they become available.

In other news, we had four companies looking to hire developers, including Magenic and Avanade.  This does not include the recruiter who showed up for the first part of the evening.

After a bit of fun with the projectors and laptops, the presentations got underway.  Doug Turnure filled in for Marty Mathis (unable to make it) and gave a brief look into how Reflection can expose your innermost private values.  Just to review, reflection works by reading the .Net metadata to dynamically discover methods and fields.  Doug began the presentation with a simple base class that he used as the object of reflection:

public class Customer
{
  public string FirstName;
  public string LastName;
  private string Secret

  public Customer(string firstname, string lastname)
  {
    FirstName = firstname;
    LastName = lastname;
    Secret = "SerenityNow";
   
    public void Buy()
   {
     Console.WriteLine(me.FirstName + " is buying something");
   }
   
    private void SecretBuy()
   {
     Console.WriteLine(me.FirstName + " is secretly buying something");
   }
  }
}


Then we took a tour through reflection with the following code (I’m not bothering to write everything out)

using System.Reflection

Customer c = new Customer("Doug", "Turnure");
Type t = c.GetType();

foreach(MethodInfo mi in t.GetMethods())
{
 // write out all the public method names
 Console.WriteLine(mi.Name);

  // invoke the Buy method
  if(mi.Name = "Buy")
  mi.Invoke(c, null);
}

// use the binding flags to specify which types of methods and fields to reflect on
BindingFlags bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.FlattenHeirarchy

// show all methods
foreach(MethodInfo mi in t.GetMethods(bf))
{
 // write out all the method names
 Console.WriteLine(mi.Name);

  // invoke the private SecretBuy method
  if(mi.Name = "SecretBuy")
  mi.Invoke(c, null);
}

// this can be done to fields as well - even allowing changes to fields
foreach(FieldInfo fi in t.GetMethods(bf))
{
 // write out all the field names
 Console.WriteLine(fi.Name);

  // change the value of the private field Password
  if(fi.Name = "Password")
  fi.SetValue(c, "New Password"); //this will also overwrite readonly data
}


The reason this scary stuff works is because the runtime needs to know about your code, so everything is exposed.  The only way to prevent someone from hacking your assembly is not to give it to them.  Use web services.  Or partially trusted permissions.

Doug finished his presentation and received polite applause as most people in the room looked around at each other in shock that their private data wasn’t actually private.  Similar to the SPIDynamics presentation on SQL Injection and cross site scripting – there were several panicky looks…

Up next after Don was Steven Tynes from Avanade to present the Enterprise Library.  For those who don’t know, Avanade is a joint venture between Accenture and Microsoft.  They’re looking for bright people, so if you want a traveling job….

The Enterprise Library is the next logical growth after patterns (atomic solutions to common programming problems) and application blocks (subsystem level guidance for common services).  The Enterprise Library helps to make the app blocks more consistent, easier to configure, and work together better than they did previously.  Entlib is actually part of the patterns and practices guidance library and is a growth from Avanade’s original Application Connected Architecture for .Net (ACA.Net).  The entlib is entirely free and is used as part of the framework for hundreds of software projects.  Avanade has actually integrated the Enterprise Library into their new version of ACA.Net and is using it in over 30 clients’ projects.

We listened to Steven talk about the entlib configuration tool and the Data Access block for the majority of the time.  There were so many questions from the group that the presentation quickly and frequently wandered away from the core material.  Rather than try to cover what actually was said (the continuous questions were so distracting I stopped paying attention), I’m going to paste in a review of the Entlib I wrote several weeks ago when I saw Richard Weeks from Avanade presents the Enterprise Library:

The Enterprise Library wraps several of the PAP application blocks (Data, Config, Crypto, Security, Exception, Logging, etc).  The goal of the enterprise library is to simplify the use of these blocks.  For example, the extremely slick Configuration tool (add to the Tools menu by customizing the menu) will create all the XML in the App.config file based on a user friendly GUI as opposed to writing the XML on hand.  The Database block allows you to connect to a DB, execute a stored proc, and bind the results to a grid in three lines of code.  The logging component makes logging so easy it’s almost hard to believe.  One line of code – Logger.Write(“text here”) – that’s it!  Based on the config, we were logging to two places at the same time with independently configurable levels of detail.  The exception component allows “exception policies” to be defined and log, wrapping an exception with another exception, replacing an exception with another, or create your own action.  The exception policy tool was really sweet – complete with a list of potential exceptions (reflection, anyone?) you can select from.   Dan and I both enjoyed this presentation – it looks like something really useful.

— Matt Ranlett

posted with BlogJet

6/28/2005 2:32:50 PM (Eastern Standard Time, UTC-05:00)  #    Trackback

The GrokTalks are uploaded and ready to be downloaded and watched. http://www.groktalk.net/blog/

—Brendon Schwartz

Posted By BlogJet

6/28/2005 1:31:04 PM (Eastern Standard Time, UTC-05:00)  #    Trackback

Portalcodecamp
 

 

Announcing the Portal Development Mini Code Camp – featuring Maxim Karpov

 

Microsoft Charlotte Campus

8050 Microsoft Way
AP2 Building Charlotte North Carolina 28217


Register Now

Join us for our newest Charlotte Code Camp! This one day Code Camp consists of a single track, and is dedicated to portal technologies such as SharePoint, DotNetNuke, and ASPNET 2.0. Our speaker will be Maxim Karpov, who has been one of our highest rated code camp speakers. All PPTs and samples will be given out to attendees.

As always, the Code Camp Series represents the best technical content by the local developer community and select Microsoft Developers, put on for the community, at no cost. Code Camps are always free and guaranteed to be the most fun that you can have anywhere!

Tentative agenda (subject to change):

8:30-9:00          Registration
9:00-9:15          Opening comments
9:15-11:00        Session 1: What is a Portal Application/Glimpse of technologies
11:00-11:15      Break
11:15-1:00        Session 2: SharePoint Technologies
1:00-2:00          Lunch
2:00-3:45          Session 3: DotNetNuke
3:45-4:00          Break
4:00-5:45          Session 4: ASP.NET 2.0
5:45-6:00          Closing comments
6:00-7:00          Chalk board session 

There are ONLY 200 seats available for this event, so sign up now...

 

http://blogs.msdn.com/trobbins/archive/2005/06/27/433183.aspx

6/28/2005 1:05:53 PM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Sunday, June 26, 2005

Kim had a really nice SLR style Kodak digital camera that died a horrible death when it met pavement accidentally (not either of our faults).  We’ve been researching new cameras together for a while now, and yesterday before we got home from the lake we stopped into Best Buy to get it.  We were spurred into action b/c we forgot to bring a camera to the lake with us to capture the high flying inner tube action (along with Heidi’s dragboat racing skills).

We picked the Canon S2 IS: Canons2is

It looks like a great camera with loads of nice features (including a 12x optical zoom) but the reason we bought it is because it passed the moving hand test the best.  Kim’s biggest pet peeve with digital cameras (and Brendon’s too, apparently) is that when you look through the view finder or LCD screen and pick what you want to capture, you press the button and some time later an image is captured.  The moving hand test demonstrates this.  Take your hand and move it in an exaggerated arc slowly from one side to another, in front of your face.  Have the person testing the cameras try to capture an image as soon as your hand is in front of your face.  Most digital cameras will catch your hand way off to one side, if it’s still in the frame.  The ideal camera will catch your hand exactly in front of your face, as it was when you press the button.  Of the half dozen cameras we tried – the Canon S2 IS came closest to this ideal image.

I haven’t really played with the camera yet – I was too sore last night with my sunburn to actually do anything other than whimper.  I’ll test it out later – maybe a shot of how sun-burned my back is or something…  I know everyone wants to see something like that, right?

— Matt Ranlett

posted with BlogJet

6/26/2005 7:01:15 AM (Eastern Standard Time, UTC-05:00)  #    Trackback

The last three days I was in Hong Kong, I spent wandering around the town shopping, eating, and generally mixing with the population.  I noticed a few things I found interesting, so I thought I’d share them:

  • Toyota cars rule the road, but I did see plenty of other models, including a Ford!  No GM vehicles, but plenty of cars I couldn’t identify.  Lots of the familiar manufacturers were selling models I had never seen before.  All of the taxis were Toyota Crown Comforts – big and boxy.  I didn’t write down the rest, but aside from the ever present Corolla and Camry, some BMW, Lexus and Mercedes cars, there were lots of cars I couldn’t place
  • The public transit is so good and so effective, that most of the vehicles on the road were being driven by professional drivers – cabs, buses, and trucks.  Lots and lots of trucks.  The entire time I was driving around (in a bus) I didn’t see a single accident nor a single person pulled over by the police.  Must be nice to not have traffic jams caused by morons and moron rubberneckers!
  • If Toyota rules the road, Nokia rules the cellphone market.  Three out of every four cellphones are made in Finland!  The majority of the rest of the phones are Sony Erickson.  I even asked someone about the Nokia phones vs the other phone brands and they told me that no one liked anything else.  Nokia was where it was at.
  • Everyone has an MP3 player, even people my grandmother’s age!  When you spend lots of time waiting on buses and trains, you want something to help you zone out, I guess.  The variety is HUGE.  I’ve seen every model Best Buy carries and then some.  My favorite little ones were tiny little cubes the size of a single die (you know, from a pair of dice).  Apple has pretty good penetration here as well, but I think the most popular brand was JVC – they have a cheap little 1Gb player popularly worn with a neck strap.
  • It is far more common to tie a strap to your cellphone and hang it around your neck than it is to put it in a belt case.  With all the cellphones, MP3 players, random ID cards, and more hanging from around people’s necks, it made me wonder if their clothes didn’t include pockets!
  • The people there were super nice.  Most of the people speak some English, and if they don’t speak enough English to talk to you they go get the person who does speak English.  I only walked into one restaurant where I was immediately given silverware instead of chopsticks b/c I was the Westerner.  Everywhere else I was treated like a native (except of course for the people trying to sell me copy watches and suits from the side of the roads.
  • I’ve already commented on how the schools in Hong Kong are starting to minimize the importance of English next to Mandarin Chinese due to China’s booming market.  On my way home, I was pleased to meet two good ol’ boy college students from Alabama who were spending two years in school in China so they too could work with the booming Chinese market.  After ten months in school, immersed in the Chinese language and culture, these two guys were anxious to get home and relax for a bit.  We found a Subway in the airport in Korea and all had subs for breakfast – food they’ve not had since December!  Taco Bell and Chick Fil A were also high on their TO DO lists.  Great guys, we spent time chatting and watching movies during our 5 hour lay-over in Korea.  They were bringing home several pirated movies purchased on the streets of China and we managed to find a plasma screen TV and a DVD player not currently being used.  Good times in Korea!

Hong Kong was like New York City.  You should visit both if you get the chance, but a visit to one of them is a requirement for a fully rounded life.

— Matt Ranlett

posted with BlogJet

6/26/2005 6:49:39 AM (Eastern Standard Time, UTC-05:00)  #    Trackback

It’s been a quiet couple of days on the blog as I have been trying to get back to a normal sleep pattern after my visit to Hong Kong.  I’ve generally been falling asleep as soon as I get home from work, which means I haven’t been able to get anything done after hours.  Oh well, the trip was fun and I think I’m back to Eastern Standard Time now.

Yesterday, Brendon and his wife Heidi invited myself and Kim to meet them at their vacation house on the north shore of Lake Lanier.  Ok, so it’s really Heidi’s parents house, but even so…  We took the pontoon boat out for a few hours, enjoying lunch in a relatively quite cove, plenty of slow drifting and conversation, and some inner tubing.  If you’re not familiar with inner tubing, it’s loads of fun.  You attach an inner tube to the back of the boat by a long rope and drag it (with someone in it) at 30 miles per hour across the water.  The poor schmuck inside (usually me in this case) tries to hang on for dear life while the cruel boat driver (usually Heidi) tries their best to dump you out with whip-like turns and ramming you over the wakes of other boats.  I think I rode the inner tube ten times!  It’s exhausting, trying to hang on so hard.  Actually, getting back on the inner tube once you’ve been dumped off is the most exhausting thing.

The lake was great, and I’m hopeful that Kim and I get invited back, but I’ve learned my lesson.  The sun-block I used clearly was not as waterproof as it’s label suggested, and I look like I’ve been boiled!  While I was at the lake, everyone was commenting on how red I was, but I didn’t feel bad at all.  By the time we got near the house, I was forced to stop at CVS to get some aloe vera gel.  Kim and I both got burned, but I’m worse off by far!  Maybe it was all the dragging?  Kim only volunteered to be dragged once.  Anyway, we slathered ourselves with aloe vera and sat around trying not to touch anything for a while before falling asleep from sheer exhaustion.

Good times at the lake.  I’m sorry that the other people who were invited couldn’t make it out.  We spent hours drifting around talking, and Brendon and I only talked about our computers and the .Net community activities for an hour or so of the time.  We did get made fun of by the girls when I opened Brendon’s water bottle for him, but I don’t understand why…?  It’s not like we’re a married couple or anything…

— Matt Ranlett

posted with BlogJet

6/26/2005 6:23:33 AM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Friday, June 24, 2005

It is funny how you stumble onto one thing, by looking for something else.  I was looking something up on the web for a friend and ran across a blog, guess who it was.  It was our old friend Rusty.  I don’t know how long he has been blogging here, but check his blog out. http://vitaminzrecords.com/blog/default.aspx.  I am glad I found his blog again.

—Brendon Schwartz

Posted with BlogJet

6/24/2005 2:24:02 PM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Monday, June 20, 2005

If you are looking for components and want help selecting one, check out this site for How to select guides.  This is for .NET applications and the first article is on PDF components.  There should be more  coming soon.

— Brendon Schwartz

Posted with BlogJet

6/20/2005 10:40:05 AM (Eastern Standard Time, UTC-05:00)  #    Trackback
 Saturday, June 18, 2005

The Hong Kong Octopus Card is a wonderful kind of smart card where you can put money on the card (and the money is stored on the card itself, not on some central server) and use it like a debit card.  The nice thing about the card it that it works via radio signals or something, similar to the security systems in lots of corporate buildings where you hold a card up to a plate to get through a door.  So you don’t even have to take it out of your wallet or purse.  This payment system is the de facto method of paying for the subway system here, but tons of merchants accept it too.  There are even vending machines that accept it!  All I have to do is press my butt up against the vending machine and I get a soda!  Pretty darn cool!

I know that this kind of thing exists in other places, but I doubt it is as well integrated into the culture as the Octopus Card is integrated into Hong Kong.  The thing is pretty much everywhere, and I love it.  I see that in the US some of the movie theaters are starting this up with a MasterCard type of smart card.  I’ve seen them at Regal Cinemas.  The problem is, in Atlanta, I don’t know where to buy a card and recharge it.  However, it is a great way to give money to someone (I’m thinking of children here) and them not being able to use it for anything other than what you intend them to do with it.  I’m hopeful that this takes off in the US as it’s really really convenient.

— Matt Ranlett

posted with BlogJet

6/18/2005 10:03:24 PM (Eastern Standard Time, UTC-05:00)  #    Trackback

Works over for me out here and I’ve got three days of vacation.  I spent one of them yesterday wandering around Hong Kong on my own.  I’m going to compare my visit to Hong Kong to the time I wandered the streets of New York City.

First of all, Hong Kong is actually made up of two islands and part of mainland China.  My hotel and the place I’ve been working are both on the mainland, which they call the New Territories.  The hotel is nice, but it’s way out in the suburbs.  I took a shuttle from the hotel to the edge of the mainland, a place called Tsim Sau Tsui or TST for people who can’t say Chinese words.  Wandering around here was a lot of fun.  I’d compare this to the Times Square area of NY.  Lots of neon signs pointing your way into electronics shops, lots of music blaring from the various CD and movie shops, and lots of little restaurants.  I ate dinner in one of the restaurants here.  You know how they say back in the States that if Chinese people are eating in a Chinese restaurant, it must be good?  Well, that’s harder to decide in China, but I picked on where the Chinese people were forming a line or a queue (crazy Brits and their crazy words) outside waiting to get in.  It was worth it.  I’m not sure I can tell you exactly what it was I ate, but there was chicken, beef, and rice.  I picked it from a picture.  I also got a “special drink” which translated into a kumquat smoothie.  Tasty!  I think I spend a total of 5 or 6 hours walking around TST looking in the electronics shops and the various curio shops (I wish I thought to bring my pedometer – I’m sure I went 5 miles).  I didn’t buy anything, but I did notice that prices vary wildly from shop to shop.  I found that I could save nearly $120 US just by looking in each store.  Of course, that was on the really fancy new cellphone I lust after but won’t allow myself to buy.  Back at TechEd, Glen Gordon showed the i-mate JAM off to me and told me it ran at nearly $650 in the States – I found it for around $520 here.  Le sigh. 

The other thing I noticed while wandering around TST was that I got hit up by street vendors for nearly everything – especially what they call copy watches and massages.  I’ll get into the copy products in a moment, but let’s focus on the massages.  There’s a huge cottage industry built up around reflexology and foot massages here.  I couldn’t walk a single block without being asked at least twice if I wanted a foot massage.  Of course, I also got offers to massage pretty much all the other various bits of my body – including the kind of “massage” where I’d be concerned that I might catch leprosy and have the various “bits” fall off. 

The people I call the “copy people” were very intent – they want to sell me a fake Rolex or something really really badly.  There’s a guy on the street and he’ll show you his watch and ask if you want one by reciting a litany of watch brand names.  I didn’t even recognize all of them.  Should I have said I was interested, they would have taken me to show me their wares somewhere.  Apparently they have rooms inside the tall buildings somewhere.  I didn’t go with anyone to find out.

The only people more intense than both the massage people and the copy people were the tailors.  There’s at least one guy pimping for a tailor shop on every major street, and these guys follow you around trying to talk you into buying a custom made suit or something.  They’re doggedly persistent and they’ll follow for half a block or more calling me “boss”.  Avoiding these guys was half the fun of walking around TST.

I noticed the copy people and the tailors ignored the locals, but the massage people were equal opportunity panderers.  Men got way more focus than women and Caucasian men got the most focus of them all.

After getting tired of TST, I jumped on a train which went under the water to Hong Kong Island and dropped me off in a place called Central.  This is the heart of downtown Hong Kong and was kind of like being in the really nice area of Manhattan.  I wandered into a really large, really nice mall (looking for both A/C and a restroom) and actually got lost on a single floor trying to find the right exit.  Way bigger than Lenox mall back in Atlanta, it also had nicer shops.  It was kind of like the Forums in Caesar’s Palace back in Las Vegas (which I saw when Kim took me to meet her family in Las Vegas), only larger.  There were four floors in this mall, and I only went on one of them.

Central was mostly a high end shopping district and way out of my budget, so I wandered uphill to an area called Soho.  Soho in Hong Kong is exactly like Soho in New York – lots of nice little restaurants and bars.  They close down some of the streets at night for people to walk around on, and I’m sure this is a happening party district.  The problem with Soho in Hong Kong is that it’s built on the side of a mountain.  One lap around this place and I was ready to call it quits.  Those hills were intense!  They actually have built escalators which will take you to the top of Soho so you can wander in a downhill fashion.  I didn’t find them until the end, so I was really done.  I walked back to the MTR train station and headed back to the hotel where I passed out at 9:30 from sheer exhaustion.

— Matt Ranlett

posted with BlogJet

6/18/2005 9:41:50 PM (Eastern Standard Time, UTC-05:00)  #    Trackback