The Ubuntu Adventures Part 1

Operating Systems, Personal No Comments »

So it’s been a month since I have been running Unbuntu (Hardy) on one of my PCs at home. I just wanted to give a short overview of my experiences so far and some of the things that bug me.

Getting Started

Getting Ubunutu up and running is a snap. The nice installer pretty much takes care of everything. I only had to enter my routers DNS details and I was up and on the Internet, Firefox no less, in probably 20 minutes. Beats the pants off Windows in that respect.

System Updates

Another thing I like about Ubuntu is the updates. They download regularly and install fine in the background. I’ve lost count of the number of reformats I had to due because of bad updates for Windows.

A Bit Of Trouble

Beyond that I am still learning. I’ve installed a few games like FreeCiv and played with my video card settings but nothing too advanced and certainly not without a step-by-step guide telling me what to do.

The one major roadblock that I’ve encountered was trying to install a Jave/JSP development environment. I thought since I was free of Windows and didn’t have Call of Duty or Visual Studio to distract me that it would be a great opportunity to dive back into some Java development.

I installed Java, Tomcat, and Eclipse with no troubles and played around a bit. My problems started when I tried to install Web Tools for Eclipse. I used the update tool built into Eclipse since it seem like the most fool-proof way of getting it installed. The install went fine and evrything finished but when ever I create a web project, class, anything…I get SWT error messages and Eclipse shutsdown. Short story, Eclipse won’t create a web project and I am a little upset.

Not Done Yet

Despite this set back I am pushing forward and determined to become a comfortable everyday Linux user. With Vista a flop and no promise of things getting better I’ll have my XP box for a while still since I couldn’t give up Call of Duty or some of my other favorite games but that is about all it will get used for.

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

From Around The Net on August 22, 2008

News No Comments »

Here is a few stories of interest from around the Internet today.

Red Hat, Fedora Servers Compromised
“In an email sent to the fedora-announce mailing list, it has been revealed that both Fedora and Red Hat servers have been compromised. As a result Fedora is changing their package signing key. Red Hat has released a security advisory and a script to detect potentially compromised openssh packages.”

Mootools Bomberman
Munteanu Gabriel has produced a Bomberman clone using the Mootools javascript library.

Microsoft Hires Jerry Seinfeld
In a marketing ploy to turn Vistas bad reputation MS has brought Jerry Seinfeld on board in it’s $300 million PR blitz. Personally, I think the money would be better spent on development and actually fixing Vista instead of trying to convince people that it’s not so bad.

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

Cloud Computing. Why Aren’t You Using It?

Browsers, Operating Systems, Personal No Comments »

Cloud Computing. Why Aren't You Using It?

Photo by akakumo

It amazes me that not more businesses are adopting Cloud Computing. With things like GMail and Google Apps available for free and rivaling the expensive desktop suites like MS Office why not use them? There are many reasons why some businesses choose not to use online applications.

Privacy

This is a huge hurtle for advocates of computing in the cloud. Business just don’t trust a 3rd party to host their sensitive email and business documents. This is for good reason too. There is no way to know 100% for sure that someone is not looking thorugh private communications.

That being said for non business uses cloud computing is perfect for the average internet user. You get access to your email and documents from anywhere in the world at anytime as long as you have an Internet connection.

Reliability

A debate broke out on Slashdot yesterday, as often does, in response to an article posted about recent outages of Google Apps and GMail. The article speculated these outages hurting the adoption of online computing. Some commentors strongly disagreed.

As the debate hit upon different arguments and angles the main discussion centered around GMail versus MS Exchange and which was better and more reliable from a business point of view. There were strong opinions on both sides which got me thinking…there is no right answer. No matter which you choose there will be trade offs. It just depends on your specific needs.

Here is a nice list of pros and cons for each choose. You decide which fits your needs and budget best.

GMail Pros

  • FREE or just $50/user/year for premium accounts
  • 24/7 access from anywhere with an Internet connection
  • Solid reliability from Google’s enterprise data center
  • Platform independant
  • No overhead costs

GMail Cons

  • Must trust Google to respect and protect your privacy
  • No access if Internet is down, many fault points along the pipe

MS Exchange Pros

  • No 3rd party privacy concerns
  • More in control (or at least that is the illusion)
  • 24/7 web access (some minor limitations)
  • Access to stored emails and can send within network if Internet is down

MS Exchange Cons

  • Expensive Windows and Exchange license fees
  • Large overhead costs
    • Network administrator(s)
    • Servers and backup technology (data and power)
  • Dependant on Windows (some may not care)

I am sure I have missed some points on all those list but those are the basics. You decide what you need and what you can afford to compromise on (financially and personally).

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

An Unexpected But Flattering Request

Personal 1 Comment »

About a month ago I was contacted by a rep from Packt Publishing. Packt publishes a wide range of Internet and IT related books.

They had discovered by blog and asked if I would consider reviewing one of their books and post the review on my blog. I was a bit surprised but flattered at the same time. It wasn’t a very hard decision. Free book (I enjoy reading technical books), great content piece for my readers, and a chance to network with members of a publishing company…well, of course I’ll do it :D.

So I receive my complementary copy of Blogger: Beyond the Basics over the weekend and have done a quick overview of the book and have read chapter 1 in detail so far.

One of the things I wondered about while I waited for the book to arrive was what I would learn from the book. I ususally use WordPress for my blogs but have used Blogger on occasion. I was sure I would find some great gems about Blogger that I was unaware of.

After my first run through the book it is clear that is packed full of great content for using Blogger but it also has very valuable information of the mechanics of running a blog from setup, creating a plan for your blog’s marketing and goals, to how to customize every square pixel of Blogger to increase your success. This is a must read for anyone starting a blog or wanting to kick their blog into high gear.

I am looking forward to reading this book over the next couple of weeks, yes I read slow, and will be posting a detailed review of the book which I am sure you will enjoy.

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

Those Dang University Kids

Personal No Comments »

Normally I don’t do reviews because I don’t really care to read them on other blogs. So, that being said if you are like me you may want to stop reading now although I think you may be happy if you do decide to read this.

Before I go any further I just want to make it clear that this is NOT a paid review. I do stand to benefit from doing this review in indirect ways but I was not paid to write this and it is my honest opinion.

I have been reading Jason’s blog over at The University Kid for a while now and I won’t deny the fact that I fall into his category of the passive reader. I like to read his posts because they are amusing and full of great marketing ideas but I rarely ever comment or participate in the discussion. In fact, when Jason first mentioned he was releasing details of a new marketing system and all I had to do to get free access was write a blog post and mention his blog, I thought about it but ended up not doing it. Why? Usually when it comes to marketing systems I am a critic. However, Jason put out his last call to get free access so I decided to do a review because he has proved himself many times in the past with accurate information that has produced results.

That right there is pretty much my opinion of TUK. He offers great information and ideas in a fun way. That makes a big difference. He is brutally honest, giving away most of his ideas for free, which is a breath of fresh air from most marketing guys that are trying to squeeze every dollar out of you that they can.

If you are interested in learning some marketing tips or getting some ideas for some small projects I would highly recommend going on over to Jason’s entrepreneur blog, The University Kid.

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

The little ‘gotcha’ in LINQ to XML

ASP.Net 2 Comments »

Gotcha in LINQ to XML

I have been working with LINQ to XML for the last couple days working on importing some XML data into a database.

I have used LINQ before with very little effort which is why I decided to give it another go for this project.

I got my program all fleshed out and started writing the LINQ query. The XML file was very simple just a root element with a collection of children.

<root>
	<child />
	<child />
	<child />
	<child />
</root>

So when my query kept returning 0 elements I started to get frustrated. Why wasn’t it working? I pulled up the past project I had done using LINQ and compared the queries. They were identical from a syntax standpoint except the new query wasn’t returning anything.

After a few short Google searches I discovered it was because the new query was reading an XML file that was using namespaces.

<root xmlns="http://namespace.uri">
	<x:child xmlns:x="http://x.namespace.uri"/>
	<x:child />
	<x:child />
	<x:child />
</root>

In this case I was able to remove the namespaces as they were not needed and had been automatically add when I downloaded the file from SharePoint.

After removing the namespaces the query worked beautifully as I had originally expected it to.

The long and short of this is watch out for namespaces when you are writing queries for LINQ to XML.

I didn’t take the time to find a solution that left the namespaces in place because I didn’t really have the time to waste if it wasn’t necessary. If anyone can provide some advice or a solution I would appreciate it. Thanks.

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

Importing Assemblies Into C#

ASP.Net No Comments »

Sometimes it is necessary to use an assembly that was not created in .Net. This usually involves doing some low level things that are not native to C# or .Net and require you to import an existing assembly, perhaps a Win32 assembly, or to write your code in C++ and then import that into C#.

Let’s say for example you wanted to call the Win32 MessageBeep method to output an audible prompt to your user when they type something incorrectly. Yes, I know that would be annoying but this is just an example.

First we need to call the Win32 assembly with P/Invoke like this.

[DllImport("User32.dll")]
static extern Boolean MessageBeep(UInt32 beepType);

Now this imports the MessageBeep functionality so we can use it in C#. Now all you do is call it like a normal Method passing the beep type as a parameter.

MessageBeep(0);

It is that simple. P/Invoke gives use some nice flexibility to leverage existing Win32 API functions that may be missing from C# or reuse unmanaged code we have written for other projects.

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.

Unit testing, your greatest maintenance tool

Software Design 2 Comments »

Unit Testing, your greatest maintenance tool

Can I have transactions in Life 2.0?

I remember reading a cute cartoon a while back illustrating how nice it would be if real life let you have transactions. I remeber thinking at the time that it was a funny cartoon but didn’t give it much more thought.

Begin Transaction.

This morning I woke up and had a shower just like I do every morning. Afterwards I decided I needed to shave…but my shaver had gone dead. Plugs it in to recharge…oh well, I’ll just shave tomorrow. I am sure Visual Studio won’t mind my stubble for one day.

So I am ready to go with time to spare, what to do? I decide to boot up my old test machine and continue playing with Eclipse and Java; I may even have time to play a game of Risk. What’s this? BOOT DISK ERROR! Crap. Oh well, I’ll reformat the hard drive after work. Boot up my main PC and do some research for this article…yeah I should have been doing that anyways.

Time to go. Out to the car and hop in. Wow it sure rained a lot over night. BRRR BRRR BRRR. You’ve got to be kidding me! My car won’t start.

Rollback. Crap it didn’t work! Sigh. I call a tow truck instead.

Car analogy for unit tests

There are many times I wish real life could be maintained like a software program. In true SlashDot form I am going to try an make my case for Unit Testing with a car analogy (mind you probably a bad one).

To me writing software without writing unit tests is like me working on my car. I know the basics, change the oil, change the tires, and I can probably find my way around, eventually but when it gets down to the details I am scared to touch something because I don’t know what it will break. If I take part A off will I be able to put it back on and not break part B.

Making changes to untested code is much the same. You don’t really know what other parts of the program your changes are going to affect or ultimately break. That is why we end up with lots of redundant code and lots of repetition. Nobody wanted to risk breaking something by changing that method so they just created a new method that did basically the same thing. The end result is an API that is a mess.

A common argument against unit testing is that it takes extra time. This is true but if you stop to think about developing without unit tests for a moment you have to admit that unit tests will save you time in the long run. If you are not using unit tests how do you test your code? You fire up the UI and you input test data and check for the proper output. This process will take you far more time and will not clearly reveal any breaks code changes may have introduced.

With unit testing all this is fixed. You have a suite of tests that you can run and within a couple of minutes know with certainty that things are working as expected.

How do to write a unit test

It can be difficult to get started writing unit tests. Here are a couple of rules to help you get started on the right track.

1. Write the unit test first. What you want to do is write just enough logic (classes and interfaces) to let your code compile. This will force you to look at your code differently. Each piece of code will have a goal and the unit test will check to see if that goal is met or that it is handled properly if the goal is not met.

2. Keep your code loosely coupled. In order to properly, and easily, test your code it needs to be loosely coupled. This means you want to avoid writing methods and classes that depend on other methods and classes. There will be a certain amount of coupling but you want to keep it to a minimum. For example, you’ll obviously want to test your data access layer to ensure it is communicating with your database correctly. However, once you start testing the layer that talks to your data access layer you will want to simulate your data layer instead of actually using it. This is were Dependency Injection comes into play. We will be talking about this in a future post.

[TestFixture]
public class ExampleTests {
	[Test]
	public void GetEmployeesTest() {
		Company comapny = new Company(new FakeDataAccess());
		Assert.IsTrue(company.GetEmployees().Length > 0);
	}
}

public class Company {
	private IDataAccess dataAccess;
	//default data access layer
	public Company() : this(new RealDataAccess()) { }

	//allow dependancy injection of
	//desired data access layer
	public Company(IDataAccess dataAccess) {
		this.dataAccess = dataAccess;
	}

	public Employee [] GetEmployees() {
		return dataAccess.GetEmployees();
	}
}

public class FakeDataAccess : IDataAccess {
	public FakeDataAccess() { }

	public Employee [] GetEmployees() {
		Employee [] employees = new Employee [] {
			new Employee("Bob", "Hudson", "Accounting"),
			new Employee("Jim", "Dunn", "Accounting"),
			new Employee("Mark", "Johnson", "Accounting"),
			new Employee("Bill", "Parson", "Accounting")
		};
		return employees;
	}
}

This test may seem pointless but remember your real Data Access layer is also properly tested and this test is making sure your Company class is interacting with the Data Access Layer properly. This is a fairly obvious example but it illustrates the point I am trying to make.

Hopefully this gives you a taste of Unit Testing and helps get you started.

kick it on DotNetKicks.com

Did you like this post? Be sure to grab my RSS feed so you don't miss out on more great articles.
WP Theme & Icons by N.Design Studio
Entries RSS Login