Using HTML5 Web Storage in ASP.NET

January 25th, 2012 by Don No comments »

This article does a great job at showing you a simple example of how to use local browser web storage in conjunction with ASP.NET web methods to save and retrieve the data from a server side database.  Even if you aren’t interested in using this functionality in an application you have now, it’s worth reading to know what HTML5 brings to the table as far as storing your data down at the client.

How to enable TRIM On Your Mac SSD to Prolong the Life Span

January 16th, 2012 by Don No comments »

I added an SSD drive to my Macbook Pro a few months ago and was amazed at the performance boost I got from it.  I had read before how an SSD truly is one of the best things you can do to truly see big performance gains but I had no idea how much until I did it.  Man, it made my already fast Macbook Pro even faster.  The boot time is amazing and opening even a bulky application like Photoshop is almost instant.

Since I didn’t order my SSD from Apple it didn’t come with the ability for OS X to enable TRIM for the drive.  And as you’ll see in the previous link, if you’re using an SSD you really need to be using TRIM.  Luckily I recently came across this article that told me everything I needed to do to use TRIM in OS X.  Thanks to the free utility Trim Enabler 2.0, it was easy and my SSD now should last a lot longer.

If you’re in the same situation as me, definitely check it out!

Filter all incoming mail in Gmail to multiple recipients, including BCC messages

September 21st, 2011 by Don 1 comment »

Now that our kids are in school my wife and I wanted to setup a family email account that we could give to our children’s teachers that would forward to both of our private email addresses. In Gmail you have the option to forward all incoming mail to 1 account easily. That however didn’t work for us because we both wanted to get copies of the incoming mail.

As you’ll see when you visit the forwarding options you can also use filters to forward mail.  Based on my needs I went that route and had things setup to forward to me and my wife, and THOUGHT we were receiving all of the messages properly.  But later after chatting with other moms in the class realized the filter wasn’t picking up on messages from one of our teachers because they were putting us as BCC (blind carbon copy) recipients.  Our other teacher (I have twins, so both started kindergarten at the same time) however was sending messages to everybody simply in the To field, which we were receiving without any problems.  After some research I learned that Gmail doesn’t make it very obvious how to filter on a message when you’re only a BCC recipient.  So after some research and trial and error I figured it out and here’s how you can do it.

Step 1 – Open up your settings in Gmail in the account you want to forward mail from.  From there, choose the Forwarding and POP/IMAP tab.  Under forwarding, you will see a box to Add a forwarding address.

Step 2 – Enter in the address you want to forward mail to and click next.  Gmail will send a verification code to that email address to ensure that you are an owner of that account. Once you receive the email containing the code, enter it into the confirmation code box and click Verify.

Step 3 – Once you have verified the destination address, click on the Filters tab and click Create a new filter.  We are now going to enter the specific details to ensure all mail, including messages you are BCC recipients on get sent to the address we just added.  When the Create a Filter wizard comes up we want to enter deliveredto:youraddress@gmail.com in the textbox labeled Has the words.  This is the important part, and something I didn’t realize when I first setup a filter with only my account in the To field.  That won’t get BCC messages.  Again, you are putting the address of the account you want to forward from (i.e. familyaccount@gmail.com).

Step 4 – Select the Mark as read checkbox and the Forward it to checkbox.  To the right of the Forward it to checkbox you will see the email account you verified in Step 2 as an option.  Make sure it’s selected and click Create Filter.

Step 5 – Now you’re done.  You can repeat this for any additional addresses you want to forward mail to.  I do believe I read somewhere that Gmail has a limit of like 10 or 20 addresses that you can forward to, so keep that in mind if you are trying to do more than just a few.

Now you have a stand along family or shared email account that forwards ALL messages to one or more recipients.  The nice thing about this is that Gmail offers you so much storage that you also have an archive of all these messages that you can go back and search on over time.  Heck, maybe someday it will be fun for us to look back at the first emails we were getting when our kids started kindergarten.

Hope this helps!  Contact me if you have any problems and I’ll try to help you out.

 

 

 

 

Get the root part of a domain in .NET

September 16th, 2011 by Don 2 comments »

Need to get the .com, .us, .biz, etc. part of the domain name in .NET?

Here’s how:

Dim root As String
root = Right(Request.Url.Host, (Request.Url.Host.Length) - InStrRev(Request.Url.Host, "."))

Visual Studio 2010 Code Metrics Viewer

June 29th, 2011 by Don No comments »

What is Code Metrics Viewer? – Matthias Friedrich highlights his Visual Studio 2010 Code Metrics Viewer extension which plugs into VS 2010 Professional and uses the Code Metrics Power Tool to provide code metrics information to the IDE. Matthias is blogging a number of posts on this project blog which look at the various features of the viewer and I encourage you to check those other posts out too.

Ajax-based data loading using jQuery in ASP.NET

June 28th, 2011 by Don No comments »

Great article to check out!

Ajax-based data loading using jQuery.load() function in ASP.NET – Hajan Selmani takes a back to basics look at using jQuery to load partial chunks of HTML from a page using Ajax and insert them into the current page, providing a nice way of lighting up a web application with an ‘Ajax’ feel whilst easily maintaining non-ajax support.

The Microsoft Kinect SDK has arrived!

June 17th, 2011 by Don No comments »

The official Microsoft Kinect SDK beta is now out and available for download! Covered by Channel Nine Live Media, Microsoft Scientist Anoop Gupta made the announcement himself that after the long wait, users may now go to the official SDK website to download the latest software development kit for the Kinect camera.

Here are the features that will come with the Kinect SDK (taken from Microsoft SDK website):

“The Kinect for Windows SDK beta is a programming toolkit for application developers. It enables the academic and enthusiast communities easy access to the capabilities offered by the Microsoft Kinect device connected to computers running the Windows 7 operating system.

The Kinect for Windows SDK beta includes drivers, rich APIs for raw sensor streams and human motion tracking, installation documents, and resource materials. It provides Kinect capabilities to developers who build applications with C++, C#, or Visual Basic by using Microsoft Visual Studio 2010.

Raw sensor streams

Access to raw data streams from the depth sensor, color camera sensor, and four-element microphone array enables developers to build upon the low-level streams that are generated by the Kinect sensor.

Skeletal tracking

The capability to track the skeleton image of one or two people moving within the Kinect field of view make it easy to create gesture-driven applications.

Advanced audio capabilities

Audio processing capabilities include sophisticated acoustic noise suppression and echo cancellation, beam formation to identify the current sound source, and integration with the Windows speech recognition API.

Sample code and documentation

The SDK includes more than 100 pages of technical documentation. In addition to built-in help files, the documentation includes detailed walkthroughs for most samples provided with the SDK.

Easy installation

The SDK installs quickly, requires no complex configuration, and the complete installer size is less than 100 MB. Developers can get up and running in just a few minutes with a standard standalone Kinect sensor unit (widely available at retail outlets).

This SDK is designed for non-commercial purposes only; a commercial version is expected to be available at a later date.”

Additional details about the SDK is that it is currently in beta, meaning it is not yet the actual finished product. Rather, Microsoft wants the opinion of the Kinect hackers/developers in finalizing the product. By keeping it in beta, Microsoft will then ask users to give their feedback concerning the SDK with the eventual hope of releaseing a Kinect SDK built for and with Kinect hackers.

There is also a commercial version coming out. Details are not yet final as to what the difference would be between the two versions of the Kinect.

Source: kinecthacks.com

Visual Studio 2010 Web Standards Update adds HTML5 and CSS3 support

June 16th, 2011 by Don No comments »

Yay!! Microsoft has released a Web Standards Update for Visual Studio 2010 that adds full support for HTML5, CSS3 and new Javascript features like Geolocation and local storage.  Scott Hanselman has a good write-up on this update in this blog post.  There you can see some more detail about what exactly it brings to the VS.NET IDE, etc.  Or, if you want to skip all that and go right to the download, you can get it here.  At this point in time the HTML5 standard is still evolving. Taking that into consideration, Microsoft plans to provide additional updates every quarter or so to keep up with new features, changes to the draft, etc.

By the way, if you still aren’t familiar with all of the cool things that HTML5 brings to the table you should definitely check out this free online book, Dive Into HTML5, by Mark Pilgrim.

Tutorial for getting started with ASP.NET, WCF and jQuery

June 15th, 2011 by Don No comments »

I have been doing some work lately with jQuery, WCF, HTML5 and ASP.NET and it’s been actually pretty fun challenging and fun. I’ve gotten to tinker with quite a few new technologies that I hadn’t used before and really got to sink my teeth into jQuery and some of the cool new features that HTML5 has to offer (like local storage and offline capabilities).

When starting out with my recent project I had to pull from various resources to learn what these tools were capable of and how I could fit them all together. And while it doesn’t get into the HTML5 aspects of my project this article on creating a simple task list with ASP.NET, WCF and jQuery would have been very helpful to me in the beginning.

While the article is only Part 1 in a series, I think it will get you going in the right direction and will show you some of the power that you have on the client with the new jQuery data templates.  I must say that with the introduction of these templates you can truly offload a large amount of your logic down to the client which will provide for a much better (and faster) user experience.

Anyway, check out the article.  It’s short, to the point and offers the source code as a download too!

Simple WordPress Page Redirect Hack

May 23rd, 2011 by Don No comments »

I recently was looking for a way to setup a WordPress Page that actually was just a link/placeholder for an external site. This allows me to have my external page be automatically part of a theme’s navigation, etc. The solution I used is actually pretty simple and allows for an unlimited number of instances of these “redirect pages” without having to use any external plug-ins.

First you need to setup a simple PHP file that will serve as a template for your new page. Let’s say for example you have a club that you want to add as part of your navigation. Create a file called Club.php and put the following code in it:

<?php
/*
Template Name: Club
*/
?>
<?php header('Location: http://www.myclubsite.com');
      die();
?>

Then upload the file you created (Club.php) into /wp-content/themes/yourthemename/ where yourthemename is the name of the active theme for your site.

The final step is to create a new Page with the name that you want to show up in your navigation “My Club” based on the template that you just uploaded. You will see this template under the Template drop down menu in the page administration interface along with “Default Template”, etc.

Publish and you have a page that automatically redirects to whatever the URL you specified in your PHP template file. I create a separate one of these for any of these “redirect pages” that I want to setup.

It’s easy and it works!