Professional Programmer Notes

or just call this my soapbox

Posts Tagged ‘.net

ZeroMQ

leave a comment »

Overview of ZeroMQ from pieterh
This slideshare makes me wonder about the different ways ZeroMQ could allow me to scale .NET applications?
Advertisements

Written by curtismitchell

April 16, 2013 at 12:32 pm

Posted in Uncategorized

Tagged with , ,

WPF’ing around with Boo and external xaml files

leave a comment »

Here is a snippet of Boo code (formatted with Python syntax highlighter) that will load a xaml file into a WPF Window:

import System
import System.Windows from PresentationFramework
import System.Windows.Markup from PresentationFramework
import System.IO

class XamlWindow(Window):
	def constructor(name):
		load_xaml(name)

	def load_xaml(name):
		xaml_file = File.OpenRead(Path.GetFullPath(name))
		self.Content = XamlReader.Load(xaml_file)

Application().Run(XamlWindow("mainui.xaml"))</pre>

See http://devpinoy.org/blogs/smash/archive/2006/10/04/XAMl-meets-Boo.aspx for reference.

Alternatively, here is the equivalent IronPython code:

import clr
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore")

from System.Windows import Window, Application
from System.Windows.Markup import XamlReader
from System.IO import File, Path

class XamlWindow(Window):
	def __init__(self, name):
		self.load_xaml(name)

	def load_xaml(self, name):
		xaml_file = File.OpenRead(Path.GetFullPath(name))
		self.Content = XamlReader.Load(xaml_file)

Application().Run(XamlWindow("mainui.xaml"))

Lastly, here is an example xaml file

<StackPanel
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Label Content="Hello World" />
    <Button Content="Clickable" />
</StackPanel>
Note: There is no UserControl or Window element and the namespaces are defined on the root container, the StackPanel.
Results:
screenshot of very simple wpf app

Written by curtismitchell

May 22, 2011 at 5:39 pm

Posted in .net

Tagged with , , , , ,

VMWare VMDebugger “unable to detect current startup project”

leave a comment »

 

I spent many small packets of time trying to find a solution to this problem over about two months.  Luckily, I stumbled across an answer that actually worked for me.

Problem: Visual Studio 2008 with VMWare VMDebugger integration does not work.  When I try to launch debugging in a VM, I get a message that says “Unable to detect current startup project”.

Solution:  Remove any installer projects that are in the solution.

Source: Read MartinMoesby comment here.

Written by curtismitchell

November 9, 2010 at 5:48 pm

Gestalt = Low-Lying Awesome

leave a comment »

Microsoft appears to be betting big on Silverlight.  When the Silverlight 1.0 bits were released in 2007, my initial thoughts were, “Yay, Flash for .NET developers.”  As Microsoft pushed forward with version 2, version 3, and now version 4 of Silverlight, those sarcastic thoughts have subsided to make way for more genuine curiosity.  How did that happen?

Well, for starters, Microsoft delivered real features.  Initially, Silverlight demos were all about media (music and video).  In addition, Microsoft touted the interopability between dynamic languages like vbx, c#, python, ruby, and javascript.  Then, that interopability was sidelined and Silverlight applications started to emerge.  Which was interesting.  In fact, Silverlight 2 had enough features to stir up debates in the enterprise over which RIA technology was best suited for enterprise applications: Flash 8 with Flex or Silverlight 2.   Then, Microsoft played their wildcard.  They made Silverlight play nicely with … ugh … Mac OSX.  Out-of-browser Silverlight applications made me raise my eyebrows for a technology that I had quickly written off as a “fad”.

That might still be the case.  I won’t make a claim either way.  But, Silverlight and RIA are spaces where Microsoft continue to innovate.  Gestalt is a very good example of that last statement.  Gestalt is built atop a foundation consisting of XAML, Silverlight, and dynamic languages.  It enables web developers to script their way to rich internet applications in a way that both Flash and Silverlight seemingly missed. 

With that said, it is difficult to pinpoint exactly what value Gestalt adds, but you feel it when you’re molding some python, ruby, or javascript hackery into a magical Silverlight-powered application that just works.

The technology appears to still be more of a proof-of-concept than a supported product.  But, it makes a strong case for embracing XAML and Silverlight. 

Checkout the website and the samples at http://visitmix.com/labs/gestalt/.

Written by curtismitchell

February 11, 2010 at 9:59 pm

Posted in .net, CSharp, Javascript, web

Tagged with , , , , ,

Richmond Code Camp 2009.2

with 2 comments

Wow! What an event!

This weekend, I joined ~400 others for the Richmond Code Camp and a good time was had. As others have noted, the hardest part of the day was choosing which talks to attend due to a schedule full of excellent topics and speakers.

I started off with Justin Etheredge’s talk on Linq Expressions. This was 75 minutes of great slides and polished demos of basic to advanced Linq concepts. I left that talk more educated and less scared of the power of Linq Expressions. Justin has an unbelievable understanding of how Linq works and an amazing ability to convey that to the layman with nothing more than a stock photo of a cat and a VM with Win 7 and VS 2010.

Second, I attended a talk that was missed from Raleigh’s Code Camp two weeks earlier. I went to John Feminella’s talk on Ruby for C# developers. John gave .NET developers a great introduction to the Ruby language using IronRuby (I thought that was brave at this point). To my surprise, John held up his end with great content and examples, and IronRuby held up its end with stability and support for most of the features of Matz Ruby (the original implementation of Ruby).

Next, I decided to checkout Open Spaces. The evening before, I jokingly suggested that the audience would convince Kevin Hazzard to present something on the DLR at Open Spaces since he was not officially presenting. Well, I guess they did! Kevin led a discussion on IronPython and the DLR that included some very nice demos. He also discussed C# 4.0’s new “Dynamic” type and how it actually works. I gained a lot of insight on when and where the DLR and Dynamic Languages on .NET are useful. And, while I love Ruby, IronPython is making the Python language very attractive to me.

Another talk that I was able to attend was by Chris Love. He talked about building quality ASP.NET applications faster. I know Chris to be a very experienced developer. He just completed an updated version of a book I found to be very practical when I was getting into more advanced ASP.NET concepts, ASP.NET 3.5 Website Programming: Problem – Design – Solution. His talk drew off of his experiences building applications and sites for his clients. He talked about architecture as well as development practices. I recommend his talk to anyone doing ASP.NET development that is looking for practical advice on how to manage it all from start to finish.

In the last time slot of the day, I presented Spark, an ASP.NET MVC View Engine, to a great audience. This was essentially the same talk that I gave a couple of weeks earlier at Raleigh’s Code Camp, but I made some modifications for the Richmond crowd. Here are the slides from that talk:

Enjoy!

Written by curtismitchell

October 5, 2009 at 3:04 pm

Posted in .net, CSharp

Tagged with , , , , ,

Slides from Raleigh Code Camp 2009

leave a comment »

This weekend, I had the pleasure of presenting a talk on Spark View Engine at Raleigh Code Camp (#rducc).  It was a well organized event with a schedule full of great topics and presenters.  The Triangle .NET User Group (TriNUG) did a wonderful job at organizing and running the event.  Thanks, TriNUG!

As promised, I am posting the slides that I used in the Spark talk.  Although the true context of the talk is not present on the slides, I hope these are helpful to someone using the Spark View Engine or considering it.

Stay tuned, or subscribe to the rss. I am planning to post a series of short to-the-point screencasts that demonstrate how to practically use Spark in your ASP.NET MVC application.

In the meantime, checkout http://www.dimecasts.net for some great videos on Spark.

Written by curtismitchell

September 21, 2009 at 10:01 am

Debug an IE Add-On in Visual Studio 2008

leave a comment »

I’m working on a project that involves creating an IE Add-On in C#.  It is an inherited project that was created in Visual Studio 2005 targeting the .NET Framework 2.0.

Well, times have changed.  I am now doing most of my development in Visual Studio 2008, and (when lucky) I am using the features of the .NET Framework 3.0 or higher.  When I first made the switch, I tried to use 2008 to continue my work on the toolbar, but I failed miserably.  I was shocked to find out that my process of registering my assembly in a post-build action and launching IE as a Start Action did not work in 2008.  At the time, I quickly got over it, and preserved 2005 just for that project.

Luckily, in a more recent attempt to use 2008 for this type of development, I was able to solve the problem.  Check it out.

Problem:

Whenever I tried to debug my IE Toolbar project in Visual Studio 2008, I would get a nasty exception that says, “Error while trying to run project.  Unable to start debugging

image

My project is configured to register the assembly using regasm in a Post-build step.  Then, as you can see below, the VS Debugger is configured to start Internet Explorer (and subsequently attach to the process).

image1

Well, that was the wrong way of doing it.  I was able to get it to work successfully by modifying the Start Action like such:

image

And it worked!

UPDATE:  I still had issues on a separate computer.  Adding “about:blank” to the command line arguments fixed the issue.

Written by curtismitchell

May 6, 2009 at 3:25 pm