The Cowboy
What I'm Tweetering about...

follow me on Twitter

Recent Posts


Archives


Subscribe to
Posts [Atom]



Thursday, January 17, 2008

Binary File Formats for Word, Excel, PowerPoint

Brian Jones posted yesterday about the availability of the docs for the binary file formats of Office Applications. 

... Microsoft indicated that the documentation of the Binary Formats has been available royalty-free [since 2006] under RAND-Z to anyone who requests it by sending an email to officeff@microsoft.com

Nevertheless, in response to requests for even easier access to the Binary Formats, Microsoft has agreed to remove any intermediate steps necessary to get the documentation, and will post it and make it directly available for a direct download on the Microsoft web site.  Microsoft will also make the Binary Formats subject to its Open Specification Promise (see www.microsoft.com/interop/osp) by February 15, 2008.

Now, having the Binary Formats under the Open Specification Promise, is extremely exciting. The OSP itself:

Microsoft irrevocably promises not to assert any Microsoft Necessary Claims against you for making, using, selling, offering for sale, importing or distributing any implementation to the extent it conforms to a Covered Specification (“Covered Implementation”), subject to the following. This is a personal promise directly from Microsoft to you, and you acknowledge as a condition of benefiting from it that no Microsoft rights are received from suppliers, distributors, or otherwise in connection with this promise. If you file, maintain or voluntarily participate in a patent infringement lawsuit against a Microsoft implementation of such Covered Specification, then this personal promise does not apply with respect to any Covered Implementation of the same Covered Specification made or used by you. To clarify, “Microsoft Necessary Claims” are those claims of Microsoft-owned or Microsoft-controlled patents that are necessary to implement only the required portions of the Covered Specification that are described in detail and not merely referenced in such Specification. “Covered Specifications” are listed below.

This promise is not an assurance either (i) that any of Microsoft’s issued patent claims covers a Covered Implementation or are enforceable or (ii) that a Covered Implementation would not infringe patents or other intellectual property rights of any third party. No other rights except those expressly stated in this promise shall be deemed granted, waived or received by implication, exhaustion, estoppel, or otherwise.

My first introduction to the OSP was back when I was in the Federated Identity team. When .NET 3.0 came out (which included CardSpace), I was thrilled when I found out that the protocols ended up in the OSP, which meant that there would be far less blockers in getting CardSpace adopted.

 

Wednesday, January 16, 2008

VBScript: Betcha never thought of this one

I mentioned in a previous post that I had to solve a little issue with the wonderful WMCMD.VBS script that Alex Zambelli maintains.  Because of some occasional nastyness, when the script is done--successful or not-- it tries to kill it's own process, in case any of the WM Encoder objects gets hung up.

The original script uses WMI to look on the machine for the cscript process for the currently running script:

function TerminateEncoderProcess()

   dim objWMIService
   dim objProcess

   On Error Resume Next

   ' Get Windows Manager object
   Set objWMIService = GetObject("winmgmts:" _
      & "{impersonationLevel=impersonate}!\\.\root\cimv2")

   ' Enumerate all CScript.exe processes
   dim colProcessList
   Set colProcessList = objWMIService.ExecQuery
   
("Select * from Win32_Process Where Name =" _ 
    & "'cscript.exe'"
)
   
   dim strArguments
   strArguments = ""
   
   ' Enumerate all command-line arguments
   for i = 0 to wscript.arguments.Length-1
      strArguments = strArguments & " " & _
         wscript.arguments(i)
   next
   strArguments = Replace(strArguments, Chr(34), "")

   ' Kill the processes that match this one in name and arguments
   For Each objProcess in colProcessList
      if InStr(1, Replace(objProcess.CommandLine, _
         Chr(34), ""), _
     
Trim(WScript.ScriptName & strArguments), 1 ) > 0 _
      then
         objProcess.Terminate()
      end if
   Next
   
   ' What? Still not terminated? OK, kill first occurrence.
   For Each objProcess in colProcessList
      if InStr(1, objProcess.CommandLine, _
            WScript.ScriptName) > 0 then
         objProcess.Terminate()
      end if
   Next

end function

Unfortunatly, this script, when all else fails, tries to kill itself by finding the first running cscript, and killing it. Hmmm. not too good, I had multiple encoder script processes going on, and it kept killing the wrong one.

A pity it seems so hard to find the current process in VBScript... until I thought about it a bit more:

 

function TerminateEncoderProcess()

   GetObject("winmgmts:root\cimv2:Win32_Process.Handle='"
    & GetObject("winmgmts:root\cimv2:Win32_Process.Handle='" _
    & CreateObject( "WScript.Shell").Exec("cmd.exe").ProcessId _ 
    & "'").ParentProcessId & "'").Terminate

end function

Huh?

This version of the script spawns off a new cmd.exe process (which exits nearly instantly), but uses the process ID from that, looks up the process, and get it's parent process, and then terminate that.  Nice thing is, it don't get confused :D

Technorati Tags: ,,

 

Looking for a few good outriders: PHP Developers

Hey y'all.

I've got some work goin' on that I sure could use a few hands that were real PHP savvy.

I'm looking for some short-term and some mid-term consultants to do some experimental work with PHP applications on Windows. I have need for some local (Redmond) and some can work from remote.

If you have some real fine PHP skills, including experience with databases, and have a track record of producing results, I'd be happy to hear from you.

Tell me... are you up to it?

Send me a mail: garretts at microsoft.com.

Labels: ,

 

Tuesday, January 15, 2008

Random Hacking: Windows Media Encoder and DirectShow

I'm a big fan of Vista Media Center, and a really big part of that is the fact that I can use an XBOX 360 as a really-nice media center extender. When learned that the fall update contained support for MPEG4 Advanced Simple Profile (that's DivX to you and me!) in AVI's I was quite ecstatic. I went out and bought a second Xbox360, and put it in the kid's playroom... then I found out that meant thru the Dashboard...

*sigh*

I never use the Dashboard to play videos... I always do so from Media Center. Over the years, I have archived a bunch of shows in DivX format, so that my kids can watch their shows over and over again. I didn't really want to go through the exercise of teaching my 5 yr old how to use the Dashboard, since she's already a Media Center expert, and I certainly didn't want to bother with setting up WMP to play the videos.

So, I thought, for what has got to be the 100th time, should I convert my videos to WMV?  I've tried this in the past, and always ran up against one or more issues. Primarily, most of the tools for WMV encoding are designed to be interactive. Or they suck. Or Both.

So, last weekend I resurrected some batch file code I was using to play around with the Windows Media Encoder, along with the latest WMCMD.VBS and a handful of other tools, and cranked out a nice little script that strings together them all so that I could trans-code a bunch of them in a row.

After working through an interesting bug in the VBScript (the results of which are an upcoming post :D), and managing to finally get past my problems with 5.1 audio, and the result was pretty darned good. As a matter of fact, it was *really* good.

...Which got me even more interested in making a tool that I could use without any interactivity at all, and use it to make all my videos in WMV.

*hmmmm*

So, even though my little batch solution worked pretty good, I started to work on a new tool in g# (a nifty little .NET-based script language I'm working on)... and found out that accessing some of the COM interfaces for DirectShow isn't exactly a walk in the park.. Ah, so be it, I went to C#, and cranked out a tool that generated the .NET bindings for the COM interfaces the way I wanted them.

Having done all that, I'm reminds me of somethin' my pappy told me... "There are three kinds of men: The ones that learn by reading. The few who learn by observation. The rest of them have to pee on the electric fence."  Well, I think I ended up in the last category, but at least I learned somethin'... there's a reason why there isn't a lot of examples of DirectShow in .NET... but more on *that* on an upcoming post.

Anyway, so I'm now deep into crankin' out a little automated trans-coder, in .NET, and when it's done, I'll see if I can post it on Codeplex, along with the source.

Y'all might be wonderin', what in the name of creation I'm doin' ramblin' around today. Well, I dunno... just thought someone would like to know.

 

PHP on IIS 7.0: Enhance Your Apps with the Integrated ASP.NET Pipeline -- MSDN Magazine, January 2008

As you might be aware, Microsoft release the FastCGI connector for PHP (when), and it's creating quite a stir.  Mike Volodarsky wrote an article for MSDN magazine that talks about what benefits IIS 7.0 provides to PHP apps:

... IIS had always supported PHP, but in a way that precluded many real-life PHP applications from being hosted in production environments. This was due to limitations in the two ways IIS offered for running PHP applications: using the Common Gateway Interface (CGI) protocol or using the PHP ISAPI extension.

Because CGI requires a separate process for each request, apps hosted using CGI would perform poorly on Windows. Conversely, PHP apps using the IIS high-performance multithreaded ISAPI interface would often suffer from instability due to the lack of thread safety in some popular PHP extensions.

In an attempt to solve these problems, the IIS team developed the FastCGI component. The open FastCGI protocol allows PHP and many other application frameworks that require a single-threaded environment (including Ruby on Rails, Perl, and Python) to run more reliably on IIS. Unlike the standard CGI implementation, FastCGI enables process reuse by maintaining a pool of worker processes, each processing no more than one request at a time, thus resulting in much-improved performance. FastCGI also benefited from a community-centric development and testing model.

The article presents an interesting intersection of PHP and IIS 7.0, and how IIS can bring some serious benefits to those applications. Catch the whole article on the MSDN Magazine site: IIS 7.0: Enhance Your Apps with the Integrated ASP.NET Pipeline -- MSDN Magazine, January 2008 .

 

Monday, January 14, 2008

Convergence of my two worlds: FireFox and CardSpace

I've been meaning to write this out for a few weeks...

FireFox has had an extension which allows CardSpace to be used as an Identity Selector on Windows, written by Kevin Miller (with some assistance from yours truly :D) for some time now.

Kevin has joined Microsoft since then, and become a little too busy with his new Role to keep rolling on upkeep, and Axel Nennker and Andy Hodgkinson have stepped up to continue development and take it into the future.

They, in spite of me not mentioning it, have actually put out several releases in the last year, and are in constant contact with the CardSpace team and getting access all the information they need.

Kevin and I are quite excited that Axel and Andy stepped up to do this, we'd like to have continued ourselves, but sometimes it's hard keeping up with the projects that aren't the day job.

Thanks Axel and Andy!

 

Friday, January 11, 2008

Understanding Windows CardSpace : The Book!

Well, after what seems like... well, forever, Vittorio, Caleb and I have finally seen the day when our book is available.

About the book:

"Windows CardSpace empowers organizations to prevent identity theft and systematically address a broad spectrum of security and privacy challenges. Understanding Windows CardSpace is the first insider’s guide to Windows CardSpace and the broader topic of identity management for technical and business professionals. Drawing on the authors’ unparalleled experience earned by working with the CardSpace product team and by implementing state-of-the-art CardSpace-based systems at leading enterprises, it offers unprecedented insight into the realities of identity management: from planning and design through deployment. "

Truly quite exciting.

Not only is it a really great look at CardSpace, and identity technology in general, but the first section (which Vittorio wrote) is something quite remarkable--it really educates practically anyone on the fundamentals of cryptography and identity in a way I'd never seen before.

I recommend this book wholeheartedly :D

 

Wednesday, January 9, 2008

Apache Developers Invited to Redmond

A little over a year ago, (when I was still on the CardSpace team) I woke up, and wandered over to my computer at home, and bleary-eyed started up a browser and saw the following:

 
Whooosh! This was better than a triple-shot-breve-latte! I snapped fully awake, and started cranking out a few emails... this would be a great opportunity to get FireFox to support CardSpace!  Who was this Sam Ramji guy? We have an Open Source Software Lab? Really? Mozilla coming to campus? Can the CardSpace team get some time with them? Yeee-haw!

That one little post on Slashdot started a chain reaction of events that I would never have imagined.  Now, of course, I'm part of the OSSL, and I get to see stuff like this taking shape first hand.

Earlier today, I posted an invitation to several of the Apache Developer mailing lists:

Howdy,

My name is Garrett Serack, and I am the Community Program Manager in the Open Source Software Labs here at Microsoft.

I would like to extend an official invitation to the Apache Software Foundation to participate in the Microsoft Windows Server 2008 Compatibility Labs here in Redmond. The Compatibility lab is scheduled for

   Monday February 25 2008 through Wednesday February 28 2008.

WHAT IS IT?
The Windows Server 2008 Application Compatibility Lab is an event where we invite companies to bring their applications into our lab, and have the opportunity to perform compatibility testing with Windows Server 2008. In addition to gaining insight into Windows Server 2008, this also includes unprecedented access to various product groups (developers, architects and PMs) inside of Microsoft, who can lend their assistance, give technical information and answer design questions you may have.

Normally, we request companies send 3-4 attendees, and we usually have 3-4 companies in the lab in a given week. Given the ASF's size and breadth, we've reserved the entire lab for the week for the Apache Foundation, and we'd like to see somewhere in the range of 15-18 people from a wide variety of projects attend.

WHO SHOULD COME?
We would be very interested in having several people from the Tomcat, HTTPD and Axis groups attend. Other projects including APR, Apache C++ Standard Library project, Harmony, and Maven.NET also come to mind. Any project that is impacted by the release of Windows 2008, or is looking to solve Windows-specific project issues, may profit from this opportunity.

We are interested in having each project who deals with Microsoft Windows compatibility or portability to bring small contingent of 1 or 2 developers to the table, so please chat within your own PMC or even your dev@ list first to determine who is most interested in attending this camp on behalf of your project. Space is constrained, and we'd like to ensure that specific attention can be given to projects that need it.

INSIGHT
You might be interested in the "political" rational of why we value this chance to meet some of the ASF developers and help them work through Windows compatibility issues. You can see Sam Ramji's blog entry about why we asked Mozilla out:

http://port25.technet.com/archive/2006/09/20/Why-I-invited-Mozilla.aspx

As for Apache, we're really keen to see their technology run great on Windows.

To some folks in the ASF, this isn't a surprise... Hank and I have already had good conversations with Apache folks in order to work out the dates and details.