October 2005 - Posts
I'm at home this weekend slamming out some code for fun using SQL Server 2005 and Visual Studio 2005. It's a lot of fun and it's great to finally get to use the RTM bits to build an application. I noticed though that on my machine (XP SP2) SQL Server takes a lot longer to start up than SQL Server 2000 did. The problem with that is that it holds up my machine from loading up everything else. I also noticed that my memory usage is way up from what it used to be (pre SQL2K5). I haven't played around with turning things on and off to find out what it might be yet. I'm just curious, has anyone else noticed this. If so, what things have you turned off by default to help?
http://www.boingboing.net/2005/10/29/pix_from_freeculture.html
I am NOT a big protester. In fact, I've never done it before in my life. That said DRM at its current state today really sucks. Period. I am 100% FOR the goals of DRM. I'm not a music stealer. I would rather pay for something that someone created. However, when DRM (or at least the implementation by whatever company) limits me to listening to MY MUISC that I purchased on any computer that I am sitting in front of, that's what I get PISSED! So Microsoft, Apple, whoever, keep working on making DRM a better thing. It WILL be great. For the time being, please stop bothering me with it until you get it right. ;)
I sent out an e-mail to friends and family that my recruiter took of me right before my interviews at Microsoft. Apparently, she liked my shirt so much she just had to take a picture. ;) Gretchen liked it too and put it up on the jobs blog.
Check it out! :) Warning: Dork alert!
Ok, it's not really for sale. I'm not sure why you'd want to actually buy it anyway, but I had to post this because I thought it was really neat. My buds Scott and Phil posted what theirs were worth. Good times!
So, I have decided to take a role at Microsoft as a SDE on the Developer and Platform Evangelism team (i.e. Channel 9, Microsoft Gadgets, etc). I am super excited about this job. There are some really exciting things I’ll get to work on and I’m honored to have the opportunity. Also, Jeff's still hiring.
Being a Visual Basic MVP, you might find it interesting (or disturbing, take your pick) that the title of this message is in C#, but the role I’ve been offered is development using C#. I will continue to evangelize VB in my own way, internally and externally, but my day to day coding will be in C# (and SQL Server, HTML, JavaScript, CSS, etc), which is just fine with me. I was unfortunately an ASPInsider for only a very short time, but it was a fun and educational experience and I’m glad I was invited into it.
I’d also like to mention that I’m excited to work with my good friend, Adam Kinney, again for the 3rd job in a row. We must really enjoy working together! :P
I’ve had fun working at Aptera Software and wish them the best with their PSA Scorecard product. If you’re running a small to medium service-based business and need an entire solution for project management, sales management, time entry, invoicing, etc you should check it out.
Since I will be relocating, I will no longer be the VP for our local user group, NUFW. Quite honestly, I didn’t do a whole lot of things there besides helping with some decisions and speaking every once and a while to fill an empty spot. Armanda Turney has been doing a great job covering everything since the original President, Adam Kinney left. Keep up the good work!
Unfortunately, this position also means that I will need to drop out of Project Fazr. :( This is very sad for me, because I think they’re a great bunch of guys and extremely intelligent. I will be keeping in contact with them and I think everyone should watch for the cool things they’re going to be doing.
I will be starting at Microsoft on November 14th and can't wait! Wish me luck and I'll see you on the other side! :)
C9 has a pretty cool video showing off the latest on gadgets.
A few cool things they talk about:
- Gadgets will work in Windows XP
- Install packages for gadgets are just zip files with the exe, icon file and simple xml manifest with a .gadget extension
- Web gadgets can be displayed on start.com and the sidebar
- start.com using Atlas now
Big day tomorrow. Hopefully more on it soon. ;)
There's a cool new feature on Channel 9, written by a former co-worker of mine, Adam Kinney. Great job!
Now everyone get in there and point out the cool highlights of videos at Channel 9 so lazy people like me can just watch the highlights! ;)
Sometimes, I randomly get an error when developing ASP.NET apps saying that access is denied to some assembly in my bin directory. Specifically under C:\Windows\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files.
A local guy I know from our user group (and work we've done for their company), Jeremy Diller, found the answer for me. It turns out that it's the Indexing Service freaking out ASP.NET and seemingly locking files. This answer is gold! Saved me a ton of (continuing) frustration.
I just learned this a few minutes ago, but you can take an ASP.NET 2.0 application offline temporarily by uploading a file called App_Offline.htm. It will spin down the appdomain and redirect all requests to that page. Neato!
So, in the current tech preview of Atlas they've added a "new" idea of a declaritive code model. Ok, this isn't new. This is pretty much how XAML works. This is used for many things that I'll probably post about later. Behaviors are used to add functionality to existing controls. An out of the box behavior that's really cool is AutoComplete. Ever wanted to have a textbox that has an autocomplete dropdown window that's filtered as you type (kind of like Google)? Well, Atlas has an AutoComplete Behavior. Using the new declaritive model you can set it up to call a WebMethod without any code. Very nice, let's check it out. First, start a new ASPX in an Atlas Web Project. Then add the following controls to your page.
<input type="text" id="txtSearch" name="txtSearch" />
<div id="results" /> We have a search textbox and div. This div will be used to show the results of our WebService call. Now, there's a new script block that's basically an xml document that is where you specify your declaritive code blocks. There's a lot going on in there and I'm not going to go into the details here, but will be posting about it down the road. Here's what you can do to add the autocomplete behavior. Just add it to your page. I'd imagine down the road, this will be moved into a separate file if you want.
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
<add src="ScriptLibrary/AtlasUI.js" />
<add src="ScriptLibrary/AtlasControls.js" />
</references>
<components>
<textBox id="txtSearch">
<behaviors>
<autoComplete completionList="results" serviceURL="AutoCompleteService.asmx" serviceMethod="Search" minimumPrefixLength="1" />
</behaviors>
</textBox>
</components>
</page>
</script> The references section is where you can add what script libraries need to be included. I believe they are loaded in the order you have them in there, so if load order is important for your script library, and I believe it is for the MS libraries, keep that in mind. The components sections is where you define what controls on your page you would like to modify. By modify, I mean adding behaviors, setting up data bindings, etc. So you can see I've setup a textbox node and set its id to txtSearch which is the name of my textbox that I want to autocomplete. Inside of that node, I associate a behavior with my textbox by creating a behaviors node. Inside of this node is where you setup all the behaviors that you want to run. Again, they execute in the order you have them in there. So we add in the autocomplete node and set up the attributes it needs to run. The first one, serviceURL, is just the path to your WebService. The serviceMethod is the name of the actual WebMethod that it should call to get the results to show in the autocomplete list. We'll call it Search. The minimumPrefixLength is the number of characters at which the person types out in the textbox where it should start searching. In our case, we set it to 1 so the WebMethod will not be called until they type one or more characters. Just an FYI, the base JavaScript that Microsoft includes with Atlas will interpret all this declaritive UI stuff on the client (at least as I understand it today).
Now that we have the autocomplete behavior setup let's setup the WebMethod that it will call.
Private stringList() As String = New String() {"a1", "a2", "a3", "b1", "b2", "b3"}
<WebMethod()> _
Public Function Search(ByVal PrefixText As String, ByVal Count As Integer) As String()
Dim searchList As New List(Of String)(Count)
For Each s As String In stringList
If s.StartsWith(PrefixText) Then
searchList.Add(s)
End If
Next
Return searchList.ToArray()
End Function So you can see in this example I've just setup a private String Array with some dumby data. The actual Search Method just takes two parameters and returns a String Array that is filtered down based off of the PrefixText coming in. Note: at the time of this writing you have to have the two parameters be named PrefixText and Count for it to work correctly. I just loop through the private String Array and find which items start with the incoming text they've typed so far, building a String Array and return it. That's all there is to it. Run the project and type "a" or type "b" and see the nice little autofill. The end result will look like the following:

Now immediately you're probably asking how to setup a Template for the div so you can control what it looks like. I did. I don't know the answer for that offhand. If there's a way to do it in today's bits I'll post an update. If there isn't, I'm sure there will be down the road. Enjoy!
More Posts
Next page »