Reading and Writing XML in C#

In this article, you will see how to read and write XML documents in Microsoft .NET using C# language.  First, I will discuss XML .NET Framework Library namespace and classes. Then, you will see how to read and write XML documents. In the end of this article, I will show you how to take advantage of ADO.NET and XML .NET model to read and write XML documents from relational databases and vice versa. Introduction to Microsoft .NET XML Namespaces and Classes Before start working with XML document in .NET Framework, It…

Read More

Windows and OS X are malware, claims Richard Stallman

Linux GNU firebrand Richard Stallman says Windows and Apple’s OS X are malware, Amazon is Orwellian, and anyone who trusts the internet-of-things is an ass. In a column for The Guardian Stallman preaches to the non-technical masses about the evils of proprietary software and vendor lock-in, and how closed-door coding facilitates clandestine deals with nation state spy agencies. “What kinds of programs constitute malware? Operating systems, first of all,” Stallman testifies. “Apple systems are malware too: MacOS snoops and shackles; iOS snoops, shackles, censors apps and has a backdoor. “Even…

Read More

Enable your device for development

Important  Currently you cannot enable devices installed with Windows 10 Insider Preview with the System Setting Developer Mode controls as outlined in this article. This feature is not currently supported, but will be enabled in a future release of Windows 10. So you don’t need to follow the steps in the future approach in this article. But you must follow the links directly below to enable your specific Windows 10 device. Windows 10 Phone: Register your phone to enable developer mode using the existing Windows Phone 8.1 tools Windows 10…

Read More

Chart.js Asp.net : Create Pie chart with database jQuery Ajax C#

This article explains using Chart.js in Asp.net C# Web Application we can create a pie chart with database MS SQL server connectivity via jQuery ajax call.  You can also have a look on related article, . Now in this post here we create a pie chart by using chart.js library and bind data from our database MS Sqlserver, with jQuery ajax calling. Here we are creating a pie chart, which shows data from the database (Ms SQL server).  In my database, I have a table which stores data (website traffic…

Read More

Encrypting QueryStrings with .NET

Once upon a time in the tech world, obscurity was security – this being most true in the early years of the industry, when there were gaping holes in privacy policies and confidential client information was bandied about from site to site without a care as to who actually could read the information. With the new Cryptography classes in .NET, there’s absolutely no excuse for not hiding even the most innocuous user data. If you ever need to ‘piggy-back’ information from one web page to another, whether it is within…

Read More

DateDiff() function in C#

I have written the following DateDiff() function in C#. VB.NET users already had it using the Micrsoft.VisualBasic.dll assembly. Now you can use it without referencing this ‘ugly’ extra assembly. using System; namespace PureSourceCode.System { public enum DateInterval { Year, Month, Weekday, Day, Hour, Minute, Second } public class DateTimeUtil { public static long DateDiff(DateInterval interval, DateTime date1, DateTime date2) { TimeSpan ts = date2 – date1; switch (interval) { case DateInterval.Year: return date2.Year – date1.Year; case DateInterval.Month: return (date2.Month – date1.Month) + (12 * (date2.Year – date1.Year)); case DateInterval.Weekday: return…

Read More

Use a reuseIdentifier Where Appropriate

A common mistake in app development is not setting the correct reuseIdentifier for UITableViewCells, for UICollectionViewCells, or even UITableViewHeaderFooterViews. For maximum performance, a table view’€™s data source should generally reuse UITableViewCell objects when it assigns cells to rows in tableView:cellForRowAtIndexPath:. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse.What happens if you don’t use a reuseIdentifier? If you don’t, your table view will configure a brand-new cell each time a row is displayed. This is an expensive operation and will…

Read More