Searching for lines in text file containing a specific string can be very handy with below code snippet. This method is very optimal specially if we are accessing log/error/access files.
public static IEnumerable<string> ReadAndFilter(this FileInfo info, Predicate<string> condition)
using (var reader = new StreamReader(info.FullName))
while ((line = reader.ReadLine()) != null)
yield return line;
//FilePath is a string variable containing path of file
//SearchString is string to be searched
var result = new FileInfo(FilePath).ReadAndFilter(s => s.Contains(SearchString));
The method can be further improvised to search lines in text files with in a directory containing the specific string.
foreach (string file in Directory.GetFiles(path, "*.txt").Select(Path.GetFullPath))
var result = new FileInfo(file).ReadAndFilter(s => s.Contains(SearchString));
foreach (string line in result)
Yes, you read it right – Issue resolution is an art. It needs a skill, imagination & thought process. Issue resolution is not about getting list of issues and just start resolving them one by one until list is finished; its the most unskilled way of resolving issues. Resolving Production issues was one of a …
Continue reading “Issue Resolution is an ART!!”
Packet analyzers (also known as protocol analyzer) are computer programs that can intercept and log traffic passing over a digital network or part of a network. These are very handy tool in web development & analytics as they can do post-mortem of all your Request & Response and provide you a detail information while interacting …
Continue reading “Packet Analyzers”
Below is the list of some good & free online tools that can assist you in web development in ways like validation & optimization: Front-end tools: JS Beautifier – Beautify, unpack or deobfuscate JS, HTML, JSON etc and make them readable JSON validator – help with debugging JSON and making them readable HTML Formatter – …
Continue reading “Some must-have & free online development tools”
Thinking of scripting a way to open URL directly from command script of batch file?? Here is a cool way to open the URLs, type below rundll32 command on the prompt on Windows machine & press Enter: rundll32 url.dll, FileProtocolHandler “http://www.technowide.net” References: http://support.microsoft.com/kb/164787 Enjoy!!
Only less than 20% of overall response time is spent downloading actual HTML document; rest over 80% of time is consumed downloading components associated on the page. Strange? but its true. And if we further drill down the scenario here, we would find that the HTML generated for most of dynamic website are actually through …
Continue reading “Website Performance: Golden rule”
You can explicitly tell IE browsers to use its latest available rendering engine using a meta tag. This also prevents IE to open Quirks mode while rending page. You need to add below meta tag at page level to accomplish this.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
In above meta tag, IE=edge tells IE to use its latest rendering engine. …
Continue reading “Forcing IE browsers to behave properly??”
URL building is a key factor in improving usability and search-engine rankings of your application. Read more on how to make your URLs Clean and Human-Friendly.
Broken links or 404 errors on your website is one of the most annoying experience from user perspective. This may discourage user to return to your website which is not good for Marketing/Branding. From developer or owner end, it may not be easy to keep track of all broken links every time the website content …
Continue reading “Tracking Broken Links”
Adobe’s Day CQ5 is based on below underlying technologies including: Apache Sling – web application framework for content-centric applications, using a JavaContent Repository, such as Apache Jackrabbit or CRX. It is based on REST principles to provide easy development of content-oriented applications. OSGi (Apache Felix) – an application framework & dynamic module system for Java …
Continue reading “Day CMS: Architecture Stack”
Sometimes, its annoying that you do web login to a tool, do your stuff and while committing the changes your session expires; probably you need to do the same stuff again. And eventually then you realized that you haven’t done any activity on the Web page which is required to make your web session remain …
Continue reading “Automate URL-based sessions”
Continue reading “Input type File validation – Client side”