Thursday, July 07, 2011

SQL Server Denali Sequence Object Overview

Database Journal - Understanding Sequence Object in SQL Server Denali

"Until SQL Server 2008 R2, the Identity column was used to generate sequential numbers to identify records in a table, mostly used as a primary/foreign key. The scope of the identity column is the table on which it has been created, and the next sequential number is created when the DML statement is executed. But what if you want to have sequential generation of numbers across tables (instead of tying the numbers with just one table), and you want to have the next sequence number even before execution of the DML statement? SQL Server Denali has a new feature called Sequence object for these purposes, while retaining Identity column functionality too.

As in prior versions, there are some alternatives of Sequence object what are also in SQL Server Denali, but SQL Server Denali now natively supports it. To learn more about these alternatives, click here.

Understanding sequence objects

A Sequence object is another user-defined schema-bound object type that provides functionality similar to Identity column with some differences. Unlike Identity column, the sequence object can be used with more than one table; it also provides the next sequence number before actual DML execution. Getting next sequential number comes handy in a couple of scenarios, like when you have parent-child tables (such as Order and OrderDetail) and you want to insert records in these tables, want values for primary/foreign key, when you want to recycle the numbers, when you want to have the next number before actual DML, among other examples.

Sequence object generates the next sequential number as per the specification with which the sequence object has been created. The next sequential number could be either in ascending or descending order at a defined interval, as per specification. Sequence object may reuse/recycle numbers if it reaches the limit, if you have specified to recycle while creating the sequence object.

Getting started with Sequence Objects

As I said before, sequence object is like any other user defined schema bound object, and hence SQL Server has the CREATE/ALTER/DROP SEQUENCE command for managing these objects. You can query the sys.sequences catalog view to learn more about sequence objects in the database or you can view it in SSMS (discussed later in this article).

The below example creates a new sequence object and specifies its different properties....

image"

I know I'm weird, but the Sequence object coming in Denali has me kind of excited. This solves a problem I have today, in a way that's usable, supported, baked into the box and easy to understand. Now all I need is Denali to ship and get it deployed...

[Humor] Development in the Google, Microsoft and Apple spheres

Global Nerdy - Google, Microsoft and Apple

google-v-microsoft-v-apple

...

This comic was created by Manu Cornet, the artist behind the comic org charts of the big tech companies.

I thought this pretty funny (in short it made me snort-laugh, causing my cat and dog to look at me funny)

Wednesday, July 06, 2011

dtSearch. You heard about it, you've seen it advertised, now see how to get started developing with it...

I Programmer - Getting started with dtSearch

"You may have noticed that I Programmer's search facility is, to put it bluntly, not very good. It has been on our fix list for a long time but so far no one has had the courage to decide on the technology to use to replace it.

I also have a great interest in desktop search - or rather how how it generally doesn't work under Windows. Since Vista, Window's desktop search has been difficult to use, difficult to configure and difficult to manage. I've tried alternatives such as Windows Search 4.0 and Solr but there are problems with both. They tend to over complex and simply not worth the effort. Now I'm investigating dtSearch and I can tell you now, it's a refreshing return to simplicity.

But see if you agree as I explain how easy it is to get started with it as a system component and as an API.

What is search all about?

This is a difficult question because there are many answers depending on your exact circumstances. Put simply, search is about finding documents based on their content. The dumb way to do this is search the entire collection of documents each time. The most intelligent way of doing the job is to scan all of the documents and build an index of the words that they contain. The index is typically much smaller than the collection of documents and much faster to search.

In most cases you only have to scan the entire collection of files once and then add any new files to the index. The big problem is that most tools make creating an index a difficult task. Not so with dtSearch. It makes it seem ease and direct and you can see exactly what is going on.

You could simply use the dtSearch console to find documents but in most cases it is preferable to build it into an app of your own - and this is where the API comes in. But before looking at the basic structure of the API and building our first "hello world" applications let's take a quick look at getting started with dtSearch.

..."

We've all seen the ads for it in the dev mag's but I don't remember seeing a getting started/intro post like this recently.

More information about DLL's than you ever wanted or Wow, this guy almost wrote a book about DLL's

:: (Bloggable a) => a -> IO () - Everything You Never Wanted To Know About DLLs

"I've recently had cause to investigate how dynamic linking is implemented on Windows. This post is basically a brain dump of everything I've learnt on the issue. This is mostly for my future reference, but I hope it will be useful to others too as I'm going to bring together lots of information you would otherwise have to hunt around for.

Without further ado, here we go:

..."

We're talking a 13 printed page blog post just about Windows DLL's. Now THAT's a blog post!

Channel 9 Wiki Markup and Query Param Quick Reference

This is just a quick write-up for the current wiki markup supported in Channel 9 posts, as well as the supported Channel 9 Silverlight video query param's.

This is a much a means so I can find this in the future as anything. If it helps other Channel 9'er's too, well that's cool too!  :) The credit for this information goes to Clint Rutkas and Duncan Mackenzie, I'm just the OCD guy that felt a need to write it up... lol

Channel 9 Wiki Markup

Code

Description The code markup will apply source code formatting rules, such as coloring, scrolling, etc, to a given selection.
Markup [code]
[/code]
Attributes lang|language
Sets the layout/formatting language.

lang="csharp"
lang="vb"
language="html"
language="js"
language="sql"
language="xml"
language="cpp"
language="css"
language="php"
language="psh"
Example
image

image
Channel 9 Post Editor
image
image
Notes a) Keep an eye on the line breaks. Sometimes the finally rendered html line breaks don't match up with the lines in the edit body. So preview your posts and if needed, add a break (<br>) at the start of any lines that don't seem to break right (i.e. are appended to the preceding line).
You can see this behavior in the above VB example (note the "Dim FullPath..." and "workPath ..." lines. To fix this, I'd add a break at the start of those two lines and it would then all layout as expected.

b) If you're using a tool like Windows Live Writer to author your posts, be careful how you paste in your code snips. I've found this it's easier to paste the code into notepad and then copy/paste from there into the actual post. This strips all formatting, etc. (which the Paste Special, remove formatting doesn't seem to for me).

Video (Channel 9)

Description Embeds a Channel 9 video, with player, into the post
Markup [c9]
Attributes videourl
Sets the video to be embedded. Use the given Channel 9 video's main/normal url (i.e. copy from the address bar)
Example [c9 videourl="http://channel9.msdn.com/Shows/PingShow/Ping-107-Ballmer-Birds-Office-365-Kinect-and-health-care"]

image
Channel 9 Post Editor None (that I am aware of)
Notes Be careful when pasting in this tag. I copied it from an email, pasted it into a post and it wouldn't work. The issue was that the "paste" included a good bit of formatting that wasn't easily visible outside the HTML view. Once I made sure I was pasting in very plain text, it worked like a charm.

Video (YouTube)

Description Embeds a YouTube video, with player, into the post
Markup [youtube]
Attributes video
Sets the video to be embedded.
Example [youtube video="nGeKSiCQkPw"]
image
Channel 9 Post Editor image
image
Notes Easiest way I've found to use this is to take the video URL from YouTube and paste it into the above dialog. It will parse out the information it needs from that.

Video (Vimeo)

Description Embeds a Vimeo, with player, into the post
Markup [vimeo]
Attributes video
Sets the video to be embedded.
Example [vimeo video="4044623"]
image
Channel 9 Post Editor None (that I'm aware of)
Notes I've not used this at this time...

Channel 9/Silverlight Media Query Params

Time

Description Indexes into a Channel 9 video at a specific minute/second.
Param time
Value ##m##s
m=Minutes
s=Seconds
Example #time=11m05s
http://channel9.msdn.com/Shows/This+Week+On+Channel+9/TWC9-Office-365-Internet-Explorer-10-PP2-Choosing-the-Right-collection-class-ToneCheck#time=11m05s
Channel 9 Post Editor None (that I'm aware of)
Notes  

A powerful pile of PowerShell ebooks (all free too)

Jason Hofferle - List of Free PowerShell eBooks

When I needed to build a collection of PowerShell resources for our internal IT personnel, I had trouble finding a comprehensive list of all the freely available eBooks out there. I thought it would be worth spending a few minutes collecting these links in a single place. If you know of any that I’m missing, please let me know.

SNAGHTML23e5221c..."

A nice round-up of many/most PowerShell free ebooks.

(via jonoble.com - Free PowerShell books)

 

Related Past Post XRef:
“Effective PowerShell: The Free eBook” – Keith Hill’s Effective PowerShell blog posts as a living and growing (and free) eBook
Another outstanding free PowerShell eBook by Frank Koch, "Administrative tasks using Windows PowerShell: Introduction and examples of how to use the scripting technology in everyday IT administration"
Free PowerShell Introduction/Getting Started book from MS Switzerland
Free (reg-ware) PowerShell v1 eBook (593 pages) – “SAPIEN’s Windows Powershell V1.0: TFM”
567 of free ebook pages of PowerShell v1 - “Mastering PowerShell”
"Climbing Mt PowerShell" comic now available
Windows PowerShell Quick Reference Guide Updated

Tuesday, July 05, 2011

Ahh.... All those PST's on my network are killing me. I wish I could capture them all and import them... (hint: The Exchange Team has heard your cries and will have something for you soon)

Exchange Team Blog - Coming Soon: PST Capture Tool

"As we like to say here on EHLO, we’re always listening for feedback on what we're doing well and what we could be doing better for you. As more and more of you evaluate and deploy the email archiving, retention and discovery capabilities of Exchange Server 2010 and Exchange Online, we understand that Personal Folders (.pst files) remain a challenge for you. You have told us that having the ability to search your network to discover and then import .pst files across your environment is critical, and that you need an admin-driven and straightforward tool for doing these things.

We're excited to announce that later this year we'll be adding a new tool to our already rich portfolio of planning and deployment tools. This new tool, PST Capture, will be downloadable and free, and will enable you to discover .pst files on your network and then import them into both Exchange Online (in Office 365) and Exchange Server 2010 on-premises. PST Capture will be available later this year. It doesn’t replace the New-MailboxImportRequest cmdlet that exists already for importing known .pst files into Exchange Server, but instead works in parallel to enable you to embark on a systematic search and destroy mission to rid yourself of the dreaded .pst scourge <*pirate growl*>.

We'll make more details available as we approach the release of the tool, but given the high demand for this capability, we wanted to let you know that we are working on this for you. ..."[GD: Post leach level - 98%]

This of course assumes your company doesn't have such caps on your mailbox size that forces you to keep local PST's... (sigh). Still, if you need something like this I'm sure, this will come in handy...

 

Related Past Post XRef:
Importing and exporting PST’s from Exchange 2010 SP1, the new, improved and full flavored PowerShell way…

Encyclopedia of Science Fiction, Third Edition will be released online later this year... and the text will be free...

Encyclopedia of Science Fiction to be published online, with text available free (Press Release) 

"The third edition of the Encyclopedia of Science Fiction, the definitive reference work in the field, will be released online later this year by the newly-formed ESF, Ltd, in association with Victor Gollancz, the SF & Fantasy imprint of the Orion Publishing Group, whose support will enable the text to be available free to all users. This initial “beta” version, containing about three-quarters of the total projected content, will be unveiled in conjunction with Gollancz’s celebrations of its 50th anniversary as a science fiction publisher.

The first edition of the Encyclopedia, whose founder and general editor was Peter Nicholls, appeared in 1979, and contained over 700,000 words. A second edition, edited by John Clute and Peter Nicholls, appeared in 1993 and contained over 1.3 million words. Both editions won the Hugo Award from the World Science Fiction Convention, in addition to numerous other honours. The beta version of the third edition will contain some 3 million words, including about 12,000 entries and well over 100,000 internal links. The entries cover every area of science fiction, including authors, illustrators, movies, music, games, and fanzines. The text will be completed, through monthly updates, by the end of 2012.

..."

The Encyclopedia of Science Fiction

"The Encyclopedia of Science Fiction is an unparalleled reference work of unrivalled authority. First published in 1979, and revised in 1993, the forthcoming online third edition will provide coverage of:

  • Authors
  • Films
  • TV series
  • Themes in sf
  • Magazines
  • Manga and anime

...and much more.

Press release, July 5th (PDF 91KB)

..."

Shinny!

(via TOR.com - Encyclopedia of Science Fiction to be Available Online—for Free)

This would be funny if the warning wasn't so necessary...

Global Nerdy - NOW They Tell Me

in-case-of-fire-dont-tweet

Sad, so, true (that the warning is needed). Got to love the "Social Age"  :/

Monday, July 04, 2011

The Zune HD may be dead, but it's still getting some app love... 6 new games and 3 utilities recently added

The Zune HD is dead, but even so we're getting a few bread crumbs thrown our way every so often... And being we're talking Zune HD, all these are free.

image

image

BTW, the Shuffle By Album utility is one of the favorites in my house... 

"Office 365 for the IT Pro - Platform" course now available on MVA

Microsoft Virtual Academy - Announcing the Release of the ‘Office 365 for the IT Pro – Platform” course to the Microsoft Virtual Academy

The Microsoft Virtual Academy team would like to announce the release of the Office 365 for the IT Pro – Platform course.

If you are looking to exploring the features of Office 365, or wondering if it’s right for your business this 5 module course will provide you valuable information on the core Office 365 features.

...

No core features course would be complete without a look at the administration features and this course covers these with a look at how to perform tasks using PowerShell.

This course is the first in a series of 3, with additional course on Exchange Online and Collaboration with Lync Online and SharePoint online available at the MVA." [GD: Post Leach Level: 95%]

Microsoft Virtual Academy  - Office 365 for the IT Pro - Platform

"Just exploring the features of Office 365? Wondering if it’s right for your business? Trying to determine what’s involved in migrating to Office 365? This track provides you an overview of the components that comprise Office 365, including the different licenses available and what’s included with each. From that overview, the next modules go in to greater detail on Office Pro Plus – the version of the Office suite unique to Office 365 – and how to deploy/activate it. Additional modules go in to detail on what kinds of administration you can perform with PowerShell, and an overview of the sign-on options available with Office 365, including directory synchronization with your existing Active Directory, and implementing Active Directory Federation Services (ADFS) for single sign on between on premises and Office 365 cloud services.

SNAGHTML19a199c5..."

If you're IT, or just think you are, and interested in Office 365, this course looks like a good place to start.

NOTE! These courses use the Office 365 Jumpstart videos I previously blogged about, 15 for 365 - 15 Videos Office 365 for IT Pros. So if you're already watched those, you can jump right to the self-assessments and earn your points quickly... :)

 

Related Past Post XRef:
15 for 365 - 15 Videos Office 365 for IT Pros

Microsoft Virtual Academy (MVA) provides free Microsoft Cloud Tech training

SkyDrive .Net API (Unofficial, but since there's no official one available...)

CodePlex - SkyDrive .Net API Client

"Project Description

SkyDrive .Net API Client allows developers to easily integrate Microsoft's Windows Live SkyDrive online storage and sharing services into their own applications. It's developed in C#.

What is this?

This project is an open source client for Windows Live SkyDrive written for the Microsoft .NET Framework. This is NOT an official, Microsoft API! However, this library will greatly facilitate the development of 3rd party applications for developers already familiar with the Microsoft .NET technology stack.

How does it work?

At the time of this writing, as far as I know, there is no official API to use for SkyDrive. However, there are several legacy applications (Microsoft Windows Live Photo Gallery, Microsoft Office) and open source tools (SkyDrive Simple Viewer for WebDAV) which are already using some sort of, non-documented web services like SkyDocsService, Live API and SkyDrive WebDAV. This project integrates/wraps those web services into one, single service client in order to provide a super set of all the features available -one by one- in those individual web services.

..."

I've been waiting, and waiting and waiting for an official SkyDrive API. Since SkyDrive was released in 2007 (yes, SkyDrive has been available since 2007), I've been whining about the lack of an API. Sure there's unofficial ways to work with it, third party utilities, etc, but lack of an official and supported API bugs me. And it's not like Microsoft isn't using some API in their growing list of services and app that use SkyDrive. sigh...

Anyway... This project looks interesting and seems to be constructed in such a way as to if there ever is an official API, it could be updated to use it. Using an unofficial API is always a risk, but if it's the only game in town...

Encrypting locally saved data on WP7/Mango with DPAPI

Share-n-dipity - Using DPAPI with IsolatedStorage In Windows Phone 7 Mango Release

"I was doing some work on the Mango release of Windows Phone 7 the other day. One of the great features (there are many) that has been added is support for DPAPI. One of the cases in which you might want to use this is to encrypt some content before storing it locally. In WP7, when an application stores data locally it uses something called IsolatedStorage. The IsolatedStorage system has some nice classes to help your applications read and write to it. One thing that I've discovered though (at least at this point) is that it fundamentally doesn't really work with content that's enrypted by DPAPI. Let me explain what I mean by that.

Supposed you use DPAPI to encrypt some content and then write it to disk. Now you want to read that encrypted data back in, decrypt it, and do something with it. Well if you follow most of the IsolatedStorage examples you will do something like:

...

The problem is when you call Unprotect you will get an error along the lines of padding having been added. The problem is some extra characters that the default IsolatedStorageFileStream reader adds when it reads content in for you. To work around this problem, you need to get a reference to the underlying stream and read directly from it. For example, this code:

..."

A good tip for working with DPAPI in Mango. Encrypting local, at rest, data is something that you sound look at closely if you're storing any PII or anything even close to private/confidential/shouldn't be shared beyond the user/etc.

Getting your NuGet Gallery Orchard Growing...

http://espenao.posterous.com/ - Create NuGet Gallery with Orchard (Using the included power shell script)

"If you want to use NuGet to share packages you use a external libraries in your organization, it's a good idea to host your own NuGet server. There are many examples of how to create packages on the official NuGet site, however I reccomend that you use your CI build server to create packages and push them to your internal NuGet server (Unless you want to publish your stuff on the official NuGet server which is also possible, of course).

However, if you want to impress your colleagues, and show of your packages in a cool way, you should get a copy of the Orchard gallery with the NuGet package theme.

At http://docs.nuget.org/docs/contribute/setting-up-a-local-gallery you will find a guide on how to create your own gallery. However, they don't mention the most important part. The gallery includes a power shell script that allows you set up the gallery and feed service with one click.

The only problem with the included script is that it's full of bugs. The following guidelines will help you correct the bugs and run the scripts. The assumption is that you will run this on some remote computer to make it available for everyone in you organization.

..."

I'm a firm believer that NuGet can be used to dramatically change how components and code is shared inside an organization. That maybe this is finally a shared component repository model that will really work (sigh, I can't even count the new of component repositories comes and go over the years...). All the pieces seem to be moving into place and it may be just a matter of getting those inside your organization introduced to NuGet, let them see the power it provides and start them thinking about how it can be used inside the firewall. I know YOU don't need to be sold on NuGet, you're here, reading this, and likely in front of the dev wave, but I 'd bet there's those inside your Org that might not be as ahead as you are...

Sing with me, "I'm just an email...but I know I'll be evidence someday..."

Case in Point - Courthouse Rock

EPSON scanner image

You've heard me sing this song before and I'll do it again... Electronically Stored Information (ESI) is almost impossible to delete/destroy/call back/make go away/etc. Once it leaves your machine, and likely even before then, it will live forever...

Saturday, July 02, 2011

TFS SDK gets VB (samples, that is)

Allen Clark - Team Foundation SDK Updates: VB Samples + More Samples using the Version Control APIs

"We've just updated to the Team Foundation SDK content (Extending Team Foundation) to include VB samples alongside the C# samples that we had previously published.

We've also added some new sample code for working with the version control APIs:

..."

SNAGHTMLfb5b5f8

Always good to see VB get some sample love...

(via learn TFS - July 1, 2011 – Learn TFS Daily)

Getting your contacts from your Verizon Feature Phone into your new Windows Phone 7 device

One Man Shouting - Moving Contacts From a Verizon Feature Phone to Hotmail for Windows Phone 7

"First, I have to explicitly state that the following process is not endorsed or supported by Microsoft or Verizon. I have used it a couple of times successfully, but I can’t guarantee that your phone won’t spontaneously combust or otherwise cease to function if you follow the steps below. If you have trouble, feel free to leave a comment below and I’ll do my best to help.

I have heard several stories lately from folks who are finally taking the plunge into the world of SmartPhones on Verizon (with the AWESOME HTC Trophy). Some Verizon reps simply state that you can’t move contacts from the old to the new phone, but they helpfully print out a hard copy of the contacts from the old phone. Others point to the Microsoft Article on Syncing Outlook Contacts with Windows Phone which isn’t very helpful if you don’t have or use Outlook. I figured it would be worth putting up a post on the process I used.

The first step is to make sure your contacts are backed up with Verizon’s Backup Assistant from your old phone. The process is different for different phones, but should be similar to the following.

...

image..."

This is a great tutorial for getting your contact off your old Verizon phone and onto your new WP7 device. If you're a Verizon customer and moving to WP7, and you're concerned about getting your contacts moved, you need to read this post...

RegEx'ing in Visual Studio with the Regular Expression Tester Extension

Visual Studio Gallery - Regular Expression Tester Extension

Features

The tool provides the following features:

  • Parsing of your existing regular expressions from code for C# and VB.
  • Parentheses matching.
  • Instant compilation of your regular expressions as you type along with error message feedback.
  • Matches, groups and captures highlighted in color on your input data so you get an easy overview of exactly how your regular expression matches your data.
  • Saving regular expressions for later use.
  • Evaluation is performed in a background thread so it can be aborted if it gets stuck on an inefficient regular expression (try for instance (a|aa)*b on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)

...

RegExScreenshot

..."

If you're RegEx'ing having an extension like this handy is a must...

 

Related Past Post XRef:
Free regular expression addin for Visual Studio - Regular Expression Explorer

The B, C and D's of Learning Regex...
"Regular Expression Cheat Sheet (.NET)" from RegExLibrary

Friday, July 01, 2011

Microsoft makes the source available for the app that's going to be used for Bing's Streetside Wi-Fi/Cell Tower/GPS data gathering (i.e. see some of the code the Bing Streetside cars will be using as they [war]drive around your neighborhood)

WinRumors - Microsoft open sources Bing Streetside Wi-Fi data collection software

"Microsoft shared the source code for its managed driving data collection on Friday.

The code is used to collect data from cell towers, Wi-Fi access points and GPS to build a positioning database for Windows Phone, Bing and other Microsoft products and services. Microsoft started to collect mapping data in early April for its European Bing Maps Streetside imagery. Dave Coplin, director of search for Microsoft UK, spoke to WinRumors on Thursday about the decision and revealed that it is very much in the interests of public privacy. Copin explained that Microsoft has been working with the ICO and privacy lobby in the UK to establish a best practice to collect Wi-Fi data. The organizations wanted assurances that Microsoft would not collect data by mistake in the same way that Google did previously.

Microsoft is now preparing to collect Wi-Fi data in its Bing mapping cars. The software giant uses Windows Mobile 6.5 devices to collect the data and the software was developed by the Windows Phone Engineering team. The source code, released here, uses publicly documented APIs to access cell tower, Wi-Fi access points and GPS data. “The software does not intercept wireless data transmissions from consumers’ computers (so called “payload” data),” says Microsoft’s Reid Kuhn, Partner Group Program Manager of the Windows Phone Engineering Team.

..."

MSDN Code Gallery - Managed Driving Data Collection

"Resource Page Description
As part of Microsoft’s ongoing commitment to consumer privacy, we are providing more transparency about how we gather information through managed driving to provide location-based services. We are sharing relevant portions of our data collection software source code that demonstrates both the type and amount of data we collect through managed driving.

The information collected during Managed Driving includes Cell tower, Wi-Fi and GPS data. The collected data is used to build a positioning database that helps create location capabilities and services for Windows Phone and other Microsoft products and services.

The code has been written using a combination of native and managed code, and uses publicly documented interfaces for accessing Cell tower, Wi-Fi and GPS data. The software only detects management frame subtypes called probe request frames, which do not contain any personal user content. The software does not observe or collect any data frame packets, which are the type of Wi-Fi packets that may contain user content transmitted over a network nor does it attempt to connect to any open networks. The software only observes information that is publicly broadcasted by the Cell tower, Wi-Fi access point and GPS satellites. The information we collect includes elements like latitude, longitude, direction, speed, mobile country code, mobile network code, location area code, cell identifier and only specific Wi-Fi information such as BSSID (i.e, the Media Access Control aka MAC address), signal strength, and radio type.

During the collection process, we collect and retain only as much Wi-Fi access point data as necessary to build our positioning database, and none of data collected is associated with personally identifiable consumer information. " [GD: Description leached in full]

Here's a snap of the Solution. Got to love a project that includes a "WarDrivingLibrary." 

image