Welcome to the Technical Blog!

In this blog, I will be publishing articles, news links, video tutorials, podcasts and solutions and some new project ideas that I am working on or are of interest to me and to people in general as well. This section will include tips and tricks for many commonly occurring problems related to so many day to day happenings.

A lot of the work may be featuring projects related to computers, softwares, electronics and basically the Engineering theme in general but there will a lot of articles on the general problem solving skills as well.

Keep Connected and do let me know if you are liking my blog by any means you want. (Comment on the blogs will be the best way :) )

InboxPays

C# Reverse String

July 26th, 2017

C# Tips & Tricks: String Reversal

Unfortunately, C#'s string class is missing a Reverse() function, so here are three ways to reverse strings:

1. Manual Reversal

The most obvious way is to reverse a string by manually walking through it character for character and building a new string:

Code

string input = "hello world";

Code

string output = "";

Code

for (int i = input.Length - 1; i >= 0; i--)

Code

{

Code

output += input[i];

Code

}

Note that if you take this approach in a serious program, you should use StringBuilder instead of string, since in the above code, a new temporary string is created each time you add a single character to the output string.

2. Array.Reverse()

The second way we can reverse a string is with the static Array.Reverse() method:

string input = "hello world";
char[] inputarray = input.ToCharArray();
Array.Reverse(inputarray);
string output = new string(inputarray);

First we convert the string to a character array, then we revert the array, and finally we construct a new string from the array.

3. LINQ

LINQ allows us to shorten string reversal into a one-liner:

Code

string input = "hello world";

Code

string output = new string(input.ToCharArray().Reverse().ToArray());

First the string is again converted to a char array. Array implements IEnumerable, so we can call LINQ's Reverse() method on it. With a call to ToArray() the resulting IEnumerable is then again converted to a char array, which is used in the string constructor.

For maximum convenience, we can create an extension method on string to do the reversal:

static class StringExtensions { public static string Reverse(this string input) { return new string(input.ToCharArray().Reverse().ToArray()); } }

With this class in our code, we can now easily reverse any string:

Console.WriteLine("hello world".Reverse());

Please be aware however, that all of the above methods for string reversal only work with 16 bit Unicode characters, which fit into one char variable. If you need to reverse strings that include extended Unicode chars, for example chinese kanji, look here.

Path Variable: Its importance and use

December 9th, 2014

Example:

C:Program FilesCommon FilesMicrosoft SharedWindows Live;

C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;

C:ProgramDataOracleJavajavapath;C:Program Files (x86)InteliCLS Client;

C:Program FilesInteliCLS Client;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32\Wbem;

C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;

C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;

C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;

C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;

C:Program FilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;

C:Program FilesLenovoFingerprint Manager Pro;

C:Program Files (x86)Common Files\Lenovo;

C:SWTOOLSReadyApps;

C:Program FilesMicrosoftWeb Platform Installer;

C:Program Files (x86)Microsoft SDKsAzureCLIwbin;%systemroot%System32WindowsPowerShellv1.0\;

C:Program FilesMicrosoft SQL Server110ToolsBinn;

C:Program Files (x86)Windows Live\Shared;

%systemroot%System32WindowsPowerShellv1.0;

C:Program FilesMicrosoft SQL ServerClient SDKODBC110ToolsBinn;

C:Program Files (x86)Microsoft SQL Server120ToolsBinnManagementStudio\;

C:Program Files (x86)Microsoft SQL Server120ToolsBinn;

C:Program FilesMicrosoft SQL Server120ToolsBinn;

C:Program Files (x86)Microsoft SQL Server120DTSBinn;

C:Program FilesMicrosoft SQL Server120DTSBinn

Best Practices in Inventory Management

December 8th, 2014
Where your company stands on inventory management tells a lot about your success or, potentially, the lack thereof. If you're doing a good job, the manufacturing organization can depend on having the right materials on hand when it needs them. Do a poor job, and there’s no end to the problems. A company that lacks control over inventory may be caught short of stock, leading to lost sales opportunities and disappointed customers. On the other hand, you may end up with an over abundance of certain items, which inflates storage costs and dampens profitability. Visibility ranks as a top issue when it comes to inventory. However, seat-of-the-pants, manual inventory tracking prevents CFOs from obtaining a detailed picture of what’s happening within their companies. It's hard to understate the importance of best practices for inventory management. A Bain & Company article, which originally appeared on WSJ.com, points out that “getting inventory levels right is vital since it not only controls costs but also serves as a barometer of a company’s overall health.” With that in mind, here are five inventory management best practices: 1. Categorize your inventory Portions of your inventory will move faster than others and, therefore, require a different management approach. Indeed, the 80-20 rule applies to the items you stock, so it's a good idea to categorize inventory and set priorities accordingly. For example, you might want to make sure you have a bigger stock buffer for your fastest moving items. Slower moving items may call for less security. This best practices inventory management approach is sometimes referred to as ABC analysis. Sales numbers are often associated with ABC analysis, but profitability is another way to prioritize. The NAW Institute for Distribution Excellence, for example, cites inventory stratification based on gross margin return on inventory investment as a best practice. 2. Focus on demand forecasting Your company’s demand fluctuates due to seasonality, the economic climate and other business trends. A solid forecasting capability can help you plan inventory and maintain appropriate levels, avoiding excess inventory or shortages. Your company can study past sales trends to determine likely future patterns and align inventory management policies to reflect those expected patterns. But there are other techniques to consider such as qualitative assessment and the time series method, according to Forecastingmethods.net. 3. Apply automation Smaller manufacturing companies, in particular, may track inventory via multiple spreadsheets and lack a unified view of stocking levels. A centralized inventory management system, a module included in many ERP products, provides a way to keep accurate inventory counts, deal with unexpected events, avoid overstock situations and boost inventory efficiency. An ERP suite can also automate such tasks as demand forecasting and ABC analysis. Such systems represent the systems side of best practices for inventory management. 4. Look for underlying problems Those who overlook history are bound to repeat it, so the saying goes. That line of thinking holds true for inventory management. If you find that a certain item is perpetually in oversupply, get to the heart of the matter. Bain & Company suggests performing “root-cause analysis on excess and obsolete stock” and understanding how those stocks are connected to action plans for combating future excesses. 5. Consider alternative inventory models Inventory management covers an array of models, so it makes sense to evaluate new approaches from time to time. If your organizations finds it difficult to keep tabs on a certain item, approaches such as vendor-managed inventory (VMI), for instance, can help you share the burden. With VMI, a vendor offers to stock a certain part or product at the manufacturer’s location. The vendor is essentially on the hook for maintaining the proper inventory levels. Inventory Issues What best practices for inventory management do you currently follow? Are you looking into new methods or automation? Leave your comments below.
ozlu Sozler GereksizGercek Hava Durumu Firma Rehberi Tv de bugun E-okul Veli Firma Rehberi