Reverse words in a string

Hi folks, I am here with another example, how to reverse words in a string or sentence? I have tried with a approach. I would welcome other approaches, please share.. ////// Complexity: O(n) + O(n)/2 ~ O(n) public static string ReverseWordsInString(string str)        {            string reverse = ReverseString(str);            string temp = “”;            foreach (string s in…

0

Reverse a string in different ways

Hi folks, I am here with another example, how to reverse a string in different ways? Below are the different ways to do it.   /// Need one extra array for result, need to traverse full array. public static string ReverseString1 (string str)        {            char[] chars = str.ToCharArray();            char[] result = new char[chars.Length];             for (int…

1

Find first non-repeated character in a string

Hi folks, This doesn’t look difficult right 🙂 however can u think of different ways to find first non-repeated character in a string? I tried 3 different ways in C#. One with O(n^2) and 2 ways with O(n). Please suggest if you can think of better ways 🙂  ///Complexity: O(n^2) public static char FirstNonRepeatedCharInString (string…

0

What’s new is VS 2013 (RC) for web developers?

Hello folks Let’s discuss some of the amazing enhancements and new features of VS 2013 (RC) in general and mostly related to web technologies. VS IDE Changes: Feedback Icon Notification symbol Sign In option to save your profile Tools->Options is now searchable and resizable  Productivity Improvements: Enhanced Scroll Bar Auto Brace Completion Move the code by…

0

How to fix error "You can’t pass property, indexer or dynamic member with out or ref parameter"

Hi Folks, I happened to encounter this trouble while trying to pass reference of a Property.  public class LinkedListQ : QNode {         private QNode head = null;         public QNode Head        {            get            {                return head;            }        }  class Program {        static void Main(string[] args)        {              LinkedListQ que = new LinkedListQ();             que.ReverseList(ref que.Head);   //Error “A property, indexer…

0

What’s new in SQL Server 2014 (CTP1)?

The release of SQL Server 2014 (CTP1) has brought good amount of new features and enhancements. Some of the notable features are presented below. Database Engine Enhancement: In-Memory OLTP for ~10X performance gains by moving most used tables into memory. Updatable and clustered column store indexes for faster retrieval. Enhanced query processing for better performance…

3

Change the default route in ASP.NET MVC

Hello folks, As we know that ASP.NET MVC by default takes following setting available in RouteConfig file (under App_Start folder).  routes.MapRoute(                name: “Default”,                url: “{controller}/{action}/{id}”,                defaults: new { controller = “Home“, action = “Index“, id = UrlParameter.Optional }            ); This means when you run the application, Home controller will be invoked and it’s Index method…

0

Limits the number of records per page in SSRS 2012.

Hello folks, While working on the requirement to fix the number of records per page in the report, I found that there is no such out of the box (OOB) property in SSRS 2012 to do so, However this can be achieved by some workarounds :). Below are the steps. Navigate to the Rows Groups section…

5

Difference between Direct casting, is and as operator in C#

Hi guys, below are the available ways in C# when you cast one data type to another.     Direct casting Direct cast is most common way of casting one type to another, however it yields exception if casting can’t be done. Below is the example to demonstrate the same. object length = 3.2; int…

2

WPF Data Grid tips

Hi folks, While working on WPF, I came to know some good Data grid tips and wanted to share you the same. Issue: WPF Data Grid is not reflecting the changed Item Source.            Solution: If using MVVM pattern, Refresh the item source by below command.            CollectionViewSource.GetDefaultView(<Your Data Grid collection name>).Refresh();   Issue: How…

0