Google today launched version 2.0 of its Android Studio integrated development environment (IDE) for writing apps for its mobile operating system. Android Studio, which is based on IntelliJ, launched back in 2013 and came out of beta a year ago. It includes everything a developer needs to build an app, including a code editor, code analysis tools, emulators for all of Google’s Android platforms, and more. The new version is now available as a preview in the Canary release channel of Android Studio. With version 2.0, as Google’s group product…
Month: November 2015
Implementing the Inversion of Control Pattern in C#
Implement the inversion of control pattern is linked with the Dependency Injection Principle states. Here we analyse a simple implementation
How to generate a random password
These code samples demonstrate how to generate a strong random password, which does not contain ambiguous characters (such as [1,l,I] or [O,0]). A strong password must be at least eight characters long and contain a combination of lower- and upper-case letters, numbers, and special characters. /////////////////////////////////////////////////////////////////////////////// // SAMPLE: Generates random password, which complies with the strong password // rules and does not contain ambiguous characters. // // To run this sample, create a new Visual C# project using the Console // Application template and replace the contents of the Class1.cs…
How to use REPLACE() within NTEXT columns in SQL Server
SQL has an incredibly useful function, REPLACE(), which replaces all occurrences of a specified string with another string, returning a new string. It works great with all forms of NCHAR and NVARCHAR fields. It does not, however, work with NTEXT fields. Fear not — there’s an easy workaround, thanks to type-casting and SQL 2005’s NVARCHAR(max) datatype. Here’s the process in an nutshell. Cast the NTEXT field to the NVARCHAR(max) datatype using the CAST function. Perform your REPLACE on the output of #1. Cast the output of #2 back to NTEXT.…