Saturday, January 30, 2010

iPhone – Hello World Denver

24ZS

Just a simple test of whether XCode is working properly on my Mac and if the iPhone simulator is working…. Objective C is very weird (at least for someone with a C++ background – C# feels like a natural extension of my C++ skills – obj C…. not so much!)

LIDAR Mashup – a web-service, SilverLight version of Bing maps and Video

Here is an interesting use of LIDAR done by the folks at CadMaps

It uses a web-service to retrieve LIDAR data as a profile image (Webservice is LIDARServer a product from QCoherent). The images were then made into a video and then displayed in the SilverLight version of Bing Maps. What is very cool is the way in which they managed to get the video to sync with the path of the video in Bing Maps.

Implementation information: http://www.cadmaps.com/gisblog/?p=387

Bing Maps mashup: http://etl.onterrasys.com/OnTerra_MACCorridor/

Make your power-point slides pop

A collection of effects that will help you take your power-point slides to the next level (provided as a PowerPoint template – with notes on how the effects were setup):

http://office.microsoft.com/en-us/powerpoint/HA103380101033.aspx

Sikuli Script – Automate anything using screenshots

An MIT project using Jython (Python for Java VM), provides computer automation by looking for screen elements that you capture just like a screen-shot.

Download the tool at: http://groups.csail.mit.edu/uid/sikuli/

What's SIKULI?

Sikuli is a visual technology to search and automate graphical user interfaces (GUI) using images (screenshots). The first release of Sikuli contains Sikuli Script, a visual scripting API for Jython, and Sikuli IDE, an integrated development environment for writing visual scripts with screenshots easily. Sikuli Script automates anything you see on the screen without internal API's support. You can programmatically control a web page, a desktop application running on Windows/Linux/Mac OS X, or even an iphone application running in an emulator.

Friday, January 29, 2010

Microsoft OLE/COM Object Viewer

If you ever need to take a look inside a COM dll then OLEView is the tool for the job. The tool can be downloaded from: http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en

Wierdly, the tool needs a dll called iViewer.dll which is not part of the above package. You can get that dll from this installer: http://download.microsoft.com/download/2/f/1/2f15a59b-6cd7-467b-8ff2-f162c3932235/ovi386.exe (dont install it – instead use a tool like 7Zip to peak inside and extract just the iviewer.dll to the current Oleview.dll folder – “C:\Program Files\Resource Kit”)

Thursday, January 28, 2010

SQL Server 2008 - Transparent Data Encryption (TDE)

Transparent data encryption (TDE) performs real-time I/O encryption and decryption of the data and log files. The encryption uses a database encryption key (DEK), which is stored in the database boot record for availability during recovery. TDE protects data "at rest", meaning the data and log files. It provides the ability to comply with many laws, regulations, and guidelines established in various industries. This enables software developers to encrypt data by using AES and 3DES encryption algorithms without changing existing applications.

http://msdn.microsoft.com/en-us/library/bb934049.aspx

http://msdn.microsoft.com/en-us/library/cc278098.aspx

Wednesday, January 27, 2010

Setting up a SQL Server database for use with DNN

I always forget the correct set of settings (especially user permissions) for the database when I am trying to throw up a quick DNN site. So I finally decided to script the database creation process.

The following 4 scripts will:

  1. Create a login called DNNUSER
  2. Create the database
  3. Add a user called DNNUSER – attached to the login DNNUSER.
  4. Will provide the user DNNUSER with the following roles:
    1. db_datawriter
    2. db_ddladmin
    3. db_securityadmin
    4. db_datareader

1. Create login DNNUSER

USE [master]
GO
CREATE LOGIN [DNNUSER] WITH PASSWORD=N'aSimplePassword', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

2. Create the database (change the name and paths to what you need)

CREATE DATABASE [DNN5] ON  PRIMARY 
( NAME = N'DNN5', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DNN5.mdf' , SIZE = 2048KB , FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'DNN5_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DNN5_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO
EXEC dbo.sp_dbcmptlevel @dbname=N'DNN5', @new_cmptlevel=90
GO
ALTER DATABASE [DNN5] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [DNN5] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [DNN5] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [DNN5] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [DNN5] SET ARITHABORT OFF 
GO
ALTER DATABASE [DNN5] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [DNN5] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [DNN5] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [DNN5] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [DNN5] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [DNN5] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [DNN5] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [DNN5] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [DNN5] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [DNN5] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [DNN5] SET  DISABLE_BROKER 
GO
ALTER DATABASE [DNN5] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [DNN5] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [DNN5] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [DNN5] SET  READ_WRITE 
GO
ALTER DATABASE [DNN5] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [DNN5] SET  MULTI_USER 
GO
ALTER DATABASE [DNN5] SET PAGE_VERIFY CHECKSUM  
GO
USE [DNN5]
GO
IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [DNN5] MODIFY FILEGROUP [PRIMARY] DEFAULT
GO

3. Create a DNNUSER user and add the user to the database with the appropriate roles

USE [DNN5]
GO
CREATE USER [DNNUSER] FOR LOGIN [DNNUSER]
GO
USE [DNN5]
GO
EXEC sp_addrolemember N'db_datawriter', N'DNNUSER'
GO
USE [DNN5]
GO
EXEC sp_addrolemember N'db_ddladmin', N'DNNUSER'
GO
USE [DNN5]
GO
EXEC sp_addrolemember N'db_securityadmin', N'DNNUSER'
GO
USE [DNN5]
GO
EXEC sp_addrolemember N'db_datareader', N'DNNUSER'
GO

4. Add the EXECUTE permission to the database

use [DNN5]
GO
GRANT EXECUTE TO [DNNUSER]
GO

Once the database has been setup – you should be able to fly through DNN’s installation.

Other stuff to setup:

Remember to provide the ASPNET user full control to the DNN folder and sub-folders (as the install will be adding files, modifying the web.config, etc) – done via the file system.

Tuesday, January 26, 2010

ASP.Net and style=”display:inline-block”

I found ASP.Net was throwing in a style=”display:inline-block” on some of my elements. This style element works fine in IE – but was hosing up the display of content in Chrome and FireFox. Turns out that ASP.Net automatically injects that style element anytime you set the width or height on an ASP.Net control.

Easy and recommended fix: remove the height and width being set on the control and instead use a CSS style to assign the dimensions.

Complicated fix: over-ride the render method on the control.

DNN – Reset password in the database

I always forget the password that I use with my development edition of DNN. And because DNN is running locally I dont have access to an SMTP server for DNN to send me the password in the mail.

So here is a simple script that you can run on the database to reset the password.

Declare @UserName NVarChar(255)
Declare @NewPassword NVarChar(255) 
Declare @PasswordSalt NVarChar(128) 
Declare @Application NVarChar(255) 

Set @UserName = 'host'
Set @NewPassword = 'host'


Set @Application = (SELECT [ApplicationID] FROM aspnet_Users WHERE UserName=@UserName) 
Set @PasswordSalt = (SELECT PasswordSalt FROM aspnet_Membership WHERE UserID IN (SELECT UserID FROM aspnet_Users WHERE UserName=@UserName))

Exec dbo.aspnet_Membership_ResetPassword @Application, @UserName, @NewPassword, 10, 10, @PasswordSalt, -5

Courtesy of : https://support.ihostllc.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=39

Monday, January 25, 2010

FaceBook – Preview image for shared links

When a link is shared on Facebook, Facebook uses one of the images on the shared link page as a preview image.

image

Here is how you can control the image that is used as the preview thumbnail.

You need to set the meta tags title and description and in addition add link tag with the rel attribute set to “image_src”.

<meta name="title" content="title" />
<meta name="description" content="description " />
<link rel="image_src" href="thumbnail_image" / >

For more information, see: Facebook Share Tags

And here is page that you can test by sharing in Facebook, to see how it works: http://www.aggregatedintelligence.com/Samples/MySocialPage/twitterhome.htm

Displaying tweets from a Twitter list on your page

Based on my previous post – JQuery getJSON with failure callback, here is a sample that ties everything together to show all of the City and County of Denver’s tweets in one page: http://www.aggregatedintelligence.com/Samples/MySocialPage/twitterhome.htm

JQUERY – getJSON with failure callback

If you have used the JQUERY function $.getJSON, you will soon realize that there is no way to assign a function to be called on a failure.

Instead one needs to use the $.ajax method (which is what $.getJSON uses under the covers). And here is what the function would look like

function makeAjaxCall(ajaxUrl, functionSuccess, functionFailure){
        $.ajax(
        {
            type: "GET",
            url: ajaxUrl,
            contentType: "application/json; charset=utf-8",
            data: {},
            dataType: "json",
            success: functionSuccess,
            error: functionFailure
        });
    }

The above function would be called like so:

makeAjaxCall("http://api.twitter.com/1/rockyMtnRajah/lists/ccd-twitters/statuses.json?callback=?", loadTwitterListFeed, loadTwitterListFeedFailed);

loadTwitterListFeed would be implemented like so: (Where parseTwitterJSON would be responsible for loading the JSON data (per element) into the page)

function loadTwitterListFeed(data)
{
    $.each(data, parseTwitterJSON);
}

loadTwitterListFeedFailed is the method that is called when an error is encountered while making the AJAX call to the provided URL.

Important Cross-Site Ajax information when using Twitter API.

If you use the Twitter API to extract your feed as a JSON request, you will find that if you use the Twitter specified url (which will look like this: “http://api.twitter.com/1/rockyMtnRajah/lists/ccd-twitters/statuses.json”) with the makeAjaxCall method, you will get data back in Internet Explorer but not in FireFox and Chrome. The reason is that FireFox and Chrome will not allow you to make cross-site AJAX calls. To get around this issue, Twitter provides you with a way to specify the call-back method. You do this appending “?callback=?” to the URL. Once you do this – your code should work in all 3 of the browsers. (JQuery takes care of setting the correct callback name – for some reason I could not get “callback=loadTwitterListFeed” to work)

Sunday, January 24, 2010

Lessons learned on an Agile Microsoft Project

Sara Ford writes about the lessons she learned while managing the CodePlex.com project for Microsoft.

Post 1: http://port25.technet.com/archive/2009/10/19/lessons-i-learned-as-a-project-manager-converting-to-agile.aspx

Post 2: http://port25.technet.com/archive/2009/10/20/part-2-lessons-i-learned-as-a-project-manager-converting-to-agile.aspx

Post 3: http://port25.technet.com/archive/2010/01/20/part-3-lessons-i-learned-as-a-project-manager-converting-to-agile.aspx

From post 3:

On how releases are scheduled/managed:

On CodePlex.com, we deploy every three weeks using five week deployment cycles, as shown below. We spend approximately two weeks of new feature work, with one week of bug fixing/ course correction/ adding more work. Next, we cut the Release Candidate (RC), where we fork the code, so the test team can start the full test pass (regression testing) on the RC bits, and the devs can start new feature work on the "Main" code branch. If we find bugs in the RC, we fix both the RC branch and the Main branch.

Team organization

Besides our three week deployments, the biggest advantage of Agile to me, as the Program Manager, is that we all sit in one team room, with the idea being that the most effective means of communication is key. Got a question? Ask the room. Never be blocked due to communication.

As shown below, all the devs sit together at the pairing stations (to the right), and over on the left is where the test team sits. A few months after taking this photo, I changed seats with the development lead so that I could face the corner. I'm a very visual person, so sitting in the corner is less distracting for me. Just like our feature designs, we even apply the "course correction" concept to our own internal processes, like making this desk change tweak.

ATT phone codes

via: http://scottcate.com/blog/voicemail-codes-to-remember-for-att-phone-users/

Codes for forwarding calls to your ATT phone to another destination number based on the status of your cell phone.

*004* is a command that is used to set Forwarding, Busy, and No Answer, all at once.

*004*1[Destination Phone Number]*11# (Then press Talk or Send)

Individual Settings based on Phone Status

Forward All Calls command prefix: *21*
Activate: *21*1[Destination Phone Number]*11# (Then press Talk or Send)
Cancel & Retain: *21*11# (Then press Talk or Send) this option remembers the number, but disables forwarding
Re-establish: *21*11# (Then press Talk or Send) this option engages forwarding to the last number (notice this is just a toggle command
Cancel & Forget: ##21*11# (Then press Talk or Send) Disable forwarding, and forget the last number used to forward
Status: *#21*11# (Then press Talk or Send) this sends you back status of your forwarding number

Forward If Busy:
Activate: *67*1[Destination Phone Number]*11#
Cancel & Retain: #67*11#
Re-establish: *67*11#
Cancel & Forget: ##67*11#
Status: *#67*11#

Forward if no answer: Ring for 15 (see the 15 at the end of the activate command) seconds, and then forwards to destination number.
Activate: *61*1[Destination Phone Number]*11*15#
Cancel & Retain: #61*11#
Re-establish: *61*11#
Cancel & Forget: ##61*11#
Status: *#61*11#

Forward If Unreachable: (When you phone is off, or out of a service area)
Activate: *62*1[Destination Phone Number]*11#
Cancel & Retain: #62*11#
Re-establish: *62*11#
Cancel & Forget: ##62*11#
Status: *#62*11#

Friday, January 22, 2010

Hello World for HootSuite

A test blog post to check if HootSuite tweets it correctly

Changing Email settings used by Team Foundation Server

If you need to change the SMTP server or the from address used by TFS:

Edit the following 2 settings in the web.config file found in the following folder: “C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services”

<add key="emailNotificationFromAddress" value="fromaddress" />
<add key="smtpServer" value="SMTP SERVER" />

Tuesday, January 19, 2010

Body Mass Index Calculator from the City and County of Denver

http://www.denvergov.org/EmployeeResources/Wellness/ProgramsandServices/tabid/432532/Default.aspx

Friday, January 15, 2010

GeoEye RoadTracker 2.0 released For Feature Analyst

I was involved with the development of the very first version of RoadTracker from GeoEye for FeatureAnalyst (I provided the GeoEye engineers assistance in developing their plugin for FeatureAnalyst).

This month – they released version 2.0 of their awesome plugin. I am sure they have added some great new features – unfortunately I dont have a license to ArcGIS to be able to take it for a spin.

According to the press-release:
The upgraded application, functional on any road surface type using either panchromatic or multi-spectral imagery, accelerates the collection of roads and other linear features from satellite or aerial imagery by up to a factor of four. This tool also includes automatic feature attribution and other smart editing capabilities that greatly improve speed, accuracy and workflow when collecting map-quality linear features.

www.featureAnalyst.com

Here is a video I created using the first version of RoadTracker: www.youtube.com/watch?v=86TVj88BaLE

Friday, January 08, 2010

Sushi Etiquette

One of my favorite foods. Here is some useful info: via SwissMiss

Database naming standards

Via NixonCorp Team Blog: http://jerrytech.blogspot.com/2010/01/our-database-naming-conventions.html

Prefixes (all prefixes are lower case):

Example Standard What is it?
tb_Users tb_ prefix Table
UserName Pascal Case Column
up_User_Insert up_ prefix Stored Procedure
v_Users v_ prefix View
fn_UpdateUsers fn_ prefix User Function
syn_Users syn_ prefix SQL Synonym
idx_Users_001 idx_ prefix Index
@userName @ + Camel Case func, proc Parameter
@UserName @ + Pascal Case Local variable
  1. Tables are always plural (tb_Users, never tb_User)
  2. Columns are in Pascal Case (UserId, FirstName)
  3. Primary Keys are single columns whenever possible
  4. Primary Keys are named after the table (UserId)
  5. Primary Keys end with Id (UserId, not Key or Pk)
  6. Foreign Keys end with Fk (UserFk, never Id, Key or Pk)
  7. Stored Procedures never use the sp_ because this is a known SQL Server performance problem
  8. Stored Procedures are named up_NOUN_VERB such as up_User_Insert or up_User_Search or up_User_Delete, not up_Delete_User or up_DeleteUser or up_UserDelete.
  9. Triggers are named tr_TABLE_ACTION such as tb_Users_UpdateSecurity, not tb_UpdateUserSecurity
  10. Index names don’t really matter. But if we want to conform them we use idx_TABLE_TYPE_COLUMNS like idx_Users_Clustered_LastNameFirstName. If the number of columns is too long, then idx_Users_Clustered_001

There are special rules especially for cross reference tables.

  1. Names should include the parent table’s name
  2. Names should include the static term “cross”
  3. Names should include the child table’s name
  4. They always have a primary key called CrossId
  5. Many to One = tb_Groups_cross_User (in all reality, this should never happen – use One to Many).
  6. One to One = tb_User_cross_Group (singular child)
  7. One to Many = tb_User_cross_Groups (plural child)
  8. Many to Many = tb_Users_cross_Groups (all plural)

More Info:
Read my previous post Coding standard – naming of UI elements

Wednesday, January 06, 2010

ASP.Net – Page URL from Request

Here is how you can get the page url after stripping out the QueryParameters from the URL.

UriBuilder builder = new UriBuilder(Request.Url); 
builder.Query = ""; 
string urlWithOutQueryParams = builder.ToString();

Other points:
Server.MapPath – is used to convert a virtual path to a physical path. (The virtual path can have the “~” or be relative “..” or “/”)

VirtualPathUtility class has many useful helper methods that can be used to manipulate the path. (http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility_methods.aspx)

Page.ResolveUrl and Control.ResolveUrl can be used within the context of a page to convert a relative path to a URL. (paths that start with “~”, ”..” , ”/”).

Paths starting with a “~” are known as root relative paths or virtual paths. Paths starting with a “..” or a “/” are known as logical paths and are relative to the web-server’s root.

More info:
Making sense of ASP.Net Paths: http://www.west-wind.com/weblog/posts/132081.aspx

Enabling Windows 7 God-Mode

Win 7 God-Mode – provides you with easy access to some useful features in Win 7. To enable it create a folder on you desktop and name it GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

Thats it – if you browse into the folder – you will find all the links (shown below).

image