Wednesday, February 28, 2007

The Greatest Thing Ever!

This picture pretty much sums it up :)

Have you ever wanted to be able to do everything you ever wanted on just one computer, without the need for reboots, special setups, or very hindered performance? Well now you can!

In my professional life I'm a windows kinda guy, I go to work, I log into a windows domain, I develop in c# and Visual Studio. In my personal life I'm an Apple kind of a guy, I love the stability and easy to use applications, the BSD core, etc.

Well sometimes when I'm at home I want to be able to do some c# coding. Yes I could use Mono, but the IDE options are sparse, or require a lot of setup, and I can't use a lot of the new features in .NET 3. I originally used Parallels but hated being limited to one screen, hard to use USB devices etc. I eventually switched to Boot Camp and Vista, but Vista has a whole slew of issues with VS2005 and little support for WPF in Orcas, AND I also had to reboot. I had my iTunes and stuff in OS X and didn't want to duplicate stuff so I wasn't 100% happy.... yet. Well last night I noticed that Parallels had posted a new release. WOW! They have made some huge improvements. First off my favorite new thing, Coherence. To enable this just load up Parallels and select 'View' - 'Coherence' and BAM! done. Your desktop now has both the Windows task bar AND the Apple app launcher! How hot is that! Well like I had said before I really didn't like being limited to one monitor with Parallels. Well it just got better. If you go back to Parallels and select 'View' - 'Customize' you'll notice my other favorite new feature, a little option that says 'Use multiple desktops'. No I can drag applications (Both Windows and OS X) back and forth between my monitors.

So now I'm very happy! When I'm at home I can have my Visual Studio up on one monitor along with iTunes, and my browsers (Safari, Firefox, IE) on my other monitor. AND If I really wanted to I can boot up my Boot Camp OS using Parallels, so there is absolutely no need to reboot anymore!

Tuesday, February 13, 2007

It made me giggle a little

Maybe I was tired, or my brain was a little wrecked, but I was doing a little surfing last night and this blog made me smile a bit. I just love all the "sucks" in there HA!

Sunday, February 11, 2007

WPF/E - getting started

WPF/E is one of Microsofts latest "Hot" things. It's used to create very rich, cross-platfrom, interactive web applications.

It's fairly easy to get this working. Here's some things you'll need

Windows XP / Vista with .NET 3.0

Visual Studio 2005 (Orcas 'JAN CTP' does not work with WPF)

WPF/E SDK

Once you have these you're pretty much ready to go. The WPF/E SDK will install the template for VS2005. Now there are two ways to start playing around with this. The first is to open up VS and create a new project. ***Make sure you don't select New Web Site unless you follow the article mentioned below, just click the new project. Under the 'My Templates' section you see "WPF/E Javascript Application". This creates a web site with no aspx files, just straight up html,javascript, and XAML.

I could go into how to setup a web site with good old aspx files, but the information is already out there.. You can find it in this good article.

Hopefully I can get some better posts up about WPF in the near future (I'm just green on this technology right now :) )

Stay Tuned!

Crystal Reports Madness (Setter Exception)

Ran accross this fun little issue with a report that sets a Group condition...

We had some code like this:

Group group = report.DataDefinition.Groups[4];
group.GroupOptions.Condition = condition;

We used this to set a DateTimeCondition property of one of our reports. But everytime it hit this code an exception was thrown :(.


After spending a fair amount of time trying to track down a solution to this problem we found it to be an issue with the Setter for this object.


We changed our code to this and all is well again.

Group group = report.DataDefinition.Groups[4];
try {
group.GroupOptions.Condition = condition;
}
catch { }
group.GroupOptions.Condition = condition;

Basically we let it exception once, and don't handle it, and then set the property again. For some reason it always exceptions on the first attempt, but then sets the property fine the second time.


We found this solution by changing this value at runtime using the VS debugger. It would change the value fine at runtime if we modified the value in the watch window, but if we let it just try and pass through without manually changing the value then it would exception. If we manually changed the value and then stepped over the code, then it would work??



This is a strange one.

Crystal Reports Madness (Formulas / Datasets)

"There must be a group that matches this field."

I recently was given the task at work to get a bunch of crystal reports working from a win32 application, that we inherited, to our new web app version. I had never done anything with Crystal Reports before so I wasn't sure what I was getting myself into.

Crystal Reports ended up being pretty straightforward and easy to figure out, but that wasn't the hard part. The current reports we had connected directly with the database to get the information they needed. We didn't really like this 'pull' model for a couple reasons.

1 - The current application only connected to Oracle. The new web application was not DB specific.

2 - Didn't really like the idea of having the credentials stored within each report file.

3 - Changing DataSets was a pain, and had caused problems with the report files themselves in the past.

So we decided to implement the 'push' modal.

(Push / Pull explained here...)

This seemed pretty straight forward. We created XSD's for each report, and then changed the datasource location in the report file using VS2005.

Well... This ended up not working It wasn't until I stumbled accross some very sparse information on the web explaining that it's best to disconnect the report from the DB and THEN change the DS location. This finally ended up working for us (Task 1 DONE!)

The next issue was that we changed some of the report paramater names to make more sense. I figured this wouldn't be much of a problem, but boy was I wrong. When I saved the report I received multiple complaints from the report. Most of which were due to some of the report formulas. I loaded up a few of these formulas and received this error when I tried to save them

"There must be a group that matches this field."

I searched the web trying to figure out what it wanted, but I mostly stumbled accross web sites only offering training, actual documentation was kinda sparse, or not really that great.

Basically the solution boils down to this.

Our formulas group options were being set dynamically in code behind, so this condition wasn't in the original formulas which caused the error. The weird thing is that they had worked before we changed the dataSets, now we had to set it (we set it to 'for each month') but it would then be changed when the report was run dynamically. hmmm

The 'Average' function follows these signatures

Average(field), or Average(field, condFld), or Average(field, condFld, cond), or Average(x).

The third param 'cond' had to be set to match it's corresponding groups grouping. Now if you go to the group on the report, right click, and go to 'group expert' you can view/change the grouping (Monthly, Annually, etc) but in the formula it's not so clear as what to use. I looked in the actual CR documentation and they actually refer to the wrong thing to use for this (Many peoples posts, blogs etc had complained about CR's documentation) I stumbled accross the correct value to use and the reports save fine now, and also work, even though it's just dummy data that is changed at run time >(

Oh well... I hope this may help some poor sould out there

Crystal Reports Madness (Orcas)

I sat down today to write a blog on some information about Crystal Reports. Little did I know this would turn into 2 blogs.

I downloaded Vista Ultimate from good old MSDN a few months back and everything was working great with it. I had installed Visual Studio 2005 and was able to do some development for work, which HAD worked great. Up until a few weeks ago I hadn't had to many issues with Vista (Except for the Cisco VPN client, which doesn't work with the released version of Vista). Now some of the issues are starting to bleed through. VS2005 crashes, OFTEN, which led me to install the new Orcas (Jan CTP). This worked much better than 2005 so far, minues the WPF support :(

So leading back into the topic of this blog, I loaded up Orcas and opened my work project. I went in and double clicked a report file to refresh me on what I was going to blog about AND..... I got a straight up HEX view of the report! Apparantly that too doesn't work with Orcas... So back to 2005 I go hoping I don't make it mad enought to crash :)

Thursday, February 08, 2007

Protected Internal??

So I was writing some code today that I thought was great! I went to show my Buddy and he pointed one thing out to me. I had a few methods in a base class marked as protected internal. He told me "I don't think that's doing what you think it's doing". I was thinking that these methods would only be accessible to inherited members AND members within the same assembly. I guess I just made the assumption since public static marks the member as both available to all AND a non instance member.

Anyways I decided to take a look at the good old msdn site to see exactly what it says. Basically this says it all "only derived types or types within the same assembly can access that member". Notice the keyword "OR" in there. So my members were either available to inherited members OR members within the same assembly....

But this is not what I wanted.. I wanted what it sounded like! a member that was available ONLY to inherited AND same assembly members! So the quick solution to this was to just mark my class as Internal and it's members Protected.

ex.

internal class SameAssemblyClass {
protected void InheritedMethod() { }
}

Monday, February 05, 2007

Orcas, Vista, Linq, WPF, XNA ????

So a buddy and I have been wanting to play around with some of the very new and exciting upcoming technologies from Microsoft, well I guess Vista is officially out now. We didn't do a whole lot of research when we began this endeavor, I guess we were just a little excited. So here is the lowdown :)

Vista comes with the new .net 3.5 framework so this was good since Linq and WPF use it. Orcas is the new Visual Studio that will be used to take advantage of all of these new features, so this should be good. Well...... maybe :(

Orcas (Jan CTP) installed without a hitch, and seemed to work pretty good. The first thing we tried to do was play around with Linq. We found the '101 samples' website for Linq and started writing some queries. This was a 'no-go', VS didn't seem to like the syntax. We started to think 'What gives!' so we began our Google searches. Apparently you need to reference the 'System.Core.dll' which is found 'Windows\Microsoft.NET\Framework\v3.5\'.. Whoa.. you think this would be a little more straight-forward since this is a new feature that showcases the new .NET 3 and Orcas. Anyways after some looking around we got it working. It's pretty neat to say the least!

Next was WPF. Orcas didn't come pre-loaded with a WPF template? hmmm. 'Okay there must be a plugin' we thought. The only plugin we could find was for VS2005! This was no good, we wanted to use the new Orcas and the new WPF to write some new applications! Oh well, guess we'll be waiting on that one AND using 2005 for development, bummer.

Last but not least was XNA, surely this must work I mean it's a release version now and VS2005 kinda works with Vista(keep reading for this). Well you still have to have VS2005 Express to use XNA Game Studio Express. So we got this installed and then XNA. Went to load up a pacman style game we've been working on and...... NOTHING! Come to find out, after some more Googling, XNA does NOT work with Vista, double bummer.

Oh and the VS2005 kinda working with Vista well... Even with the SP1 for VS2005, it still has issues. It consistantly crashes at random times, among other small issues. So I guess if you want to play around with WPF, XNA Linq and many of the other new features coming out I would stick with XP and VS2005 for a while, atleast until they get some of this worked out... So I guess we'll revisit this in a couple months ;)

Friday, February 02, 2007

Google Math. How high can you go¿?

Sitting around the office the other day me and 2 of my buddies were talking about regular geek stuff. I brought up the whole 'Can you fold a piece of paper in half more than 7 times' debate. I watched the Mythbusters episode about it the night before. This eventually led to a discussion about Fibonacci. Which then led to a further debate on what the highest number you could achieve using Google.

 

Can you beat this number??