A taste of development

March 24, 2008

Sometimes you just have to make something fun and silly. The chance tree converted to javascript…

Filed under: Technology —Tagged , , — simma1990 @ 11:48 pm

Also see: New Assembly, Old .NET (and Vice-Versa)

Also see: The 2 Technology Magazines You Should Read

Also see: Java Frameworks State of the (dis)Union.

Actually, I didn’t make it to be fun or silly, but rather to create a neat little client-side application for a good friend of mine. Could have just as easily written a basic PRNG index swizzle and gotten identical results, but it seemed like this chance tree is going to just make my life entirely easier if I have it always available as a tool. Not going to worry about implementing the swap filters and other features, but if you need to do some random selection in a web browser, maybe you’ll find it useful.

Code-Only: Client-Side OO Javascript Vector Chance Tree for probability selection.


http://weblogs.asp.net/justin_rogers/archive/2004/10/26/248370.aspx

Note to self: Blog about using Service Broker

Filed under: Technology —Tagged , , — simma1990 @ 7:48 pm

Also see: Interested in Artificial Intelligence? What about Wiki’s? Well, now you can have both.

Also see: CERT C Secure Coding Standard

Also see: Exception Handling in Running a Business

Just a note to myself to do a braindump on all this Service Broker shiznit I have been playing with lately.

Potential discussion topics:

  • MessageTypes, Contracts, Queues, and Services.
  • Internal Activation, Routing, & External Activation
  • Using the Sql Server ServiceBroker sample library.
  • Implementation using SqlClr vs. TSQL
  • Developing via messages instead of procedures…
  • Compare & contrast Service Broker vs. Workflow Foundation vs. BizTalk
  • The nifty Sql Service Broker Admin tool (3rd-party)
  • Practical examples:
    • Async “fire-and-forget” stored procedure invocation
    • Query Notification for cache invalidation
    • PubSub


http://weblogs.asp.net/lhunt/archive/2007/06/14/note-to-self-blog-about-using-service-broker.aspx

Data Types a la Carte

Filed under: Technology —Tagged , , — simma1990 @ 6:00 pm

Also see: There can be only one… with data

Also see: UI design

Also see: A quick update on me.

Data Types a la Carte. Wouter Swierstra.

This paper describes a technique for assembling both data types and functions from isolated individual components. We also explore how the same technology can be used to combine free monads and, as a result, structure Haskell’s monolithic IO monad.

This new Functional Pearl has been mentioned twice in comments (1 , 2 ), and has now also appeared with comments on Phil Wadler’s blog. Obviously it’s time to put it on the front page.

http://lambda-the-ultimate.org/node/2700

C# 3.0 Lambdas and Type Inference

Filed under: Technology —Tagged , , — simma1990 @ 3:00 pm

Daniel Cazzulino recently wrote a blog entry whose main focus was on building pipelines using iterators in C#. Towards the end he showed a slightly irritating problem in C# 3.0. He wanted to write this:

var transformer = x => new { Original = x, Normalized = x.ToLower() };

However, the C# compiler complains because it doesn’t have enough information to infer the type of the transformer variable. The problem it reports is “Cannot assign lambda expression to an implicitly-typed local variable”.

Daniel doesn’t present a working solution to this particular problem – he ends up structuring his program differently to avoid the issue entirely. But in his discussion of this problem, he proposes something that he describes as ugly, and which, as he points out, doesn’t work anyway:

Func<string, {string Original, string Normalized}> transformer =
 x => new { Original = x, Normalized = x.ToLower() };

This is a direct approach to the problem described in the compiler error message. Can’t assign the expression to an implicitly-typed variable? OK, let’s make the variable explicitly typed. Unfortunately, you can’t specify the type because the expression involves an anonymous type. And that’s the thing about anonymous types: they don’t have names.

(more…)

Reporting Services administration changes in Katmai (v.Next)

Filed under: Technology —Tagged , , , — simma1990 @ 1:48 pm

Also see: When Will Foreign Ownership of US Sports Teams Start ?

Also see: 2,433 Unread Emails, I feel your pain..

Also see: Publishing: Good reviews, bad reviews, and hurting oooh so many feelings.

Brian Welcker posts some information on changes they are consindering to how you will administer Sql Server Reporting Services in the next version, codenamed Katmai.

Right now, administering Report Models exposed to Report Builder requires you to launch Sql Server Management Studio tool, while other features require you to launch the Report Manager website.   Also, there are some features that you rarely use, yet are exposed from the Report Manager portal, such as Job Management and System Wide Role & Security configuration.  

It appears that the end result of the proposed tool changes will be to correct these inconsistencies by consolidating server and system-wide configuration and administration tasks into Sql Server Management Studio, and moving some of the more user-facing admin features to the Report Manager.

Not a bad idea overall, now I just hope they fix support for FormsAuth throughout the entire solution (ReportBuilder, nudge nudge).


http://weblogs.asp.net/lhunt/archive/2007/04/24/reporting-services-administration-changes-in-katmai-v-next.aspx

From C# to Java: Part 4

Filed under: Technology —Tagged , , , — simma1990 @ 12:48 pm

Also see: Snippet Compiler update

As a member of Microsoft’s VSIP
program, we have been creating source control plugins for the Visual Studio
line of products for eight years.  As I started my recent foray into the
Eclipse world, I was eager to explore the area of plugins over on this side of
the fence.  So far, I’m impressed.

Source Control and Bug Tracking

The first plugin I installed was our own.  SourceGear
Fortress includes an Eclipse plugin, but I had never even tried it.

My first reaction is that I really like the way Eclipse
handles installation of plugins.  The whole process is managed from within
Eclipse itself.  Under the Help menu is a submenu called Software Updates.  All
I have to do is provide the URL of our Eclipse update site:

http://download.sourcegear.com/Fortress/latest/update

The rest of the job is very simple, essentially automatic.

Once installed, I have several additional views:

And some new stuff under the Team menu:

And some new items under Preferences:

All in all, I have found using source control under Eclipse
to be very pleasant and straightforward.  If this seems like I am bragging
about my own product, I suppose it is, except for two mitigating factors:

  1. I personally had nothing to do with this plugin, so this
    is less of a boast and more of a compliment to the efforts of my
    coworkers.

  2. In my experience, source control plugins are a lot like
    children.  To some extent, the behavior of a child (or plugin) reflects
    the quality of the structure and guidance provided by the parent (or
    IDE).  In saying that our source control plugin works very well, I am
    complimenting Eclipse.

(more…)

LINQ – The Uber FindControl

Filed under: Technology —Tagged , , , , — simma1990 @ 12:00 pm

Also see: Trust Microsoft with Claimspace (my response pending)

With a simple extension method to ControlCollection to flatten the control tree you can use LINQ to query the control tree:

public static class PageExtensions
{
 public static IEnumerable<Control> All(this ControlCollection controls)
 {
 foreach (Control control in controls)
 {
 foreach (Control grandChild in control.Controls.All())
 yield return grandChild;

 yield return control;
 }
 }
}
Now I can do things like this:
// get the first empty textbox
TextBox firstEmpty = accountDetails.Controls
.All()
.OfType<TextBox>()
.Where(tb => tb.Text.Trim().Length == 0)
.FirstOrDefault();

// and focus it
if (firstEmpty != null)
 firstEmpty.Focus();

.csharpcode,.csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode.rem { color: #008000; }
.csharpcode.kwrd { color: #0000ff; }
.csharpcode.str { color: #006080; }
.csharpcode.op { color: #0000c0; }
.csharpcode.preproc { color: #cc6633; }
.csharpcode.asp { background-color: #ffff00; }
.csharpcode.html { color: #800000; }
.csharpcode.attr { color: #ff0000; }
.csharpcode.alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode.lnum { color: #606060; }

(more…)

Natural Sorting in C#

Filed under: Technology —Tagged , , — simma1990 @ 10:48 am

Also see: Win friends and influence your team

Jeff Atwood recently posted about natural sorting. This is all about making sure that strings that contain numbers sort numerically. I’m slightly surprised to see that he wants to call it alphabetical sorting. Surely by definition, alphabetical sorting is defined by, well, the alphabet. This is an issue about numbers, not letters.

Anyway, he says he tried and gave up on a succinct C# version. He suggests that it will take 40+ lines of code. I believe that’s misleading, because as far as I can tell, the Python versions are only able to be so succinct because Python already appears to know how to sort an array. Both examples he shows rely on this. In.NET, collections aren’t intrinsically sortable. Let’s sort that:

/// <summary>
/// Compares two sequences.
/// </summary>
/// <typeparam name="T">Type of item in the sequences.</typeparam>
/// <remarks>
/// Compares elements from the two input sequences in turn. If we
/// run out of list before finding unequal elements, then the shorter
/// list is deemed to be the lesser list.
/// </remarks>
public class EnumerableComparer<T> : IComparer<IEnumerable<T>>
{
 /// <summary>
 /// Create a sequence comparer using the default comparer for T.
 /// </summary>
 public EnumerableComparer()
 {
 comp = Comparer<T>.Default;
 }

 /// <summary>
 /// Create a sequence comparer, using the specified item comparer
 /// for T.
 /// </summary>
 /// <param name="comparer">Comparer for comparing each pair of
 /// items from the sequences.</param>
 public EnumerableComparer(IComparer<T> comparer)
 {
 comp = comparer;
 }

 /// <summary>
 /// Object used for comparing each element.
 /// </summary>
 private IComparer<T> comp;

 /// <summary>
 /// Compare two sequences of T.
 /// </summary>
 /// <param name="x">First sequence.</param>
 /// <param name="y">Second sequence.</param>
 public int Compare(IEnumerable<T> x, IEnumerable<T> y)
 {
 using (IEnumerator<T> leftIt = x.GetEnumerator())
 using (IEnumerator<T> rightIt = y.GetEnumerator())
 {
 while (true)
 {
 bool left = leftIt.MoveNext();
 bool right = rightIt.MoveNext();

 if (!(left || right)) return 0;

 if (!left) return -1;
 if (!right) return 1;

 int itemResult = comp.Compare(leftIt.Current, rightIt.Current);
 if (itemResult != 0) return itemResult;
 }
 }
 }
}

(more…)

JSR-203 more New I/O APIs – NIO.2

Filed under: Technology —Tagged , , — simma1990 @ 8:48 am

Alan Bateman who forms part of the JSR-203 expert group — the latter of which focuses on the new generation Java I/O APIs or NIO.2 — weighs in on a series of issues in and around these API’s which are set to from part of Java SE 7.

Also see: A Quick Fix for the Validator SetFocusOnError Bug


http://feeds.feedburner.com/~r/techtarget/tsscom/blogs/~3/256875109/thread.tss

DevWeek 2008 Silverlight Precon Demos

Filed under: Technology —Tagged , , — simma1990 @ 5:00 am

Also see: Passing the Community Torch: In Search of a New Chief Executive in Redmond

Fritz Onion and I just finished the pre-conference ‘Day of Silverlight’ talk at DevWeek. Demos can be downloaded from http://www.pluralsight.com/fritz/demos/DevWeek2008DayOfSilverlightDemos.zip

http://www.interact-sw.co.uk/iangblog/2008/03/10/devweek-sl-demos

Powered by WordPress Hosted by Edublogs.