Matt Casto's .NET Journal RSS 2.0
 Friday, September 07, 2007
Day 12

On Day 11 I came to the realization that there wasn't any supported XAML in Silverlight that allowed text entry and that you had to tie your Silverlight app to an HTML textbox/textarea in order to do this.

I decided to try putting an HTML textarea over a Silverlight app and see how I could get them to work together. I wanted to have a javascript method called when the contents of the textarea changed, and have that javascript method call into the Silverlight app. After an hour or so of frustrating trial and error and reading through documentation online, I realized that you can't call Silverlight 1.0 from javascript.

Day 13

Up to now I've been working on a system with the Silverlight 1.0 SDK and Visual Studio 2008 March CTP. I have a very slow internet connection and my laptop leaves a lot to be desired, so this was holding me back from installing Visual Studio 2008 Beta 2. Last night I decided the time had come.

I had started the download of Visual Studio 2008 the night before, which took around 23 hours. At around 8pm I uninstalled the March CTP, then uninstalled all .NET 3.5 stuff hanging around. This all took almost an hour and a half. I then installed Beta 2, the Alpha Tools, and downloaded the Silverlight 1.1 Alpha SDK.

At this point it was almost 11pm and I was out of time to spend for the evening. So much for my Day 13 of the sprint. I realy hope to get further on the text entry experiments this weekend.

Labels: ,

Friday, September 07, 2007 6:49:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
silverlight | sprint
 Thursday, September 06, 2007
I noticed this morning that the Silverlight Get Started page states that there's a Silverlight 1.1 Alpha September Refresh. I don't remember seeing anything in Scott Guthrie's post about a September specific version of the 1.1 Alpha Refresh. I downloaded the file and it has the same size and version as the 1.1 Alpha Refresh that I downloaded last month. The Get Started page also has a link to the Silverlight SDK 1.1 Alpha September Refresh. What's going on here?

I found this comment from Scott Guthrie in his above mentioned blog post.
The 1.1 refreshes from MIX to now have mainly just been updates to keep in sync with the Silverlight 1.0 code-base. Now that Silverlight 1.0 has shipped, the upcoming refreshes of 1.1 will be feature updates with more functionality. So you'll start to see more functionality appear soon.

Labels:

Thursday, September 06, 2007 6:27:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
silverlight
 Wednesday, September 05, 2007
Silverlight 1.0 has been released! Also, it looks like Microsoft is partnering with Novell to make sure that Moonlight fully supports the Silverlight 1.0 and 1.1 programming models.

Source

Labels:

Wednesday, September 05, 2007 10:10:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
silverlight
Days 8-10

Days 8 through 10 were labor day weekend and I was out of town for most of that time. I did get a chance to play with Expression Blend more and read the SDK and Expression Blend documentation about various XAML keywords, polygon and polyline in particular.

I was trying to figure out how to create some basic shapes in XAML. My first attempts were by creating a polygon with the correct points, but I found myself getting massively sidetracking trying to remember basic geometry from my freshman year of high school. After reading more documentation I found that I could draw some different shapes in Blend, then combine them into a single path, which might be the best way to accomplish what I was going for.

Day 11

Last night, I was trying to create a basic form in Silverlight. I started by looking at the documentation for the textblock object, and found all kinds of interesting ways that text can be transformed and output, including the run and linebreak objects. Unfortunately, I didn't find any information about how to allow the user to enter text into a silverlight app.

Eventually I found the Using Input Method Editors for Text Entry in Silverlight screencast which covers what I was looking for, in addition to other interesting features.

I've got to say I'm pretty disappointed to learn that in order to do text entry in a Silverlight app, I've got to actually overlay an HTML textarea over the Silverlight control, and use javascript to read/write text from that textarea.

I have a lot of ideas to experiment with such as whether I can create a textarea with a transparent background and no border, which would allow me to do a better job integrating it with the Silverlight control. Or perhaps I could have a text area that allows entry, but what's entered is immediately hidden and reproduced in the a textblock in XAML, fooling the user into thinking that they're entering text directly into Silverlight.

Labels: ,

Wednesday, September 05, 2007 7:12:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
silverlight | sprint
 Friday, August 31, 2007
I really want to get the 4GB version of the Iron Key for my next portable storage solution. I wonder how the encryption would affect performance of virtual machines.


From TFA:
Like you, the US Military wanted portable but secure storage, and the guys at IronKey stepped up. They've developed the perfect solution that's one-part thumb-drive, and two parts Mission: Impossible. Their thumb drives hold up to 4 Gigabytes of data, but includes a hardware encryption chip that scrambles the data so as to be completely unreadable without a password.

Passwords can be hacked, but not the IronKey. It's built to withstand attacks both virtual and physical. 10 incorrect password attempts, and the encryption chip self-destructs, making the contents of the flash drive totally unreadable. The contents of the drive are filled with epoxy, so if a hacker tries to physically access the chips, he'd more likely damage them instead. Even if he did get access to the memory chips, they'd be worthless without the encryption chip. Electron-shielded, even a scanning electron microscope can't get inside.


My gadget lust has been activated.

Labels:

Friday, August 31, 2007 6:34:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
devices
 Thursday, August 30, 2007
Tonight I went through the Silverlight QuickStart Using Microsoft Expression Blend tutorial. I didn't do everything in the tutorial and tried some experimentation as well which was pretty fun. I'm really glad I did the quick start because just starting up Expression Blend and trying to figure things out wasn't working for me.

Note - if you're using Expression Blend 2 August Preview some things in the quick start tutorial have changed. In particular, creating my first timeline was frustrating because the button to add a new timeline moved between the May and August previews.

Also, I found designwithsilverlight.com which has some great looking tutorials that I'll go through once I'm done with the materials from silverlight.net.

Labels: ,

Thursday, August 30, 2007 9:04:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] -
silverlight | sprint
Real life has prevented me from spending at least an hour with Silverlight this week. Even when you make a commitment to yourself, there are some things that take a higher priority.

That said, I did find a cool blog that has posts related to making games for Silverlight - Silverlight Games 101

In fact, the silverlightrocks.com site could be a good source of information as it grows.

Since you can get through the learning materials online pretty quickly, spending 30 days focusing on Silverlight means that most of the time will be working with actual code. It helps to have a real project to work on, and I am lucky enough to be involved in one. It's not a commercial project, but more of a community project that I'm donating time to. More detailed information will be forthcoming.

Labels: ,

Thursday, August 30, 2007 10:52:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
silverlight | sprint
 Monday, August 27, 2007
I didn't have as much time to spend on day 2 as I did the first day, but I did get some things done. Mostly I read through some of the quickstarts and watched some of the videos at the Silverlight site.

JD suggested to me that I keep a list of resources to help manage my thoughts. I've been saving interesting pages to del.icio.us with a Silverlight tag for a while now, but I think I'll definitely be more cognisant to save everything I run into.

http://del.icio.us/mattcasto/silverlight

Probably the most interesting thing that I found was Silverlight Pad, an online equivalent to XAML Pad. Looking at what's available there and making changes to see what happens is a great way to get a feel for what's going on.

Labels: ,

Monday, August 27, 2007 6:37:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
silverlight | sprint
 Saturday, August 25, 2007
For my first day of my 30 day learning sprint focusing on Microsoft Silverlight, I'm going to go through the Quickstarts on the community Silverlight website.

Before starting with the Quickstarts, I had to set my machine up. Based on Scott Hanselman's post "VS 2008 and .NET 3.5 Beta 2 Releases Made Easy," I downloaded and installed the following:
Then I got confused. I wasn't sure whether to start with 1.0 or 1.1. Silverlight 1.0 is at the release candidate stage with a go live license, so it seems like a safe bet. But with 1.1 I can program with c# on the client. I'm 95% more proficient with c# than with javascript, so this is a tough one.

While digging around for more details, I found Jesse Liberty's blog posts about learning Silverlight from a .NET developer's perspective. Excellent! Not only is there are series with me as a target audience, but one that is a lot like my planned learning exercise, AND it's by the guy who wrote the book that I started my .NET learning with as well!

Jesse's post about the differences between 1.0 and 1.1 lead me to the Silverlight Runtimes Matrix which shed some more light.

I could deal with just using javascript for my initial learning, but when I saw that isolated storage wasn't supported in 1.0 that tipped the scale. I'm not sure exactly why ... it could be because one of the first cool demos I saw of Silverlight was how the isolated storage was shared between all browsers. I found the demo again on ExplosiveDog.com's "Silverlight Isolated Storage" post.

I switched targets and downloaded the Silverlight 1.1 Alpha Refresh and Silverlight 1.1 SDK. One thing I'm still confused about is whether the 1.1 SDK is up to date with the 1.1 alpha refresh. I kind of doubt it because the search results on Microsoft Download have it listed with a date of 5/17/2007, while the Silverlight 1.0 SDK RC has a date of 7/27/2007. I decided to hold off on installing the 1.1 SDK, but I'd already installed the 1.0 SDK RC so we'll see what happens.

At this point I've more than used up my first day's amount of time. Maybe later tonight I'll look at some of the samples in the quickstarts, but now my eyes are tired from staring at the monitor for too long. Too bad there aren't any books out yet, because I could really use some printed text at this point.

Labels: ,

Saturday, August 25, 2007 1:54:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
silverlight | sprint
Today I've decided to start the 30 day learning sprint that I've been putting off for a while now. The technology that I've decided to learn is Microsoft Silverlight. This was my plan from a few months ago but procrastination lead me to put it off until now.

For the next 30 days I am making a pledge to myself to spend at least an hour each day focusing solely on a task that will help me learn Silverlight. Whether that task is reading a tutorial or document, writing or debugging code, or anything else related, the point is that I commit to spending this amount of time each day on the goal.

I hope that the one hour requirement will allow this to fit into my family life and schedule without being disruptive. Also, by writing this blog post I'm not only committing this to myself, but hopefully the public announcement will help me stay on task. (Plus, I can always come back and delete this post).

I will also post one blog entry detailing what I planned on accomplishing for each day, how it went, and what the outcome was.

Labels: ,

Saturday, August 25, 2007 1:41:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [6] -
silverlight | sprint
 Wednesday, August 01, 2007
This is old news for most developers, but I'm throwing it out there anyway. I've known about Microsoft's LogParser for a long time now, but today is the first time I've actually used it.

I needed to get some quick stats about the usage of some WCF services from an IIS log of an application recently put into production. I downloaded LogParser 2.2, googled and found some examples, experimented with some queries, and within 2 hours had a batch file that was creating two simple text file reports that would quickly tell you about service usage.

Here's the batch file contents I created:
@echo off
if "%1" == "" goto reqparam
@echo on

@echo * Getting total hits per service into %1_ServiceHits.txt

"C:\Program Files\Log Parser 2.2\logparser.exe" -i:iisw3c "SELECT DISTINCT
cs-uri-stem AS Url, COUNT(*) AS Hits INTO %1_ServiceHits.txt FROM %1 WHERE
(cs-uri-stem LIKE '%%.svc') GROUP BY Url ORDER BY Hits DESC" -o:NAT -rtp:-1

@echo * Getting hits per hour into %1_HitsPerHour.txt

"C:\Program Files\Log Parser 2.2\logparser.exe" -i:iisw3c "SELECT date,
QUANTIZE(time, 3600) AS Hour, cs-uri-stem AS Url, COUNT(*) AS Hits INTO
%1_HitsPerHour.txt FROM %1 WHERE (cs-uri-stem LIKE '%%.svc') GROUP BY date,
Hour, Url ORDER BY date, Hour, URL" -o:NAT -rtp:-1

@echo off
goto end
:reqparam
@echo Missing Parameter - IIS log filename
:end

And here's an example of the output:
Url                       Hits 
------------------------- ------
/AwesomeService.svc 208862
/SweetService.svc 133267
/GoodService.svc 41577
/MundaneService.svc 41271
/HappyService.svc 10300
/CrappyService.svc 2950

Just for fun, here's a command that will create a pie chart.
"C:\Program Files\Log Parser 2.2\logparser.exe" -i:iisw3c "SELECT DISTINCT
cs-uri-stem AS Url, COUNT(*) AS Hits INTO c:\temp\iisreport.gif FROM
c:\temp\ex070730.log WHERE (cs-uri-stem LIKE '%.svc') GROUP BY Url ORDER BY Hits
DESC" -chartType:PieExploded3D -chartTitle:"Service Hits"

Which generated this image:

Its a little bit ugly because of the values put in front of the chart, but it wasn't worth it to me to spend the time figuring out which command line option would turn that off.

* PS - I've noticed that the unofficial website for LogParser seems to be down. Bummer.

Labels:

Wednesday, August 01, 2007 11:27:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
tools
Central Ohio Day of .NET

About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Matt Casto
Sign In
All Content © 2008, Matt Casto
Theme based on DasBlog theme 'Business' created by Christoph De Baene (delarou)