| Comments

bill gates announces on channel8 a program called '' which is enabling students of higher education to obtain microsoft developer and designer tools for no charge!

over at the channel8 downloads page you'll see what is available: visual studio professional, expression studio, windows server 2003 standard, and xna game studio.  wow.  for now this is available in United States, the United Kingdom, Canada, China, Germany, France, Finland, Spain, Sweden, Switzerland and Belgium.  the program looks to bring more countries on in the future so check back.

there is a student verification process that you have to go through and some of the frequently asked questions are available on the DreamSpark FAQ

what a great way to enable our future technologists to develop great software using great tools!

| Comments

i recently got an email from a developer who was using on a site to display high-quality media.  what?! you though silverlight was a windows-only technology? blasphemy!  you see, silverlight is a client-technology, which means as long as it can be served up to the browser (and the user has the plugin), the server can be your own custom version of l337hax0r web edition or whatever.  now, there are advantages of using internet information services on windows and some integration with asp.net, but that's not what this post is about.  on to the issue at hand will you...

so the email...he was getting an error message:

ActionController::RoutingError (No route matches "/player.xaml" with {:method=>:get}):

now i'm not incredibly familiar with what web server configuration he is running (although he is running netbeans/mongrel), but it got me thinking of 2 things.  first, maybe he needed to add a mime mapping.

for silverlight, the following MIME map is for .xaml files: .xaml: application/xaml+xml

but then i also thought that it might be something of some files moved around and such.  i deduced from his note that an template was being used as he mentioned he moved the javascript files to the javascripts directory of his rails application.  for those who don't know, rails is an MVC pattern web framework.  when creating a rails application you get a few different folders created for you (note: i'm just talking rails foo command here).  a lot of the work is done in controllers/models/views folder but there is also a folder called public.  within there are your typical images and javascripts type folders.  basically you can think of public mapping to "/" for static files.

now most rails applications probably wouldn't want all the encoder output to be dumped into /public as-is.  if developers are anything like me (OCD about project folder organization), then you want *.js to be in one place, etc.  i suspected that my reader put all the encoder files in the /public/javascripts folder.  this would be fine and should work okay.  but lets say you want some organization.

for example, i want to put my .js files in /public/javascripts, my jpg/pngs in /public/images and i'm going to create a folder for my xaml and a folder for media (wmv).  great, so we move all the files around then we run the Default.html page.  nothing happens.  why?  well a few things need to change if you move things around.

first, you need your hosting page (in this case right now it is Default.html) to reference the right path to the javascript locations.  so in our example we'd modify (in Default.html) lines like:

<script type='text/javascript' src="Silverlight.js"></script>
<script type='text/javascript' src="BasePlayer.js"></script>

to this:

<script type='text/javascript' src="javascripts/Silverlight.js"></script>
<script type='text/javascript' src="javascripts/BasePlayer.js"></script>

noting that of course there are more than just these two files.  now if we run the application it would still fail.  this is for two reasons, both of which are in StartPlayer.js.  the first is on or about line 8 of the script:

   1:   
   2:   
   3:   
   4:  function get_mediainfo(mediainfoIndex) {
   5:      switch (mediainfoIndex) {        
   6:   
   7:          case 0:
   8:              return  { "mediaUrl": "CodeTripSample.wmv",
   9:                        "placeholderImage": "CodeTripSample_Thumb.jpg",

the next is on or about line 24:

  22:  function StartPlayer_0(parentId) {
  23:      this._hostname = EePlayer.Player._getUniqueName("xamlHost");
  24:      Silverlight.createObjectEx( {   source: player.xaml', 

these both need to map to the right references of where that content has moved...so noting my above folder changes (images/javascripts/media/xaml) my StartPlayer.js file now starts like this:

   1:   
   2:   
   3:   
   4:  function get_mediainfo(mediainfoIndex) {
   5:      switch (mediainfoIndex) {        
   6:   
   7:          case 0:
   8:              return  { "mediaUrl": "media/CodeTripSample.wmv",
   9:                        "placeholderImage": "images/CodeTripSample_Thumb.jpg",
  10:                        "chapters": [               
  11:                                    ] };                                                                
  12:                            
  13:          default:
  14:               throw Error.invalidOperation("No such mediainfo");
  15:       }
  16:  }
  17:   
  18:  function StartWithParent(parentId, appId) {
  19:      new StartPlayer_0(parentId);
  20:  }
  21:   
  22:  function StartPlayer_0(parentId) {
  23:      this._hostname = EePlayer.Player._getUniqueName("xamlHost");
  24:      Silverlight.createObjectEx( {   source: 'xaml/player.xaml', 

and all is well -- my rails app starts and my silverlight content is loaded.  my resulting rails app structure looks like this:

simple enough, but if you move things around you might not have known where you need to change things.  you may wonder why you don't have to change the MediaElement in the player.xaml file.  well, if you are using an expression encoder template, the Url of that element is controlled by the StartPlayer.js mediaUrl attribute being passed to the player.

so if you have static information for your rails app this would probably work fine for you, but i suspect your rails application might be using views and such.  so you'd probably want to ensure you are modifying the appropriate view in views/layouts to ensure the javascript reference is correct, etc.

hope this helps.

| Comments

yo, check it.  expression design has released a service pack

what!?  i know how can that be?  a service pack < 8 months after its release?  i say awesome.  i've been wanting microsoft teams to continue to become more and more agile especially with regards to very helpful features or great improvements of existing features based on user feedback.

one such point of feedback that is implemented in is that of xaml generation of the layers and/or complete surface.  you didn't know design can generate xaml?  shame on you.  i did a podcast (you should really subscribe to the podcast feed on the left of my blog or just use this link) talking about using vector images (svg) and importing into expression design and getting xaml that you could use in your applications. 

there are essentially two ways of doing this in expression design:

    1. if you only want pieces of your design file to be xaml (i.e., you want to xaml-ize a fragment of the design), you can select the layer(s) in your design file and go to the edit menu and choose 'Copy as XAML' and bam, you now have xaml for those selected fragments in your clipboard.  go forth and develop.
    2. if you want the entire design surface to be a xaml representation, you would use the file menu and choose export.  from there you'll be presented with what looks like a typical 'save as' dialog box.  change the file type to xaml and after choosing location/name click ok.  you'll now be presented with a much improved options window (in service pack 1):

in previous versions the options weren't exactly clear.  for instance the xaml type you wanted (either WPF or ) was in a different tab).  i really like this improved export user interface.  i especially like the option of converting text to paths.  this really helps when you don't want to (or can't) redistribute any type faces.  upon export, you will get all the xaml plus (if you chose that option) path data for your text areas.  very cool.

so if you have design files or vector files that you would want to use in silverlight, this is the perfect tool and function to create the xaml representation of that data.  so go get service pack 1 for expression design and you'll be happy.

| Comments

i recently started to embark on a little 3 part series involving taking a pdf document of a baseball field and doing some and love with it.  it led me along a path of creating some intense xaml design elements actually and i thought i'd share (in simpler form) the process i used.

is a graphic tool that enables creating vector art that can then be exported to xaml (either WPF or silverlight).  it is a great tool that i'm starting to be more and more familiar with.  design understands various import and export format but sometimes your existing assets might not be directly importable.  have no fear there is a simple process (hopefully someone will automate this in one of their tools).  i just added a podcast (feeds listed on the left of this site) demonstrating the steps i used to convert an .svg file to readable in expression design, then export to silverlight xaml for an application.  it's only 8 minutes and might help if you are running into similar challenges.  you'll see that pdf documents with graphics also might give you some love.

| Comments

just yesterday tim sneath posted a video on creating video with overlays.  as i saw that come in my reader, i was just finishing testing my code for a screencast i was recording on creating video with timed overlays.  i figured, what the heck, you can never have enough tutorials, and mine was demonstrating a different method for accomplishing the same thing.

the scenario i was thinking of came to mind when i was lazy and watching television.  i saw a commercial where the person in the commercial said "if you call the number that is at the bottom of your screen" and then the number popped up.  i thought this concept would make a good tutorial on using markers in media files.  for advertisers, this would allow media to be re-used, but leverage different messaging in the form of language, promotional offers maybe,  especially in the web space, you'd probably want to provide specific marketing depending on the placement of the media advertisement.  or at least that was my thinking...

Creating Video with Timed Overlaysanyhow, so i put the screencast up and added it to my TimCast feed.  it demonstrates first using (preview) to import a quicktime movie file recorded with my isight camera and placing media markers within the media, then encoding the file to a consumable format by .  the next step is leveraging expression blend 2 (preview) to render the media and add event handling looking for the media markers and responding to them with different animations and functions.

it's about 19 minutes, and might be some good peripheral learning.  i'm hoping to do more of these, so any suggestions of topics is appreciated...feel free to leave a comment about a suggested topic.

you can also view the video on channel9 if you don't like subscribing to podcast feeds.