Sharing Data Among Server Controls

posted on 2005-07-21 at 00:32:36 by Joel Ross

Jeff Cranford has an interesting post about how you can share data among server controls. It's interesting because it works at design-time too. If you've ever built a custom server control, you'll appreciate the difficulties that design-time support causes, as well as Jeff's solution.

Did you realize that ViewState was available at design-time?

 

Categories: ASP.NET


 

Don't Initialize Variables?

posted on 2005-07-21 at 00:10:13 by Joel Ross

Jeff Atwood at Coding Horror is suggesting that we shouldn't be initializing our variables, and then he provides some performance numbers. What he doesn't mention, and Scott from Lazy Coder calls him on in the comments, is what a 35% performance hit really means.

Maybe I'm wrong, but I always thought you shouldn't rely on the compiler to do your initializations. If you do, and the compiler ever changes (or you used a different compiler that doesn't initialize the same), you may get unexpected results. For example, if the compiler team decided ints should be initialized to -1 instead of 0, and you rely on it being initialized to 0, then your code breaks for no apparent reason.

I just did a quick search, and the definitive development book, Code Complete, offers a checklist that includes initializing variables as one of the items to check. In fact, whenever the book talks about performance tuning, it says only to worry about that after the fact and you've got solid evidence of where your bottleneck is.

So while initializing variables may be quicker, what's the likelihood that removing variable initializations will boost your performance enough to make the difference?

Categories: Development


 

BizTalk Mappings

posted on 2005-07-20 at 23:23:08 by Joel Ross

Last week, I finally had a chance to get into the mapper in BizTalk. I've done minor things with it to this point - dragging fields from one side to the other, using the simple functoids to concatenate strings, but nothing complex.

I was a little nervous to try something hard. I was warned by Jim (you need to blog more, Jim!), one of our BizTalk experts at NuSoft that the mapper was dangerous. He said don't use the mapper - use Xpath. I'm guessing anyone familiar with XML and XSL and XSLT and BizTalk would know what he was talking about - but I was only familiar with XML at the time. Since then, I'm much more familiar with BizTalk, but still didn't have any experience with Xpath or transformations.

Well, that's all changed. I used this tutorial to get started, and then went from there. I used a custom XSLT script functoid and…still ran into problems! I checked out XMLSpy, and still had issues. Then a colleague said one word: namespaces. I remember we added a namespace to our input message, but I still didn't really get it (I still don't quite get namespaces completely).

Well, first, I removed the namespace from my input message, and then tested it in XMLSpy again. Worked like a charm. So now what? I couldn't remove the namespace from my actual document, so I tried to search to figure it out. Not much help.

Then I remembered that I'd read somewhere that the map gets translated into an XSLT file - in fact, you could write your whole transform map as a custom XSLT file - which is exactly what Jim was talking about! Doing a little digging revealed that if you right click on the map and select "Validate Map" then you'll get the XSLT file spit out to the file system. From there, I could open the file and figure out how the namespace issues were handled. Worked like a charm!

For those wondering, you can't do the (what I call) easy Xpath queries:

/MyRoot/MyNode/text().

You have to do it a little bit different:

/*[local-name='MyRoot' and namespace-uri='http://schemas.rosscode.com/MyRoot/01']/*[local-name='MyNode' and namespace-uri='http://schemas.rosscode.com/MyRoot/01']/text().

It's definitely not as easy as the first, but once you know, it's not that bad to implement. Of course, you have to know first.

Categories: Development


 

My Newsgator Render Page

posted on 2005-07-20 at 00:03:38 by Joel Ross

EDIT: I've uploaded a zip with the file in it. Just place this in C:\Program Files\Newsgator\Render and select it in the Newsgator options as your default renderer.

I've been watching Scoble's blog and see that he's been testing out how the different blog search engines are doing against each other.

At the same time, I created my own rendering xslt file for Newsgator to render posts. I decided to add links to the different search engines, and I thought I'd share my file for anyone else interested. Here's the contents:

     1: <?xml version="1.0" encoding="UTF-8" ?>
     2: <div xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     3:     <style type="text/css">
     4:         body
     5:         {
     6:             font-family:Verdana;
     7:             font-size: 10px;
     8:         }
     9:     </style>
    10:     $ng:description$
    11:     <p class="ngpostlinks">
    12:         <a><xsl:attribute name="href"><xsl:value-of select="item/link" /></xsl:attribute> Article</a><xsl:if test="string-length(item/commentlink) &gt; 0">
    13:             <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    14:             <a><xsl:attribute name="href"><xsl:value-of select="item/commentlink" /></xsl:attribute>Comments</a>
    15:         </xsl:if>
    16:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    17:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://services.newsgator.com/subscriber/Related.aspx?relurl=', item/encodedlink)" /></xsl:attribute>Related</a>
    18:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    19:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.bloglines.com/citations?url=',item/encodedlink)" /></xsl:attribute>Bloglines</a>
    20:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    21:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.technorati.com/search/',item/encodedlink)" /></xsl:attribute>Technorati</a>        
    22:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    23:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.feedster.com/links.php?q=',item/encodedlink)" /></xsl:attribute>Feedster</a>
    24:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    25:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.blogpulse.com/search?query=',item/encodedlink)" /></xsl:attribute>Blogpulse</a>
    26:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    27:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://blogs.icerocket.com/search?q=',item/encodedlink)" /></xsl:attribute>Ice Rocket</a>
    28:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    29:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://www.blogdigger.com/linkSearch.jsp?link=',item/encodedlink)" /></xsl:attribute>Blogdigger</a>
    30:         <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text> | <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    31:         <a><xsl:attribute name="href"><xsl:value-of select="concat('http://clusty.com/search?query=',item/encodedlink)" /></xsl:attribute>Clusty</a>
    32:     </p>
    33: </div>

This puts a link at the bottom of each post to the article, the comments (if available), Newsgator's related feature, Bloglines, Technorati, Feedster, Blogpulse, Ice Rocket, Blogdigger, and Clusty.

Categories: Blogging


 

RossCode Weekly #009

posted on 2005-07-18 at 01:14:21 by Joel Ross

It's been a long week and busy weekend, so this'll most likely be brief. I didn't have the time to scour as deeply as I'd like, but I think I got the highlights.

Google opens up AdSense for everyone - if you have 100 subscribers, according to Steve Rubel. I'm not sure where he's getting this information, but to me, it still looks like the original beta, so take it for what it's worth.

Hotmail is testing a new interface. Not many details about the new interface, but it hasn't changed much recently, and the pressure from gmail is probably getting to be too much. Again, open up POP3 access for free, and that'll be the best interface for me!

CBS is podcasting, as is MSNBC. All of a sudden, there's a huge surge from more mainstream sources into the podcasting domain. And yes, Apple is definitely part of that trend.

AOL released Triton, the beta of the next AIM client. It has video support, as well as video editing support. And by August, you'll be able to extend it with plug-ins. Very cool.

Microsoft is changing their certification program. Oddly, not many are talking about this in the ol' blogosphere. The new program details are slowly trickling out, but it looks like the point is to make the certs more useful. My view of certifications doesn't really change though - I'm not sold on them. I'd want someone who's too busy using the products to get certified on my project rather than someone who has the time to take tests and hasn't really used the products in production.

Xbox 360 to launch November 4th? That's the rumor, which makes sense. You'll have a month and a half to get it before Christmas, which will be good enough for them to sell out, and people buying them off of ebay for $600 by Christmas.

Atom 1.0 is ready to go. Does this mean I have to get an update to my aggregator? How soon before the first Atom 1.0 feeds will be in the wild?

And that's a wrap. I'm tired!

Categories: RossCode Weekly


 

Newsgator 2.5

posted on 2005-07-14 at 23:43:39 by Joel Ross

EDIT: Right after posting this, I got an email from Newsgator support stating that they thought all of my issues were resolved, and apologized for the confusion. I worked with them for the past few days, and this morning, all of my issues seem to be resolved, although I figured out my remaining two on my own. First, the synchronization. I noticed that it was working, but there were still about 9,000 items that it never picked up - they were all older posts. I read all of my items in Outlook, and then went online and marked all 200 pages as read (where is the Catch Up button?). That solved that issue - now my synchronization is working beautifully. As for the plugin issue? I had a copy of the blogExtension.dll in my plugins folder, and once I removed that, it starting working. TO be fair, Nick, one of the Newsgator guys I've been corresponding with, gave me the idea to check that all files were in the proper place. Once I started digging in, I decided to try removing the extra copy of the DLL, and it started working again! Now, I'm back to being a happy Newsgator customer!


 

I installed Newsgator 2.5 the other day, and upgraded to the subscription service. I'm not really thrilled about the new subscription model - before I paid $29.00 for a lifetime service, and now I'm expected to pay $19.95 a year to use the software.

Having said that, they've done something very cool. If you purchased Newsgator 2.0 before March 2nd of this year, you can get a free two year subscription to their business service. That gives me a three plus years out of the software for $29. That's a great value! I don't expect to get 3 years out of any software that I buy - the world of software changes too fast.

Anyway, I got it installed, and all started out fine. Well, almost fine. The biggest new feature of Newsgator 2.5? Synchronization. Except it doesn't work for me. Right now, I have 2 unread posts in Outlook, but over 10,000 in Newsgator Online. Doesn't sound synched to me. I have a support issue opened with Newsgator. Or at least I should. I got a one sentence reply 3 days after opening my issue, and haven't heard anything in the past 5 days. But I can deal with that. I don't use Newsgator Online for the most part. It's nice to know it's there, but my laptop is with me just about everywhere I go, so I have Outlook ready to go.

Then a couple of nights ago, it decided it wasn't activated. Coincidentally, that was the same time I decided I was going to find a plug-in to post links to del.icio.us. Since it's wasn't activated, I couldn't post through Outlook. And I couldn't tell it to get feeds automatically either, although it seemed to be willing to get feeds on it's own, despite it's un-activated state. I opened another support issue, and the next day, I got a reply, fixing the problem. Very prompt service. But it only lasted a day. Again, I responded to the issue, and it was resolved within an hour.

Now though, I still can't use the plug-ins, because it's not recognizing them for some reason. And I haven't heard anything back on that issue yet.

I'm torn about Newsgator right now. I've been very happy with it, but that was when everything worked correctly. Now that I want to be able to post to del.icio.us and can't, I'm a little disappointed. That, and the subscription thing…

If RSS Bandit had an IFilter plugin for Microsoft's Desktop Search, I'd definitely consider switching back!

Categories: Blogging


 

Fast Build / Full Build Differences

posted on 2005-07-14 at 23:23:57 by Joel Ross

 I've recently been trying to expand my knowledge of different continuous integration tools, and one that I stumbled upon is DamageControl.

I haven't used the software yet (because I don't have the time to play with it), but there was something on the site that I read that was both obvious, yet new to me.

They have an online book about Build Patterns, and while most of the book isn't completed, the one chapter that has some content in it talks about the difference between a fast build and a full build. Both builds create the same software, but the fast build is designed as more of a smoke test, and only runs a subset of unit tests, and those change over time as different areas of the system are worked on. The full build runs all unit tests, and if it ever fails from a unit test, that test gets automatically added to the fast build. That's a very cool idea, but I wonder how hard it would be to implement, and how big your projects have to get to justify the complexity.

Oh yeah, they also have a feature matrix comparing a few CI tools. It provides a pretty good run down of what each product supports.

Categories: General


 

Adding Files to VSS Using Nant

posted on 2005-07-14 at 23:07:19 by Joel Ross

Dominique Plante has a good (older) post explaining some of the pitfalls of adding files to Visual SourceSafe using Nant and NantContrib, and how to make it work.

I haven't dealt with adding files to source control, but I have considered it - not necessarily adding binary outputs, but I have considered checking out the AssemblyInfo.cs file to handle version numbers through my build process, rather than manually, which is how it's done now.

Categories: Development


 

The Observer Design Pattern

posted on 2005-07-14 at 22:42:08 by Joel Ross

This is older, but I'm just starting to get through my blogging backlog, so bear with me here. Dave Burke has a nice post about the Observer Pattern.

I've been getting more and more into design patterns lately. They make development a lot easier, because if you find a fit to use a pattern, it's like getting a design for free!

Speaking of design patterns, the Patterns and Practices team has a GotDotNet workspace set up for Service Oriented Patterns. Is it just me, or does this GotDotNet site look a lot better than the rest of them? And it hasn't bombed on me yet. Baby steps...

Categories: Development


 

Now That The NHL's Back...

posted on 2005-07-14 at 22:31:03 by Joel Ross

It's been a long time since I posted about anything other than technology, and that's probably because of the NHL lockout - no hockey and I'm not a huge NBA fan, so what else is there to comment on? Baseball is slow and boring until the playoffs and football is still a month or so away. Although the Pistons run in the playoffs was exciting, I just haven't found much to post about related to sports.

Until recently. The prospect of a signed CBA combined with a recent article by Terry Frei on ESPN.com about a potential way to get things kicked off once the NHL comes back - a complete re-draft! Start out the NHL's reappearance fantasy style!

Now, let me first state that I know this isn't going to happen. But it's fun to speculate, isn't it? So from here on out, the rest of this is pure fantasy based on a new NHL where all players go back into the draft.

First, how do you decide who gets first pick? I guess the current weighting they are going to do now would work. You give some advantage to the teams that have finished near the bottom, but not a huge advantage. You'd need a snake draft (draft first in the first round, and you draft last in the second round). With this type of draft, there's always a debate - which is the best position? First in the first round? You get the best player in the game (theoretically), but you don't get another pick until the end of the second round - where you'll still get a good player, but you won't have as good of a one-two punch as other teams. OK. What about drafting last? You won't get the best - you'll get the 30th best player, but you'll also get the 31st best player. You get two solid players, but maybe not a superstar that you'd hope to get.

That leaves drafting in the middle. You'll get a great player in the first round, and a pretty good player in the second round. You also don't go very long between picks - remember, the team drafting first or last goes about 60 picks between each set of picks. You can't follow trends very well from those positions. From the middle, you can watch other team's trends and react accordingly.

Of course, this doesn't take into account trades. Trades will shake up how teams strategize.

Heh. This applies to fantasy football drafting too.

Now, how would the draft affect salaries? At first glance, it would seem that salaries would be pretty easy to figure out - your salary is determined by your draft slot. Seems logical right? I thought so too, but you have to think about how GMs will strategize. If you're a GM, and you have 12 million left in cap space (yes, there will be a cap when the NHL returns), and you need four more players, are you going to draft a great center at 7 million a year, or a slight downgraded center for 2 million? So, you won't necessarily draft players in the order you expect to pay them.

So you get a draft, and each NHL team is ready to go. Players sign contracts, and the season is underway. How do you measure your team's draft success? Does winning the Stanley Cup in the first year reflect draft success? Making the playoffs?

This applies for the new NHL without a redraft too, by the way. Even without redrafting, everything has changed. Anyway, back to fantasy land.

I'm not sure you can measure success in the first year. Why? Well, if you draft a great team that wins the Cup in the first year, and then half your team retires, is that successful? Or, if you drafted a team that didn't make the playoffs the first year, but you've started the dynasty process - where you'll be competitive in three years, and win the Cup regularly in five or six, was your draft a failure? I can't say it will be.

Back to reality. If you spend this year working through the new financial model, and miss the playoffs, but set yourself up to be competitive, will anyone fault you in the long run. I doubt it. But, in this day and age, everyone wants results now.

Of course, the Wings are going to be in trouble. They have almost $39 million in signed contracts right now. The rumors are that the high end of the cap will be $39 million. And that's only 14 players for the Wings. Ouch.

But at least we get hockey back!

Categories: Hockey


 

<< 1 ... 67 68 69 70 71 72 73 74 75 76 77 ... 124 >>