Yes once again I have changed the skin of my blog. This time to something a lot more practical for what I am doing with the blog. This for those that do not know is Cogitation, a Subtext skin. But it’s widely used by technical writers and bloggers. It’s supports a lot of text and a flowing layout that is quite good, and though I hate using a cookie cutter template my old template was not as good as I would have liked. So here I am I’ll probably modify it to give it my own little flare, but till then enjoy the layout and the content to follow.
Friday, February 27, 2009
Thursday, February 26, 2009
Question Mark is a Nullable Type
One of the questions I keep seeing is what is int? or DatTime? and the like?
Well in .NET 2.0 the Nullable Type was introduced and that is what those type declarations mean. So what is a Nullable type?
Nullable types have the following characteristics:
Nullable types represent value-type variables that can be assigned the value of null. You cannot create a nullable type based on a reference type. (Reference types already support the null value.)
The syntax T? is shorthand for Nullable<(Of <(T>)>), where T is a value type. The two forms are interchangeable.
Assign a value to a nullable type just as you would for an ordinary value type, for example int? x = 10; or double? d = 4.108. However, a nullable type can also be assigned the value null: int? x = null.
Use the Nullable<(Of <(T>)>)..::.GetValueOrDefault method to return either the assigned value, or the default value for the underlying type if the value is null, for example int j = x.GetValueOrDefault();
Use the HasValue and Value read-only properties to test for null and retrieve the value, for example if(x.HasValue) j = x.Value;
The HasValue property returns true if the variable contains a value, or false if it is null.
The Value property returns a value if one is assigned. Otherwise, a System..::.InvalidOperationException is thrown.
The default value for HasValue is false. The Value property has no default value.
You can also use the == and != operators with a nullable type, for example, if (x != null) y = x;
Use the ?? operator to assign a default value that will be applied when a nullable type whose current value is null is assigned to a non-nullable type, for example int? x = null; int y = x ?? -1;
Nested nullable types are not allowed. The following line will not compile: Nullable<Nullable<int>> n;
Thats about all of it. More information can be found on MSDN
Wednesday, February 18, 2009
Blogging: Style or Content, how will you be judged?
So I spend a lot of time thinking about my blog and wondering,”Should I blog more?” And that leads me to thinking about the style of my blog. My current style aka theme works well for my needs though there are a few quirks with it, yup look for a future redesign. But what’s more important the style or the content. Can you have poor content but such good style that the users come back and stare thinking, “It’s so beautiful!” with a little drool rolling down their chin? Can that get you through? I don’t honestly know.
I do notice however that among the software engineers and coders, or as I called them back in the old days, computer programmers, there seems to be a very broad scope of style and content. Some blogs have great style and great content, these are clearly the winners and will be judge mercifully by the robotic masters, they are among us now. Some have horrible style, and call themselves minimalistic blogs, I call them lazy blogs. I think if your a programmer talking about the subject of web development or whatever you should have a blog that at least puts on a bit of a show for the readers. But that aside, the content is very good Martin Fowlers blog is a good example of this. I went to his blog looked and chuckled at how sad it looked, but the content is solid, also he calls it a bliki.
But I wonder again for those that are not familiar with his work, would they just surf away to a new blog without looking? Anyhow I have compiled a list of some of the top programmer blogs out there. So you can look for yourself. All of these have great content, some have great style, and some if not most have both. Where do you stack up?
- Joel on Software (Joel Spolsky)
- Coding Horror (Jeff Atwood)
- Seth's Blog (Seth Godin)
- Paul Graham: Essays (Paul Graham)
- blog.pmarca.com (Marc Andreessen)
- Rough Type (Nicholas Carr)
- Scott Hanselman's Computer Zen (Scott Hanselman)
- Martin Fowler's Bliki (Martin Fowler)
- Rands in Repose (Michael Lopp)
- Stevey's Blog Rants (Steve Yegge)
Enjoy!
Tuesday, February 3, 2009
Infragistics Quince: UX Patterns Explorer
If your into patterns like I am you will most likely love this.
Half the problems with patterns is trying to figure out what ones you need, what ones you want, and how they all fit together. From an application architecture stand point this usually involves lots of reading and developing a large knowledge base that honestly can set your brain to overload. That is why I think the UX patterns explorer is a great tool. Being able to have a slick UI that makes for a great UX, I mean come on if your going to make a UX patterns explorer it better look cool and give a great UX, right! It gives an easy way to identify what your looking to do and then presents you with the pattern and practical examples of implementation. I mean that’s great. So I tip my virtual hat at the Infagistics guys.
If your inclined I would recommend giving it a look.
ASP.NET MVC RC Refresh
While there is much to be excited about in MVC RC1, there were two changes introduced in the RC that broke some scenarios which previously worked in the Beta.
So they have just released the MVC RC Refresh to address these bugs. You can read more about it over at Haacked but the important thing the bug fixes are starting to roll out. You really have to appreciate the response times of the team.
Thursday, January 29, 2009
The Double Question Mark Operator
The double question mark operator, also called the null-coalescing operator, is one of the many new and often unknown things in .NET 2008. It is a very slick operator and very useful. Microsoft states that it
is used to define a default value for a nullable value types as well as reference types. It returns the left-hand operand if it is not null; otherwise it returns the right operand.
Its usage is as follows:
class NullCoalesce{static int? GetNullableInt(){return null;}static string GetStringValue(){return null;}static void Main(){// ?? operator example.int? x = null;// y = x, unless x is null, in which case y = -1.int y = x ?? -1;// Assign i to return value of method, unless// return value is null, in which case assign// default value of int to i.int i = GetNullableInt() ?? default(int);string s = GetStringValue();// ?? also works with reference types.// Display contents of s, unless s is null,// in which case display "Unspecified".Console.WriteLine(s ?? "Unspecified");}}
Monday, January 26, 2009
Windows Live Writer Blogging Made Easier
Recently I started to look at Windows 7 and I wanted to look at the new Microsoft Live Messenger. So when I downloaded and started to install everything I notice it asked if I wanted to install Windows Live Writer. Having looked at a number of blog posting apps and deciding that they were all lacking I was hesitant to install it. But I like to try new things before deciding if I like them or not so I let the installer rip.
To my surprise I have been more than impressed. Having worked in Microsoft Office, like many of us, I am fairly tied to the keyboard layout and hot keys, as well as I write to my blog and I like to see how my posts will look in respect to my layout and template.
The initial configuration asked me for a few details about my blog and some information for logging into it. Then it downloaded my template and articles and all kinds of stuff, all of which only took seconds, and I was ready to go. So I typed out a simple test and hit the preview tab and I was just stunned, staring me in the face was a perfect preview of my blog and my post. Perfectly rendered. Which if you know blogger their own preview tab doesn’t do that good of a job. I would think since I have a Blogger blog and not a Microsoft owned and operated one, that I would have sub par integration. But it seems to integrate better than the built in blogger one.
Another great feature is the fact that it is a rich client editor so I can do spell checking and the like with full office integration which is what I would expect.
It even has a tagging section at the bottom allowing me to pick the tags for the post from my existing set, or add a new one if I like.
One thing that is lacking is the fact that I can’t add custom tags, similar to block quote tags which are included with a simple click, I do have some custom tags for code blocks, which though it would be convenient it is no show stopper for this editor.
Anyway If you are an avid Blogger or contributor to the blogosphere I would recommend Windows Live Writer above all the other blog editors to date.
Friday, January 9, 2009
Zoom Your Desktop with ZoomIt
After the presentation it came up that this was a problem and would continue to be a problem. And someone mentioned that many of the Microsoft presenters use a tool that zooms the entire desktop onto the mouse position. So I set out to find this tool and of course I should have know that it came out of the many great tools from Sysinternals, now part of Microsoft, written by Mark Russinovich.
The tool is called ZoomIt and now that I have it I will add it to my arsenal of great and useful tools.
It does more than just zoom, it also allows you to draw on your desktop which is great for highlighting things that you want to draw attention to. And it has a timer mode that displays a count down that you can set, for those all important breaks.
Thursday, November 20, 2008
Client Side Values for the CheckBoxList
I have run into the problem so many times now that I have finally, after years of waiting for Microsoft to fix it, broke down and fixed it myself.
The problem that many people run into with the CheckBoxList in todays world of Ajax is that it does not render the value attribute on the client side. So you can't access it through javascript. This is actually intentional as the attributes are removed prior to rendering, well probably more of an oversite than intentional.
Of course you have the values on the server side, but that is because they are stored in control state and rebound when the control is recreated on postback.
The following code extends the CheckBoxList and fixes the RenderItem method to render a value attribute for the checkboxes in the list. I kept the changes minimal just so I didn't have to fix data binding and viewstate, so the control works exactly the same as it always has except it renders values on the client. I hope this helps someone out.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using System.Security.Permissions;
namespace System.Web.UI.WebControls{
[AspNetHostingPermission(SecurityAction.InheritanceDemand,
Level = AspNetHostingPermissionLevel.Minimal),
AspNetHostingPermission(SecurityAction.LinkDemand,
Level = AspNetHostingPermissionLevel.Minimal),
ToolboxData("<{0}:WorkingCheckBoxList runat=\"server\" />")]
public class CheckBoxListWithClientValues : CheckBoxList
{
private CheckBox _controlToRepeat;
private bool _cachedIsEnabled;
private bool _cachedRegisterEnabled;
public CheckBoxListWithClientValues()
{
this._controlToRepeat = new CheckBox();
this._controlToRepeat.EnableViewState = false;
this._controlToRepeat.ID = "0";
this.Controls.Add(this._controlToRepeat);
}
protected override void RenderItem(ListItemType itemType,
int repeatIndex,
RepeatInfo repeatInfo,
System.Web.UI.HtmlTextWriter writer)
{
if (repeatIndex == 0)
{
this._cachedIsEnabled = base.IsEnabled;
this._cachedRegisterEnabled = ((this.Page != null) && base.IsEnabled);
}
ListItem item = this.Items[repeatIndex];
this._controlToRepeat.Attributes.Clear();
if (item.Attributes.Count > 0) //has attributes
{
foreach (string str in item.Attributes.Keys)
{
this._controlToRepeat.Attributes[str] = item.Attributes[str];
}
}
this._controlToRepeat.ID = repeatIndex.ToString(NumberFormatInfo.InvariantInfo);
this._controlToRepeat.Text = item.Text;
this._controlToRepeat.Checked = item.Selected;
this._controlToRepeat.EnableViewState = true;
this._controlToRepeat.Enabled = this._cachedIsEnabled && item.Enabled;
this._controlToRepeat.InputAttributes.Add("value", item.Value); //add the value attribute to be rendered
this._controlToRepeat.RenderControl(writer);
}
}
}
A side not here is that it still renders an HTML table just the same as it always has. Many argue that that is a bad idea, and an unordered list is better, I agree with the later, unordered lists are smaller, more managable, and how a list of anything should be rendered.
Tuesday, September 9, 2008
Thoughts on Chrome
Many writers are saying that with it's new found vulnerabilities, it will be hard pressed to take enterprise share away from Microsoft and it's browser, Internet Explorer. And even though many think that this may usher in a new browsing age, or more likely shake Microsoft up enough to get them adding long over due features and improvements to Internet Explorer. I as a developer see another browser that I must test my sites against for compatibility, even though it is based on WebKit.
I think the real problem is that many people are overlooking the entirety of what is really starting to happen. And that is web browsers are about to take a step forward on the evolutionary path towards a true framework. Things have gone on to long with expanding a design that was done quickly based on a standard for displaying documents. It was never intended to do what it currently can and most of the newer functionality was put in place quickly at a rapid pace based on the consumer demand and the developer need to meet those demands.
Chrome is a new design and a step towards the next generation of browsers. But it is still a browser, with lots of improvements. Tabs running in their own process space, add faster JavaScript, thanks to V8, hidden tile bar when maximized to take full advantage of desktop real estate. It's a beautiful piece of work.
So what is the future of Chrome and the Web Browser. I don't know, only time will tell. But I think we are about to see the next incarnation of the OS debates all over again.
Welcome to "The Browser Wars"
Friday, September 5, 2008
New Blog Layout
I will probably be going through and reformatting a number of my past posts to support the new layout, as I have built it to make my life as a writer easier, the previous template required alot of editing of fonts and paragraph re-structuring to look correct.
Anyhow enjoy the new layout.
Tuesday, September 2, 2008
Google gets its own web browser
Anyhow read the full article here.
Wednesday, August 13, 2008
WiFi on airplanes!
Millions of airline passengers soon will be able to log onto the Internet while in the air, as Delta Air Lines and other carriers launch a new service from Aircell, a small company that started as a maker of telephone systems for small general aviation planes and is now launching a Wi-Fi system for airlines.Read More...
When did Apple gain 200 pounds?
Apple chief executive Steve Jobs has confirmed that a mechanism exists within the iPhone to let the company unilaterally remove software from the smartphone." Read More ...
I mean that just isn't good, I can see some of the justification for such a mechanism, based on Steve Jobs comments of why it is there. But I think that it should be a user enabled feature. Like the MS Malicious Software removal tool, I can choose to let it install and run or not.
At any rate it will be interesting to see how it all plays out, as many people are pointing out the privacy concerns with this.
Thursday, June 19, 2008
Yahoo Email on IPhone
Finally I gave up and thats when I found the solution.
I jumped into my Yahoo mail via the iphone browser, logged in, and started reading my emails. Thats when I noticed a link saying "Get faster email on mobile" so I clicked it thinking this is going to tell me what I already know. To my surprise it said, "You can get yahoo push on your IPHONE" and then it gave me the same steps that I had already tried.
So I tried them again. Thinking well maybe they know that I have an iphone now. Sure enough it worked without a hitch this time around, and I have been in yahoo push mail heaven for a week now.
So I hope this helps the others out there that have been having problems getting this feature to work. Enjoy!
Wednesday, June 18, 2008
Back to life
Monday, August 15, 2005
Back to Basics .NET Part 1
What is .NET?
The official word from Microsoft is that
.NET is the Microsoft Web services strategy to connect information, people, systems, and devices through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions with Web services. .NET-connected solutions enable businesses to integrate their systems more rapidly and in a more agile manner and help them realize the promise of information anytime, anywhere, on any device.
But in simpler terms it is a Framework for building software solutions. Not just web services, though that is one of it's "sexy" features. It is a platform, much like your computer is, except this platform is software and not hardware, though it provides access to the hardware. Like a hardware platform you have a bunch of devices that can be used to build a computer system.
In .NET you have a bunch of objects, that are smaller pieces of software, that can be used to build a software system. By writing code you can make these objects (smaller pieces of software) interact with each other and solve problems. Thus producing a software system, also refered to as a solution, that runs on the platform, this platform being .NET.
There is alot more to the subject but you can go to the Microsoft framework website and read more about it on your own.
So lets get you started with a few links and items that you will need to run the samples and other materials that I will include during this series.
First I assume that you have a computer that is running some form of Microsoft Windows XP or greater.
Second go and download the .NET Framwork SDK ( Software Developers Kit).
Run the installation and look at the samples, and then come back here for the second part of the series.
Thursday, February 3, 2005
Articles I have written
As unfortunate as that was, I went looking for the final draft of that article, and was unable to find it. But I did stumble on one that I had started writing and was unable to complete, or as I like to say "I forgot I had written it."
So without further adue -
By Evan Freeman
March 22, 2004
If you were to ask most people in the field of computer programming what it is about their jobs that they like, you would be surprised by the answer. Most would answer “the weekends”. Here we have a common trend in today’s industry. However, this wasn’t always the case. One would have to believe that there was a time when the computer programmer was quite content with his or her job. I myself even remember when I found deep satisfaction in my job, and then there was light. So what has changed, what is the problem? Well they say that money is the root of all evil, and I have to say this is the case with today’s computer industry. As computers have become an avenue for improved capitalism, the business needs of the corporation have stifled the passion of the computer professional. I have to recount the days when I first started in this industry and the motto of my first real computer engineering company “never stop innovating!” This is what it meant to be a programmer. The computer industry at one time gave the true computer enthusiast a creative outlet that has been beaten down by business need over invention. Basically it has come down to someone does something just because it is cool and rather than receiving the praise that the individual would have in the past. They are met with “What is that for, it has no business need don’t do it again!” So the golden age of computer development is over, the mindset that led to all the great innovations in computers has been stifled like many things that have come before by capitalism. This does not mean that there is no innovation in the computer industry; it just means that it is not what it used to be. That being said it isn’t so surprising that many of the true “geeks” have found themselves drawn to open source as a means to express their creativity. I myself am involved in a number of open source initiatives mainly because I need the creative outlet and praise of my peers that I do not receive at work. Where I may see it as being viable, the limited intellect of today’s business professional who understands dollars and not technology would not see the light at the end of the tunnel that a truly creative innovation would have.
Monday, October 25, 2004
Breaking Intellisense with Resharper
ReSharper is an add-in for Microsoft Visual Studio .NET 2003™ that brings intelligent C# coding assistance, real-time error highlighting, and refactoring features to this popular development platform.
Recently I have seen a great deal of reports of this product breaking the intellisense in Visual Studio .NET 2003. So I thought I would list details on how to reenable it after you uninstall Resharp.
Now I'm not claiming there is anything wrong with the product, in truth I have never used it. I am just listing a solution to correcting a situation that is a result of installing and uninstalling this product.
To re-enable it goto Tools->Options->Text Editor->All Languages
On the right side of the window top section should be "Statement Completion" check "Autolist members" and "Parameter Info"
Tuesday, September 7, 2004
More offshoring news
Anyhow, I read an article today, by Stephen Swoyer "Who Benefits From Outsourcing?", that exposes another evil of offshoring. The article says that CEO's at leading pro-offshore companies are lining thier pockets with the savings from offshoring. The article basically shows that large companies are offshoring jobs and putting people out of work, just so the executives can make a few extra bucks in thier bonuses.
Though I have no real commentary other than,"how disgusting" I felt it blog worthy.