Tag Archives: developer training

What Makes the Best Reference Material

What is the best material to use when you want to learn a new topic within development or IT? If you are an experienced developer or IT pro, what is the best reference material to use?

These questions come up often, and typically developers and IT pros look at reference material and training material as coming from two different sources.  In my opinion, you need robust learning material that can first be used as training and subsequently as reference material.

Generally if someone needs to learn a skill (like how to effectively manage a project), a programming language (like C# or JavaScript), or a technology (like SharePoint or SQL Server), they will look for learning material that is focused on that specific subject. Many will look for “courses” on the topic thinking that is all they need. Effective developers and IT pros will instead look for “solutions” that will give them the best approach to solving their issue both in learning the subject from beginning to advanced and for reference material later.

Great reference material…

  • Is very searchable, including the ability to easily filter and find the needed material quickly.
  • Is built with short learning bytes so the user can learn it fast and get back to work.
  • Fits different learning styles.
  • Is practical and thorough.

Great training material has many of the same attributes…

  • Is well-organized, taking the learner from intro level concepts to advanced development.
  • Includes varied learning resources that will work well for different learning styles – learning visually, plus learning by doing, listening and reading. Many people learn best from different learning modalities.
  • Includes labs and “try-it-outs” so a person can practice and reinforce what he or she has learned.

Once you have learned your new skill, language, or technology, you are not done learning. You will continue to learn on-the-job and through trial and error. And sometimes you’ll encounter issues where you don’t know or can’t remember what to do.

When reference material is needed to solve a problem, what do you look for? Ideally it is best for developers and IT pros to find training material that also can function as easy-to-use reference material, such as…

  • Providing a strong search/filter system so you can find what you need quickly. There is nothing worse than needing a quick answer on how to do something and then spending hours searching for that answer. You need to find it fast, learn it fast, and get on with your life.
  • Being concise to best address your specific issue quickly. You don’t want to listen to someone blab on and on in a training video who never gets to the point. You need specific, practical advice—not training where the ego of the instructor gets in the way.
  • Training material that covers multiple learning modalities: read, listen, watch, do.

LearnNowOnline training has been designed to be excellent resource for both training and reference material, including:

  • Resources that will support all learning modalities: video training, ebooks/courseware, sample code, hands-on labs, and “try-it-outs.”
  • The best search/filter system to help you to access what you need quickly and easily.
  • Videos built in 5-10 minute nuggets so you can learn exactly what you need fast.
  • Content that is thorough, deep and comprehensive, written and presented by the best experts in that technology.

If you need learning resources for SharePoint, Visual Studio, SQL Server, JavaScript, PMP or other Developer and IT Pro technologies, I invite you to check out LearnNowOnline for yourself and experience a solution that provides both excellent training AND reference material.

About the Author

Craig PhotoCraig Jensen is the President and CEO of LearnNowOnline. Craig has led the company’s change from instructor-led classroom training, to self-study CD/DVD training, to the award winning online learning solutions offered today. Craig is passionate about helping individuals and businesses of all sizes solve their problems through practical learning and technology. He is involved in setting direction for the company, including selecting training content for development with resources to support all learning styles. He is also involved in The CEO Roundtable organization in the Twin Cities as well as the Minnesota High Tech organization. In his spare time, Craig loves to travel, golf, and partake in water sports of all kinds.

SQL 2012 Developer: Aggregates

Aggregates

One of the more exciting types of SQLCLR code modules is custom aggregates. Earlier versions of SQL Server didn’t offer an easy way to extend the rather short list of T-SQL aggregates, such as SUM, AVG, MAX, MIN, and COUNT. You still can’t use T-SQL to create custom aggregates, but you can write your own in SQLCLR. It’s not something you’ll need to do often, but it can greatly simplify application coding in situations where you need it. 

Unlike other SQLCLR code modules, you can define only a single custom aggregate within a class. The class must be public and requires four non-static methods, which SQL Server calls as it processes the data to aggregate:

  • Init initializes storage values. SQL Server calls this once at the beginning of the query that uses the aggregate.
  • Accumulate does the work of combining values. SQL Server calls it once for each row that is aggregated, and it must support multiple instances of the aggregation code that is executing so that SQL Server can utilize multiple threads to make operations more efficient.
  • Merge is called at the end of the operation to merge the aggregations of multiple instances into one final value.
  • Terminate is the last method called and returns the final aggregated value.

You also have to deal with serialization issues because instances of the aggregation class have to be moved between threads. This complicates the code only a little, since the .NET Framework has rich support for serialization. Most commonly, you’ll implement the IBinarySerialize interface to let .NET do all the serialization work, but there are other options if you have a special need.

Consider a sample aggregation. A common requirement in applications is to create a concatenation of strings within a table, delimited by a single character such as a semicolon. Some applications require information in this format for processing. You’ll create a Concatenate aggregation that you can use to concatenate all string values in a field. For example, once you create the aggregation, you could run the following T-SQL code to produce a single string with all product names from the Northwind Products table that have a category ID of 4, which is Dairy Products.

This code produces the following string (with line breaks added to fit on the printed page):

The first part of the SQLCLR code defines the aggregation class and decorates it with Serializable and SqlUserDefinedAggregate attributes. The SqlUserDefinedAggregate attribute needs the following parameters, most of which the query processor uses to perform the aggregation properly.

  • Format specifies the serialization format, either Format.Native or Format.UserDefined. You’ll nearly always need to use UserDefined, although SQL Server has enhanced support for the Native format.
  • IsInvariantToDuplicates indicates whether the aggregation result is the same if any of the items are duplicates. The Concatenate aggregation returns a different result if duplicates exist (they’ll appear multiple times in the resulting string), so set this value to false.
  • IsInvariantToNulls indicates whether the aggregation result is the same if any of the items are nulls. Concatenate ignores null values, so set this value to true because the same string will result whether there are nulls or not.
  • IsNullIfEmpty indicates whether the aggregation result is null if no items were aggregated, such as when the WHERE clause returns norecords to aggregate. If no strings exist, Concatenate returns a null, so set this to true.
  • MaxByteSize is required by the UserDefined serialization format and indicates the largest aggregation value that can be returned. This is set to 8000 bytes in Concatenate.

Concatenate is implemented in the following code as a structure and inherits from IBinarySerialize so that SQL Server can properly use multiple instances of the aggregate, using the listed parameters.

SQL Server calls the Init() method before aggregation begins. This is the point where you should initialize any variables used in the aggregation. Concatenate uses a StringBuilder object in an sb variable to hold the aggregated values, so that variable is instantiated here.

SQL Server calls the Accumulate method when it has a new value to add to the aggregation. Concatenate works only on string type data, so the method receives a value of type SqlString. If the value is null, it returns immediately without doing any aggregation task. Otherwise, it calls the Append method of the StringBuilder variable to concatenate the string.

The Merge method is used to aggregate multiple instances of the Concatenate object. In this case it simply concatenates the value passed to it by the SQL Server query processor to the current instance’s aggregation value. The method is passed an object of type Concatenate and reads the object’s StringBuilder’s ToString property to get the current aggregation value.

Often you’ll need to do more work here; for example, when the resulting aggregation needs to be in alphabetical order. In that case, you may want to use a sortable .NET list object to store the strings internally while processing the aggregate. But here a simple append is sufficient, since the order of the items in the final string is not important.

The last of the four required aggregation methods is Terminate. SQL Server calls this after it processes the last value that it aggregates. This method needs to return the final aggregated value, so it first checks whether the current string is of zero length. If it is, it returns a null. Otherwise it strips off the final semicolon and returns the value. It also clears the sb object in case this instance of Concatenate is used for another aggregation.

The aggregation object also has two other methods, required because the object implements the IBinarySerialize interface. The Read method is called when the object is deserialized and restores the value of the sb variable. Write puts the current string value of sb into the serialization object w.

This simple but useful example shows what is necessary to create a SQLCLR aggregate. Other custom aggregates may require more complex code to implement all the required features, and you may have to use multiple class-level variables to keep track of multiple values during the course of calculation, but it really isn’t all that hard to do once you understand the basic principles. You’ll need to have a good handle on how .NET does serialization. But these techniques really become valuable when you implement your own
user-defined types in SQLCLR, which open up whole worlds of possibilities in SQL Server.

 

ldn-expertdkielyThis post is an excerpt from the online courseware for our SQL Server 2012: Advanced SQL CLR course written by expert Don Kiely. Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor and consultant who travels the country sharing his expertise in SQL Server and security.

Adobe Embraces HMTL5 – Perhaps It’s Time to Start Paying Attention

url

You know HTML5 is the hot skill of the future when even its competitors admit as much.

That’s what happened recently when Adobe, the makers of Flash – a technology whose best days are certainly behind it – ditched its mobile Flash software for HTML5.

This didn’t happen out of thin air, however. Back in 2010, Steve Jobs wrote an open letter eviscerating Flash’s deficiencies. Basically, by being a 100% proprietary piece of software, Flash significantly hampered developers. It made life quite difficult, which created the market, if you will, for while HTML5 to take over.

Not soon after, Adobe officially announced what the world already knew, that – and we quote here – HTML5 is “the best solution for creating and deploying content in the browser across mobile platforms.”

There’s still work to be done, of course. Older Web browsers like Internet Explorer may not support some components of HTML5. But when Steve Job and HTML5’s main competitor reach the same conclusion, it’s probably time to sign up for an HTML5 tutorial and get to work.

How Can You Tell if a Technology Has Arrived?

follow-the-green-fish1

There are two ways to find out what the “next big thing” will be in terms of programming languages and next-generation IT skill sets.

The first way is to read the popular IT journals; this is a piece of advice we’ve given in the past, and we’re sticking to it. That’s because magazines like Computerworld and InfoWeek provide objective forecasts around what technologies companies will adopt in the future.

The other – and more immediate way – to find out is by seeing what early adopters are doing. (Usually the best way to find this out is through the aforementioned journals.) Once the big boys start adopting a technology or standard, it’s safe to say it’s here to stay.

For example, take HTML5. Even before the standard was 100 percent complete, YouTube, Google, and Netflix adopted it and incorporated it into some applications. Never mind that full certification won’t come until 2014 – they were that excited and eager to roll it out.

This probably the best evidence yet that an HTML5 tutorial should be a key part to your career development plan.