Welcome to MSDN Blogs Sign in | Join | Help

Speaking at UC Berkeley on September 30th on the computer science major

What: Minh T. Nguyen, a Cal Alumnus and Senior Software Design Engineer with Microsoft Mediaroom, will speak at the alumni panel at the Letters & Science 1 class about his experience choosing his major, getting his BS degree in computer science at Cal, how this experience has affected his career and provide some retrospective advice.

When: Tuesday, September 30th, 2008, 3:30pm

Where: 2040 Valley Life Sciences Building, UC Berkeley, Berkeley, CA

Why: Letters and Science 1 is a course for entering students, particularly those who are excited to be here but uncertain of where to start their explorations. It provides an introduction to the intellectual landscape of the College of Letters & Science, the campus's liberal arts college. There will be several alumni speaking briefly about their respective majors in L&S and provide tips and advice to first-year students.

Photosynth of Osaka Castle in Osaka, Japan and interior of Saint Peter’s Basilica in Rome, Italy

About two years ago, Microsoft showed a preview of Photosynth at the internal company meeting event, and wowed us all, but we weren’t allowed to talk about it. Then, almost a year later, the beta software was made available to employees, allowing us to play with it, but we could discuss or even show this outside of Microsoft. Well, last month, Microsoft finally released Photosynth to the world as a Microsoft Live Labs project, so I can finally blog about what a kick-ass awesome product this is, and publish two of my really synthy photosynths.

For those who don’t know, Photosynth is a software application that takes a set of digital photographs, and builds a three-dimensional cloud out of these pictures just through pure computational analysis. Without the user having to prepare or do anything at all, the software analyzes and determines how each photo relates to one another, provided that there is some overlap. The resulting mesh is then presented in a 3D world that allows you to navigate and zoom in and out with no limit on resolution or zoom factor. It’s hella cool, and absolutely stunning!

So, let me present to you to Photosynth that I painstakingly did on my last two vacations.

This is the interior of Saint Peter’s Basilica in Rome, Italy. While PT had a headache and was resting on a bench, I wandered around in there for two hours to take tons of pictures. From those, 291 pictures were reconstructed in this Photosynth that is 97% synthy.

This is Osaka Castle in Osaka, Japan. I took this earlier this year on my return trip from Vietnam. This Photosynth comprises of 621 photos and is 99% synthy. That’s a lot of photos! You can see the front, side and back of the Castle (yeah, only 180 degrees, I couldn’t go on the other side of the castle) .

This is just the start of what’s possible and I predict that this is going to make giant leaps in the world of artificial intelligence! Imagine taking a video of an object (say a bicycle). A potential software could decompose the video into pictures, feed it into Photosynth so that 3D cloud could be reconstructed. As a result, recognizing that the video includes a bicycle is then merely the same problem of optical character recognition (OCR)--a problem set that computer science has already solved fairly well (at least in the 2D world). This could also help with automatically tagging videos based on computational recognition. The software could identify all bikes in online videos, making a video search on ‘bikes’ actually work based on the content of the video and not on the honesty of people who provide the keywords.

Posted by minguyen | 1 Comments
Filed under:

Casting/converting generic List of a certain type into a List of another type in C#

Here’s an easy way to convert a generic List of a specific type to a List of another type.

List<double> listOfDoubles = new List<double>() {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9};

List<int> listOfIntegers = listOfDoubles.ConvertAll(doubleNumber => (int) doubleNumber);

listOfIntegers.ForEach(Console.WriteLine);

Sure, this example only casts doubles to integers (useless), but you could do the same for more complex conversions for reference classes (i.e, convert a list of Employee instances to a list of their salaries as a decimals).

Note how beautiful the code looks like with the usage of the lambda expression … isn’t C# 3.0 the coolest thing ever?

Windows Vista Vietnamese Language Interface Pack

Windows Vista Vietnamese Language Interface Pack

Microsoft released the Windows Vista Vietnamese Language Interface Pack (LIP) last month, and I finally got some time take a screenshot to blog about it. I installed it a few weeks ago, and I think it's pretty cool!! I am now running Windows permanently in Vietnamese so I can learn Vietnamese. The hardest part is to use the search functionality in the Control Panel, because you can’t type in "services" to find the NT services—you have to know the Vietnamese word for it (which quite frankly I still don’t know, haha). 

Another funny thing is that if you right-click on a webpage and choose "View Source", … well that’s translated as "Xem Nguồn"... hm... isn’t "Nguồn" more used as "roots"? Finding my roots? And what’s up with the random capitalization of Vietnamese words all over the place?

Anyways, if you are running Windows Vista, you can download and install the Vietnamese LIP here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=0E21EB7B-E01A-4FCC-B7F1-30E419DA7F5B&displaylang=vi

Have fun.... or shall we say.... Có sự vui đùa!

Minh T. Nguyen's Mandelbrot Explorer in Silverlight 1.1


Minh T. Nguyen's Mandelbrot Explorer is an application that allows you to zoom into the Mandelbrot set fractal at an arbitrary level. Simply select an area to zoom in, and use the back button to backtrace or restart button to start from the beginning. If you don't see the fractal above, please install the freely-available Microsoft Silverlight 1.1 plug-in (available for most popular browsers) using this link (the above link won't work). Note that this application is very power-hungry, so a fast computer is recommended.

Academic details: The Mandelbrot fractal is generated by drawing the set of complex numbers c on a complex plane, where the value of the function f(z) = z * z + c applied iteratively on itself is unbounded. In other words, if you pick a complex number c and an initial value of z being c, and apply the above function over and over again, you’ll see that the absolute value of the running result always remains bounded below 2 or suddenly shoots up towards infinity after a certain number of iterations. Well if the latter happens, you draw the complex number on the plane with a certain color that is reflective of how many iterations it took for the function to escape. But anyways, before mathematicians are lynching me for such a rude definition, you’re probably better off reading a formal description of the Mandelbrot set over at Wikipedia.

Technical details: This application was coded with the Microsoft Silverlight 1.1 Alpha September Refresh and is hosted via Microsoft Silverlight Streaming by Windows Live. The Mandelbrot generation algorithm is very loosely based on Marc Boizeau's implementation of using complex number classes and operator overloading, while the coloring of the complex points outside of the Mandelbrot set is borrowed from Pierre Leclercq's implementation. Since Silverlight does not support setting pixels in a bitmap, this Mandelbrot Explorer is setting tiny rectangles instead to mimic the same behavior, though some optimization have been made to reduce the number of UIElements drawn on the Canvas by recognizing neighboring pixels of the same color and drawing them all as a single rectangle. Since the Silverlight 1.1 Alpha September Refresh does not yet support marshalling the execution of code from the background thread to the UI thread (the "Invalid Cross-Thread access" exception), I had to resort to the empty timeline trick to display the progress status. The full source code for this Mandelbrot Explorer will be posted in the near future.

Personal details: So, why does the world need yet another Mandelbrot fractal generator? It doesn't. There are tons of them out there, with far more snappier UI and superior performance, but I wanted to create one to get my hands dirty with Silverlight. When .NET was still in its early stages, I coded the Sierpinski Triangle fractal to get my hands dirty with GDI+. When Silverlight came out recently, I first wanted to convert my WPF-based Sudoku 3D browser application to Silverlight, but as it turns out Silverlight does not have support for 3D geometry, so I ended up doing the Mandelbrot fractal instead. I've always been intrigued by the mother of all fractals anyways, and always wanted to learn and understand the mathematics behind it, so this was the perfect opportunity.

Posted by minguyen | 3 Comments

What I work on - Microsoft Mediaroom

Whenever people ask me what I work on at Microsoft, it always takes some time explaining.

I joined Microsoft TV  here in Silicon Valley two years ago working on the Microsoft TV Foundation Edition. It's a platform for cable providers such as Comcast to provide an interactive television experience with a Guide, Video on Demand, Search and DVR. In particular, I was responsible for the search feature that allows you to search for movies by actor, title, keyword. Unfortunately, even though my work made it into version 1.9 and 2.0, those versions were never deployed (and might not be anytime soon in the US).

Well, a little bit less than a year ago, I've switched over to the Microsoft IPTV product, which is a end-to-end platform that allows traditional telephone companies (telco) to enter the TV market by providing a full TV experience using IP technologies. It's like Voice over IP just for your good old television. Now, people always get confused and ask how we can compete with YouTube or Joost. Well, Microsoft IPTV is not competing with that, because that's something entirely different. IPTV is not watching video on your monitor over the internet using your computer. What our product does is to watch live TV and on-demand video on your good-old TV via set top boxes that transfer data via internet protocol.

Providers such as AT&T here in the United States stream those videos via DSL modems in HD-quality using our software. Given the IP's flexibility, you can imagine the endless possibilities that IP-based TV can offer versus traditional TV: interactivity (vote on your American Idol from your TV), unlimited amount of channels (since only one stream is sent to your box), picture in picture or multi view (watch a baseball game from three different angles), share media with friends and family (share images from your computer directly to your TV, or send them to your mom's TV in another state), chatting, home shopping, games, etc, etc, etc. In other words, it's the best in TV plus all your media in one place -- and that is our division's new slogan.

Microsoft Mediaroom - The best in TV plus all your media in once place.

Our IPTV division went through a huge rebranding this past month. Our product is now called "Microsoft Mediaroom" and it's an ingredient brand for other telcos. The same way Dolby Digital or THX are ingredient brands for movies, Bluetooth ingredient brand for cellphones or EnergyStar is an ingredient brand for electronics, Microsoft Mediaroom is an ingredient brand for TV providers.  We finally have a website geared towards the end-consumer (previously we only had marketing material geared for the telcos only). Check it out yourself on www.microsoftmediaroom.com and see what all the buzz is about.

Next time you sign up for TV service, ask for Microsoft Mediaroom and you might be seeing some of the features that I have worked on. In particular that would be Emergency Alert System (those "warning, there's a thunderstorm coming to your area" messages with R2D2-like sounds), Download and Play (the ability to download a high-quality Video-on-Demand assets over a low-bandwidth connection) and the notification messages (for instance the notification that displays caller ID info when someone calls your home while you watch TV), HDMI connections and of course a lot of bug fixes in all other areas. I think the really cool thing is that I work on a product that touch thousands and thousands of people every day. Our product is already deployed in the US, UK, Germany, France, Italy, Singapore, China, South Africa, Hungary--you name it. Many of the end-consumers don't even know it's Microsoft software driving this technology end-to-end, but if you happen to know, realize that those buttons that you click might as well be executing my code. :-)

Happy watching.

Minh T. Nguyen's Sudoku3D in XAML

I’ve already played with XAML almost a year ago when it was still in the early stages, but over my winter break, I spent some time getting my hands dirty with the 3D aspects of Microsoft’s XAML/Windows Presentation Framework. I decided to create a 3D version of the famous Japanese Sudoku game, and pretty much finished coding 90% of it already in December 2006, but it’s not until today that I finally found the time to wrap up the code, the user interface and fix all the pending bugs.

So, here it is: Minh T. Nguyen’s Sudoku3D

Minh T. Nguyen's Sudoku 3D

The Game

Just like in regular Sudoku, you need to fill in a row, column and “height column” of the cube with all natural numbers, so that each number appears once and only once. Unfortunately, the third rule of Sudoku (that a given 3x3 sub-square of a 9x9 Sudoku square contains all 9 numbers) does not translate into the third dimension. For instance, in a 4x4x4 Sudoku cube the 2x2x2 sub-cube has eight cells, not four. I therefore had to get rid of the third rule, which makes playing this game not as fun as I expected it to be. If anyone has any insightful suggestions on how to translate the third Sudoku rule into the third dimension, let me know.

Requirements

This game requires Internet Explorer as well as the Microsoft .NET 3.0 (which comes pre-installed with Windows Vista but is available as a separate download for other Windows systems). A fast and powerful computer running Windows Vista is preferred, as the Sudoku generation for large cubes can be very CPU-consuming (in fact, I don’t even allow you to generate cubes larger than 5x5x5 even though it’s theoretically possible). In addition, the graphics just looks much smoother on Vista since 3D anti-aliasing is only enabled there.

Development

Coding this game has been pretty fun. The hardest part of this all was actually not the 3D aspects of this, but the Sudoku generation algorithm itself. I never realized that creating a valid Sudoku is actually much harder than solving it. In the end, I’ve designed a backtracking algorithm using a stack of intermediate steps in conjunction with a 3D array of possible moves. Fun stuff.

Hope you all will enjoy playing this game as much as I enjoyed coding it!

Posted by minguyen | 5 Comments

Random Updates for December 2006

Bill Gates - Last month Bill Gates came down and visited our campus. I was sitting pretty much in the front row as he talked about the company’s direction. What I found more interesting though is how he describes his work on the Bill and Melinda Gates Foundation and its goal to eradicate human diseases. He applies a Microsoft-business-like mentality to the philanthropic world by attracting the world’s brightest scientists and providing them with the tools and finances that they need to achieve their goals. I always had a deep admiration for Bill Gates and Microsoft since high school, but his decision to leave Microsoft and spend his full-time life on the foundation starting July 2008 leaves me with awe. He says that “with great fortune, comes great responsibility”. Seriously, Bill is the new Spiderman.

School – So I finished my first semester at Carnegie Mellon West last Friday. While it was very time-consuming, as I find myself doing school work in my office, on flights, waiting in airports and even when I am “on vacation” in OC or New York, it wasn’t all too difficult. I attribute this to being part of an excellent and high-performing team and that the first semester was an intro course to what is yet to come over the next five semesters. The harder part of my first semester was actually to balance school, work and personal life. Programming C# at work all day with hard deadlines, only to come home to work in Java all night with hard deadlines and trying to squeeze in time to fly to New York or Redmond or practice piano in between leaves my schedule of 15-minute granularity filled up to the gazoo. Where do I only find the time to shave my cats?!

Vacation projects – So what’s Minh doing over his Christmas vacation? Well, for one, a complete revamp of the Journey from the Fall website is due by year’s end. Fortunately, I’ll be given a design by the art director over at ImaginAsian, so I only need to code and implement it, but I am looking forward to developing my first real ASP.NET 2.0 application. However, the more interesting and exciting project this vacation is a simple WPF-based computer puzzle that I started developing the day before yesterday. This was more a personal project for me as I wanted to get my hands dirty with the 3D aspects of XAML, but after having completed a playable prototype today, I realize that this can actually be a cool casual game, so I might make it available in January 2007. I don’t want to reveal too much, other that this is a mathematical puzzle. So Dark the Con of Minh.

Posted by minguyen | 0 Comments

Minh's Stupid PhotoResizer 1.3 now supports EXIF meta-data tags

I've updated my stupid PhotoResizer program today to support EXIF meta-data tags, so that digital camera image properties are now retained while resizing the pictures. Thanks to Tuan Dinh from the UK for this suggestion and feature request. Happy batch-resizing, you smugmugs.

Minh's Stupid PhotoResizer 1.3

Posted by minguyen | 0 Comments

Free PDF-download of my book “Visual Studio .NET Tips and Tricks” on InfoQ.com

Starting today, a non-printable PDF version of my book “Visual Studio .NET Tips and Tricks” is available as a free download exclusively on the InfoQ.com, a new enterprise software development community that covers Java, .NET, Ruby, SOA, and Agile. Launching today, InfoQ.com comes from the same people that started the much-read TheServerSide.net, and even before launch InfoQ.com has generated a lot of traffic, blogs and articles already, so keep an eye on this website.

In order to download the book, simply visit InfoQ.com, register and download the PDF and if you would like to support InfoQ.com and myself, feel free to purchase the print copy, so I can put bread on the table for my wife and 8 children (k, I am kidding of course).

I can’t believe that it’s almost two years already since I published this book. 70% of this book was written during my 1-hour lunch break when I was still working in San Diego. The rest was written in the Downtown Bellevue Library. A lot of people are asking me whether I will write a second book, and I am sorry to disappoint you all, but I am afraid that I won’t find the time to write a 2nd edition, even though I very much would like to.


Click to preview Visual Studio .NET Tips and Tricks Click to preview Visual Studio .NET Tips and Tricks

About the Book: Visual Studio .NET is one of the most versatile and extensible programming tools released by Microsoft. The number of features and shortcuts available in VS.NET is truly immense, and it grows tremendously with each release. Developers who are unaware of these timesaving features surely miss out on opportunities to increase their programming productivity and effectiveness.

Visual Studio .NET Tips and Tricks explains how to use VS.NET efficiently. Organized into short and easy-to-grasp sections, and containing tips and tricks on everything from editing and compiling to debugging and navigating within the VS.NET IDE, this book is a must-read for all .NET developers, regardless of expertise and whether they program in C#, VB.NET, or any other .NET language. This book covers the Visual Studio .NET 2002, 2003, and 2005 Beta 1 releases.

In this book you'll find the following:

  • More than 120 tips for editing and writing your code, navigating within the IDE, and compiling, debugging, and deploying your application
  • Section dedicated to VS.NET 2005
  • Keyboard shortcuts for the majority of tips
  • More than 90 figures and screenshots

 

About the Author: Minh T. Nguyen is a website development engineer with Expedia.com. He has worked with Visual Studio .NET since its beta stages and regularly gives workshops and writes articles for the .NET community.


  • ISBN: 1411613961
  • Suggested Retail Price: $15.95
  • Format: Paperback, 124 pages
  • Publisher: Lulu Press, Inc.; 1 edition (September 2004)
  • Preview: vsnet_tt_preview.pdf
  • Complete: Free PDF Download

Buy it for $13.95
on lulu.com

Buy Visual Studio .NET Tips and Tricks on Lulu.com
  Buy it for $15.95
on barnesandnoble.com

Buy Visual Studio .NET Tips and Tricks on barnesandnoble.com
  Buy it for $15.95
on amazon.com

Buy Visual Studio .NET Tips and Tricks on amazon.com
Posted by minguyen | 0 Comments

Presenting Microsoft TV at UC Berkeley Technology Expo 2006 next week

Microsoft TV

I’ll be joining a few other Microsoft Berkeley alumni to present some of our work at the UC Berkeley Computer Science & Business Association 4th Annual Technology Expo 2006. The event will take place Thursday, March 16th, 2006 from 11am – 4pm at the Pauley Ballroom at UC Berkeley, where my co-worker and I will demo some of our recent work on Microsoft TV (Foundation Edition and IPTV). I’ve primarily worked on Foundation Edition 1.9 which we will be releasing this year and recently started work on some UI-prototyping for IPTV 2.0. Several other Cal alumni will show their work on PocketPC, SmartPhones and Windows Live Mail, so be sure to swing by and check out our very cool products.

GO BEARS!

Posted by minguyen | 0 Comments

Minh's Stupid PhotoResizer Version 1.2

This is long overdue, but I've finally updated my stupid PhotoResizer program with the two requests that most people have asked for the most. The 1.2 update has the following two new features:

A) You can now drag a folder over the area, and it will resize all files within that folder. No folder-recursion.
B) You can now specify the JPEG compression ratio, which defaults to 90.

Thanks for Martjan den Hoed from the Netherlands for some of his suggestions and his Dutch version (which I assume he will update for 1.2 version soon).

Enjoy,
Minh T. Nguyen.

PS: For those who are awaiting the new Vietnamese Conversions to go out of its rich-text-editor beta stage, hang in there. Besides a bug that I still have to fix, I've received an additional request to add Unicode->Vietnet/VIQR conversion. I already know how to do it, I just need to find the time to implement it some time this month.


 

Name : PhotoResizer
Version : 1.2
Requirement : .NET Framework 1.1
Size : 6kb
Download : Binary executable - Source code - Dutch Version
License : Freeware/OpenSource

PhotoResizer

This is a very simple utility to allow you to batch-resize digital photos. You simply indicate your maximum width or height in pixels and drag and drop your picture files onto the window. The program will then batch-resize all pictures into a subfolder.

Posted by minguyen | 0 Comments

XAML: What ever happened to the <Window.Storyboards> tag?

There has been a recent change in the Windows Presentation Foundation in regards to Storyboards (at least since the December 2005 CTP, possibly even earlier). Most of the articles you currently find on the internet and the few Avalon books suggest the following:

<Window x:Class="MinhNguyen.HelloWorld"
   
xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
   
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
   
Title="HelloWorld"
   
Width="860" Height="570"
   
>
   <
Window.Storyboards>
      <
ParallelTimeline>
         <
DoubleAnimation ...></DoubleAnimation>
      </
ParallelTimeline>
   </
Window.Storyboards>

Turns out that the <Window.Storyboards> tag doesn't exist anymore. Of course, you can still hook up an animation to an event trigger like so:

<Button Grid.Column="0" Grid.Row="2">
   <
Button.Triggers>
      <
EventTrigger RoutedEvent="Button.Click">
         <
EventTrigger.Actions>
            <BeginStoryboard>
               <
Storyboard>
                  <
ParallelTimeline>
                     <
DoubleAnimation ...></DoubleAnimation>
                     ...
                  </ParallelTimeline>
               </
Storyboard>
            </
BeginStoryboard>
         </
EventTrigger.Actions>
      </
EventTrigger>
   </
Button.Triggers>
</
Button>

But what if your animation is not tied to a particular control or event and you want to start it from code-behind? I googled on this for a long while to no avail, but the answer was given to me on an internal mailing list and it is embarassingly simple. Simply define your storyboard as a resource, like so:

<Window x:Class="MinhNguyen.HelloWorld"
   xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
   xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
   Title="HelloWorld"
   Width="860" Height="570"
   >
   <
Window.Resources>
      <
BeginStoryboard x:Key="myAnimation">
         <
Storyboard>
            <
ParallelTimeline>
               <
DoubleAnimation ...></DoubleAnimation>
               ... 
            </
ParallelTimeline
         </
Storyboard>
      </
BeginStoryboard>
   </
Window.Resources>

and then you can retrieve and start your animation from code behind like so:

void SomeMethod()
{
   myAnimation = (
BeginStoryboard)this.Resources["myAnimation"];
   myAnimation.Storyboard.Begin(
this);
}

In other words, what used to be defined in <Window.Storyboards> should now be treated as a resource. I thought I share this with you all so that you don't waste time wondering why Window.Storyboards is missing, when reading the outdated books (funny, huh? The September 2005 book Programming Windows Presentation Foundation that I am currently reading is already outdated).

Posted by minguyen | 2 Comments

Introducing Minh T. Nguyen's Professional Blog

Howdy,

   My name is Minh T. Nguyen, and I am a Software Design Engineer at Microsoft at the Silicon Valley Campus. Some of you might know me as enderminh on gotdotnet.com. I currently work on Microsoft TV, in particular have recently worked on Microsoft Foundation Edition 1.9 and am currently moving over to a cool Microsoft IPTV-related project. :) This will be my professional blog, where I will post my technical discoveries in the world of Avalon/XAML, Longhorn/Windows Vista, Microsoft, Orcas/Visual Studio .NET and any other geek-talk for that matter. Please note that anything posted on this blog are my personal opinions and do not reflect that of Microsoft Corporation and all posts are provided "AS IS" with no warranties, and confers no right. In other words, don't come back to me and say "but Minh says this and that's why we bet our company strategy on this and now you tell me that it can't be done?!"

   Those who know me personally, know that my passion for the Vietnamese community is far bigger than my passion for computer science, so I will keep my personal adventures over at my personal blog at http://www.enderminh.com/blog.

   Until I will post about some technical stuff, I invite you to check out my book Visual Studio .NET Tips and Tricks or the non-Microsoft .NET Developers Blog aggregator I made available a year ago.

Happy coding,
Minh T. Nguyen
minh.nguyen@microsoft.com

Posted by minguyen | 2 Comments
 
Page view tracker