Categories
Geeky/Programming Product Reviews

Living Virtually: Running your Dev Process on Virtual Machines

Virtual Machines have been around for years. VMWare and Microsoft have been the main competitors for a while, both offering somewhat similar products. Parallels for Mac is another, and Virtual Box for pretty much everything. I have used them all. When it comes right down to it, VMWare, to me, is ahead of the rest, so I am going to focus on that. Heck, I did a P2V (Physical to Virtual) on my girlfriends wacked out laptop and that is working great, 2 months later 🙂

What is a typical scenario for most people? They go buy a machine, set it up, use it. It works great. It crashes or gets hosed. They lose most if not everything, spend a week redoing the machine and start the process over. This goes on for a few years, then they get a new machine, and start the cycle over

But…

What if you thought “virtually”? So, you go buy (or build) your beefy development machine. But then didn’t install anything but Windows Updates (of course), and VMWare Workstation. Now granted your want your physical box to have 8, 12, or 16 GB of RAM, and loads of fast disk space, but yeah, just need to have a beefy machine.

Now, you set up your actual dev machine as a virtual machine, you give it 8 GB of RAM. You install the OS, and take a snapshot (In VMWare). You install VS2010, take a snapshot. You install SQL Server 2008 R2 Dev, snapshot. You install each browser you need to test with, snapshot, snapshot, snapshot. You get the idea.

Now, if something is totally wacked, you can revert to a snapshot. You can even have multiple paths of snapshots, this type of thing is very VERY cool if you get it going correctly.

You can also just grab the entire VM hard disk and settings and copy off to your trusty 2 TB USB drive or whatever and you can do this once a week and you have a complete backup of your dev machine.

You can then set up another VM, say, “Web Server” or whatever you desire, give it 2 GB or whatever it needs to run, do the same thing. You can have both running, and do your testing. You can create a separate SQL Machine for testing. Try to set up your environment as you would for your development. If you need an Active Directory? Set that up, set up 3 VM’s or whatever, you don’t need to have them all running all the time. You need Exchange? Or SharePoint? Same thing. You have a Technet or MSDN Subscription, right? No? Go get one NOW.

What is even better then best, is that 3 years later, when you get an even better machine, you know what? You just install VMWorkstation, and copy or locate your VM’s and you are set. No resetting things up, etc, etc. It just works.

You want to create a smaller dev VM for holiday travel? Take it on USB, use Mom’s PC with VMWare Player and give your VM 1 GB of RAM. You just need enough to get by on. No laptop needed, just bring up your USB. You get the idea.. you can do pretty much anything you’d like.

If a salesperson came up to you and said “I have a way for you to configure multiple environments, multiple computers, setups, and have ways to revert back to things you did while configuring, and take backups of everything easily, etc, etc” How much would you pay? $1k? $5k? More?

How about roughly $200, for VMWare Workstation (if you already have Technet/MSDN – which you would have already). I’m sold.

If you really want to get complicated, you can set up VM Farms, and run VMWare Servers, and have multiple VM’s going and easily accessible. But using VMWorkstation to start is good enough, and good enough is fine 🙂


Categories
Geeky/Programming

Facebook Graph API – Getting Friends and Gender in C#

I recently blogged about the Facebook Graph API and if you have the Facebook C# SDK you can start making applications.

After I had my Facebook app set up, I started making a C# Console application to just get my friends and see what I could do. Here is a snippet to get my friends and their gender.

       string token = ;

            Facebook.FacebookAPI api = new Facebook.FacebookAPI(token);

            JSONObject f = api.Get("/me/friends");

            KeyValuePair friends = f.Dictionary.ElementAt(0);


            for (int i = 0; i < friends.Value.Array.Count(); i++)
            {

                Console.WriteLine("Friend #" + i.ToString());

                JSONObject friend = api.Get("/" + friends.Value.Array[i].Dictionary["id"].String);

                Console.WriteLine(friend.Dictionary["name"].String);

                try
                {
                    Console.WriteLine(friend.Dictionary["gender"].String);
                }
                catch(System.Collections.Generic.KeyNotFoundException knfe)
                {
                    Console.WriteLine("No Gender Specified");
                }

                Console.WriteLine();
            }


            Console.ReadLine();

There is a probably a better way to do this, but getting the JSONObject back and then getting the values you get back from that, I just kind of brute forced it. Also, handling friends that don’t have information set, the quick and dirty way was to just catch the exception. I know there has to be a better way but for now it works.

Categories
Business Intelligence Geeky/Programming

OData is the New Hotness

Not sure why I didn’t look into this sooner. OData. Open Data Protocol.

Not many providers, but this has huge potential. First off, PowerPivot can consume OData feeds! See the “From Data Feeds” button 🙂

I used it to download Netflix’s whole library. I tried to download StackOverflow’s data (http://odata.stackexchange.com/) but had no luck. Either got errors or it was taking forEVER!

But, you can see how easy it is to create an OData API for your data? Scott Hanselman did it for StackOverlfow in 30 minutes. This opens up HUGE oppourtunities for apps and ISV’s to expose their data out for end user and other developer consumption.

You can see all the “producers” here: http://www.odata.org/producers .. I am sure there are more, just not on the list.

What a cool easy way to expose your data as an “API” out there.. Excited to see how it is used (Pivot Viewer, Power Pivot, etc) and what people do with it.

Categories
Geeky/Programming Product Reviews Ramblings

One Thing About the iPhone 4..

I still love it. Like I said, I don’t use it as a phone. But I have noticed something different (And I blame AT&T for this – working for cell phone company for 5 years, I blame the carrier :))

In Madison/Sun Prairie, I get 3G ,works great, no issues. When I drive out to work, in the big city of Waterloo, WI – there is no 3G, just Edge/2G. I noticed that the phone is just “Searching..” or low bars – trying VERY hard to connect.

What I did was turn off 3G and it was at FULL bars. So once I get to work, I turn off 3G, and once I leave, I turn it back on.

What it is, the phone is hanging on to the 3G signal from the big town of Sun Prairie, and tries, tries, tries its hardest to hold on to that. Bad handoffs or something. The cell sites aren’t handing it off gracefully to the Edge/2G network, so I have to force it.

Go figure.

Categories
Geeky/Programming

Fun with the Facebook Graph API

Lazy Sunday afternoon, so I decided to dig a bit into the Facebook Graph API. What is the FB Graph API? Well it allows you to create an application and use OAuth to connect and then get information about yourself and your friends and do things in Facebook using JSON objects and requests. Easy way to read/write from Facebook.

But, the kicker seems to be getting things started. To start, Facebook has documentation and links and wikis all over the place, so it is hard to get a handle on what you want or need to do.

First you need to create an application. Once you do that you need to set up some things so you can actually use Facebook data.

Once you have that done, you can see your apps here

You will want to take note of a few things and change some settings..First might be to put your app in “sandbox” mode:

Also, under “Authentication” you might want to change Authentication Callback URLs.. and then under “Connect” change your “Connect URL”, and you want it in form http://blah.com/

So to test your app and see what you can do, you need to know your

ApplicationId
API Key
Secret

now, you can make unauthenticated calls to the Graph API, try it..

https://graph.facebook.com/56011561

That’s me. You should be able to see public info on me (don’t try it in IE, it pukes.. Chrome it was working. You might need to be logged into FB)

Anyways, if you want your app to be able to get more than the “public” unauthorized view, you need to make some calls and get some access tokens..

First you need to get an “access code”

https://graph.facebook.com/oauth/authorize?client_id=&redirect_uri=&scope=user_photos,email,user_birthday,user_online_presence,offline_access,friends_birthday,friends_education_history,friends_hometown,friends_location,friends_relationships,friends_religion_politics,friends_likes,friends_interests,friends_groups

You can see in that URL, you have to supply your app id, and your redirect url. Keep it simple, your redirect url should be something like http://blah.com/ .. don’t have querystring params..

If you have things set up, facebook should authenticate you, and ask you to allow your app to have permissions to pretty much “EVERYTHING” on your profile and friends info. To see what “extended permissions” you can use, see here: http://developers.facebook.com/docs/authentication/permissions

You *should* get redirect to your redirect_url with a param in the url called code=

Grab that code, you will need it.

Now to get the access_token

https://graph.facebook.com/oauth/access_token?client_id=&redirect_uri=&client_secret=&code=

once you hit the above URL, with the code from step one you will get an access token

take that token, and then try

https://graph.facebook.com/me?access_token=

you can also get your friends ids

https://graph.facebook.com/me/friends?access_token=

Once you get your friends list, you can use their id's and get info back from the graph.

If you get errors or did something wrong, you might have screwed up your first requests. There are sites and forums saying to add type=client_cred - don't do that, it doesn't work. It will give you a shorter access token, which doesn't work.

Once you have all that working *MANUALLY*, then check out Facebook's officall C# sdk for the graph - http://github.com/facebook/csharp-sdk

Basically then you can replace the access token there with your token and test things.

Then just tie it all together in an app so you can do it programatically, but that is for another blog post 🙂

Categories
Business Intelligence Geeky/Programming Reviews

Microsoft Live Labs Pivot Viewer – Rich Internet Application

So, I previously blogged about using PivotViewer in your Web Applications, but you can also just consume Pivot collections using the “Pivot” tool from Microsoft Live Labs

You can download it here

What does this tool offer? Well first it has a library/homepage of collections you can browse

You can do some slicing and dicing on a collection of Presidents, or athletes, or Sports Illustrated covers. This tool and technology really fasinates me. It is “Business Intelligence” but in a different way – it is based on “objects” (images) instead of “metrics”. I like it.

What are some cool things I think this could be used for? Company Directory? Online Catalog? Beer selection at Eddie’s? the list goes on and on..

Additionally there is now an add in for SQL Server Reporting Services and SharePoint 2010 you can download here

Once I have an environment in which I can test that set up, I will blog about it.

Categories
Geeky/Programming Product Reviews

Thoughts on the iPhone 4

I picked up my iPhone 4 on Friday afternoon (July 16th). Wonderful device. Retina display is awesome. Video camera, front facing camera, flash: awesome.

People wonder about the dropped calls, etc. Whatever. First, I may be different. I haven’t even USED the phone yet. I don’t really use the iPhone as a phone. Personal Handheld Online News Entertainment ? Who knows.. I use it for everything but a phone. Maps, Reading, Feeds, Twitter, Facebook, News, Movies, Games, Work, Email, etc, etc, etc. It isn’t a phone. 🙂

Any ways, Steve Jobs already told us that we are getting bumpers, I might use it.

This device is the best out there, by far. Most gripes might be with AT&T, not Apple. Like others have said, build a better device, and then we will see. I don’t see it yet. I have tried other devices and they just aren’t as smooth.

I can’t wait for Emily to get hers so we can do the FaceTime thing, that will really be awesome.


Categories
Business Intelligence Geeky/Programming

Microsoft Silverlight PivotViewer: Getting Started and Business Case

I have been reading about Microsoft’s PivotViewer lately, and decided to try to get it going for myself. What is PivotViewer? Think of it as visual data slicing through a web page.

What you do is take some data, and then tie records to images, and then publish out your “collection” and you can consume it via a webpage using the Silverlight PivotViewer control. One awesome example of this is here http://netflixpivot.cloudapp.net/. But what I have been really trying to wrap my head around is how to use the as a “business” tool. Because, it is easily technically doable, but you have to have a *reason* to do it.

Working with widgets and customers and locations – what do you do? There are two things I could think of quickly. One – peruse your “master data” very fast and visually. The other is looking at some kind of metrics for your widgets, or logos of your customers you might sell too, or ? ..Well, you could..

  • Master Data/Catalog
  • Show pictures of your widgets, and create filters (they call them facets) for things like size, color, weight, model, etc. You have “one” of each and you just want to see what you offer. Almost could be a pretty sweet online catalog browser

  • Sales/Metrics
  • Do the same as a master data catalog but allow filtering by some kind of metric. Shipped items over a given time or something.

  • Something Else I Haven’t Thought Of?

Anyways, the first thing you should do before anything is get some kind of data feed. Run a query, get some data from somewhere. Start small to test. 500-1000 records.

Then the fun begins. Starting from absolute scratch..

Ok, yeah, tons of setup. Biggest thing is in IIS you need to set some MIME types: .cxml, .dzi and .dzc need to be “text/xml”

Once you have all that setup, you can do 2 things.. create your collection, and create your app. Create a blank silverlight project first:

Once you have that, there isn’t a ton you have to do to get things going with PivotViewer.

  1. MainPage.xaml
  2. Add in your MainPage.xaml, a namespace line for Pivot, and add the control

    Your end MainPage.xaml should look like this:

    
    
    
    
    
    
    
    
    
  3. Reference Assemblies
  4. For good measure, just reference them all, located here: C:Program FilesMicrosoft SDKsSilverlightv4.0PivotViewerJun10Bin

  5. Load Collection:
  6. pvWidgets.LoadCollection("http://localhost/SilverlightApplication1.Web/MyWidgets.cxml", null);
    

Note, you have to make your web part of your project IIS based instead of the build in web browser. Why? Because the .cxml HAS to be hosted on a web server, it just works that way.

Now, you need to create your collection.. you can use a cmd line tool they offer on the PivotViewer site, they also have a c# library for automating things, but it is best to first just do it manually. So I used the tool they have as an add on for excel. It adds a nice little “Pivot Collections” tab

You can use this to put some data in, you probably want to add more columns than what they give you by default. For my test I just used the same image for all records to get started. I have a feeling that the biggest barrier to entry to corporate BI teams and developers is going to be the imagery. You usually don’t have someone on your BI Team that knows how to use photoshop well and do all the high res imagery, so you are handcuffed there.

For testing sake, I Published my collection to the root of my website, with the name “MyWidgets”.

I loaded up my webpage, and I can slice and dice by all my columns I had in my collection, visually.. pretty dang awesome. (Note, I just made some fake data based on attributes I am used to seeing and with an image of a bike to see what it would look like – the goal was figuring out how would this work in conjunction with current BI offerings (cubes/Pivot Tables, SSRS, PowerPivot, etc))

Now, if you think where you could take this. Each “image” is clickable and brings up the image right in front of you. You could have all the specs of that widget there, and a link to “buy”, or deeper analytics for that widget.

Some other things I found out.. using the Excel tool for Pivot Collections is dog slow. Especially with a ton of records. It has to process the images for the “deep zoom” technology and it just takes a while. Like, hours.

There are tons of possibilities here with PivotViewer, both for an external website and also internal corporate business intelligence. It will give people another way to delve into the data and turn it into information.

Categories
Agile Geeky/Programming

Extreme Pair/Group Programming – The “Hive Mind”

Recently there have been a couple of bigger development/programming issues that have needed to get resolved where time was of the essence, and some kind of “short cut” was needed. Bring in the “Hive Mind”.

In Agile, there is Scrum, and XP .. pair programming. But what if you bring in 5-6 developers, put code up on the screen and say “help me”. The informal results I have seen are astounding.

What can result is in 10-15 minutes you have a problem solved, and everyone aware of the issue or code surrounding the issue.

Now, not to say you want to do this for every situation, but in some cases it can work wonders. I’d also want to note that the results I have seen could be unique – as always, your mileage may vary.

But the Hive Mind really does bring to light the power of many heads working together to collaborate and come up with a solution quickly. Very cool.

As usual though – pretty much common sense – more open communication and information sharing leads to a better result.

Categories
Geeky/Programming

Application Shortcuts in Google Chrome – Awesome!

I use Google Chrome as my primary browser in Windows (it is blazingly fast and minimal). (I use Safari on my Mac’s) .. one awesome thing I have started to utilize is Application Shortcuts in Windows 7 and pinning them to the taskbar..

Which are apps and which are just browser app shortcuts? Pretty sweet. I set up Google Apps (Gmail), Reader and Unfuddle as my shortcuts and I love the one window no hassle that comes along with it, allows you to focus on the app instead of the browser/tabs. Pretty nice feature.