Overview of XML programming in Dot Net #24

Overview of XML programming in Dot Net

XML DOM(Document Object Model)

Three ways to read XML documents in dot net are: XML DOM, SAX, XMLReader.DOM loads entire XML data into memory for processing, it is both read-write, I mean you can change XML data and save. DOM uses data-structures to represent the data in the RAM.

SAX does not load all XML data in memory rather processes sequentially. SAX is good for just reading large XML file/data but as it does not store the data in the RAM and does not use any data structure, it can not perform complex operations(search) on the data.

XmlReader class of the .net framework can also be used to read and process xml data. It provides read only and forward only access.

How XML DOM works?

The root node of an XML document is represented by the XmlDocument. XmlDocument is derived from XmlNode class. XmlDocument provides methods such as Load(Load XML data from file), LoadXml(takes XML string as parameter to load), and Save(to save XML data into a file). Also, you can use XmlDocument to traverse through the XML data and process/print

Example code:Vb.net

dim xmlDo as New XmlDocument

xmlDoc.load(emp.xml);//or xmlDoc.loadXml(“”);

Console.WriteLine(xmlDoc.InnerXml.ToString)

xmlDoc.save(“newDoc.xml”);

C#

XmlDocument xmlDoc = New XmlDocument();

xmlDoc.load(emp.xml);//or xmlDoc.loadXml(“”);

Console.WriteLine(xmlDoc.InnerXml.ToString())

xmlDoc.save(“newDoc.xml”);

Parsing an XML document

————————

C#

count=0;

i=1;

XmlNode node=xmlDoc.ChildNodes[1];

foreach(XmlNode node1 in node.ChildNodes)

{

foreach(XmlNode node2 in node1.ChildNodes)

{

Console.WriteLine(xmlDoc.DocumentElement.FirstChild.ChildNodes[count].Name+”:”+node2.FirstChild.Value); count = count + 1;

}

i=i+1;

count=0;

}

count =0

i=1

dim node1 as XmlNode;

node1 = xmlDoc.ChildNodes(1)

foreach node1 in node1.ChildNodes

dim node2 as XmlNode

foreach node2 in node1.ChildNodes

xmlDoc.DocumentElement.FirstChild.ChildNodes(count).Name +”:”+node2.FirstChild.value

next

i=1+1

count=0

next

———- From: http://sitestree.com/?p=4747
Categories:24
Tags:
Post Data:2011-04-21 04:17:46

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Quick guide to RPM (Red Hat Package Manager) #26

Quick Guide to RPM

RPM-Red Hat Package Manager

Caldera, Suse, Fedora also use RPM

  1. rpm -qa | more

to check the installed software in the system

q=query

a=list

  1. rpm -qi faq

Query individual package

q=query

i=requires a package name

faq=the package

  1. rpm -ql faq

List all the files for the package faq

q=query

l=list files

faq=package name

  1. rpm -ivh xapp-1.1.0.i386.rpm

install a package

i=install

v=verbose

h=show progress with hash

  1. rpm -e faq

remove package

-e = erase

  1. rpm -e –nodeps faq

erase without checking any dependancy

may cause some other packages to fail

  1. rpm -Va

Verify all of the files on your system.

  1. rpm -qf /usr/bin/uptime

check a file for its source/package

  1. rpm -ivh –force pack-1.0.0.i386.rpm

sometimes you will need it. When you go to install, you may get ‘already installed’ message, if you want to remove you may get ‘not installed’ message, –force is the solution.

  1. rpm -ivh –nodeps pack-1.0.0.i386.rpm

install without checking dependencies

[may not be a very good thing sometimes] From: http://sitestree.com/?p=4750
Categories:26
Tags:
Post Data:2006-11-30 22:11:36

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Build RPM Package #26

Check the tutorial below for a detail discussionhttp://www.rpm.org/max-rpm/ From: http://sitestree.com/?p=4749
Categories:26
Tags:
Post Data:2010-08-25 17:48:18

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How to create a RPM package in Linux #26 #RHCSA

How to create a RPM package in Linux

Creating basic installation RPM package is really easy. You just have to use rpmbuild command. rpmbuild will be applied to your source files and a RPM package will be created [all source files will be included in the RPM package]. Somewhere you need to specify the path of your source files. Just before creating the RPM package, your source files will be copied to a temporary location [termed as Build Root]. Actually, you need to write a spec file. rpmbuild will read that file to extract parameters and will act based on the parameter values.

Sample RPM Package

Summary: A summary description of the software.
Name: xyz
Version: 1.0.0
Release: 1
Group: System Environment/Base
BuildRoot: /var/tmp/%{name}-buildroot
Prefix:/opt/xyz
%description
Description of your software
%pre%prep%build%installrm -rf /opt/xyz/$RPM_BUILD_ROOTmkdir -p /opt/xyz/$RPM_BUILD_ROOT/dir1mkdir -p /opt/xyz/$RPM_BUILD_ROOT/dir2cp -r your_source_files_path/* /opt/xyz/$RPM_BUILD_ROOT/%post%cleanrm -rf /opt/xyz/$RPM_BUILD_ROOT%files%defattr(-,root,root)/opt/xyz/dir1/opt/xyz/dir2

In the example, BuildRoot is assigned to: /var/tmp/%{name}-buildroot. %install section is doing the building/creation of the RPM package. From Summary to %description are the headers to specify different information as the names indicate. %install section is creating the directories needed and copying your source files to BuildRoot directory(cp -r your_source_files_path/* /opt/xyz/$RPM_BUILD_ROOT/). %files section specifies where rpm package will install your software.%clean section just cleans the BuildRoot directory after the RPM package is created.

Just a note: As I mentioned Prefix to be /opt/xyz, I provided /opt/xyz in the paths. If you keep Prefix to be null, then you need to remove /opt/xyz from the paths. You can place shell commands under %pre section. These command will run just before the RPM package is being installed(using rpm -i command). Under %post section, you can also place some shell commands that will run immediately after the software installation(using rpm -i command). You can use %preor %post section for operations like creating databases, users, and assigning permissions

This may not be 100% perfect. I did not test it on any system, but it should be almost ok. For another example, please visit: http://www.redhat.com/magazine/002dec04/features/betterliving-part2/

The spec file should have name of type name-version_release.spec. After creating the spec file, run the command rpmbuild -ba the_spec_file_name. It will create rpm packages under /usr/src/redhat/BUILD/x86_64 and /usr/src/redhat/SRPMS. You need to copy the spec file under /usr/src/redhat/SPECS/

To install the created RPM package, use rpm -ivh rpmpackagename.rpm command. Look %files section to know where the software will be installed. You can change the path using commands like:rpm -ivh –prefix /opt/rty/ rpmpackagename.rpm. Check our guide on rpm command From: http://sitestree.com/?p=4751
Categories:26, RHCSA
Tags:
Post Data:2009-01-06 06:48:45

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Overview on Windows Azure Cloud – Demo for inside Azure – what can you do with Windows Azure #27

Overview on Windows Azure Cloud – Demo for inside Azure – what can you do with Windows Azure. Overview on Windows Azure Cloud – Demo for inside Azure – what can you do with Windows Azure From: http://sitestree.com/?p=5347
Categories:27
Tags:
Post Data:2008-03-19 09:38:37

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Overview on Windows Azure Cloud – Demo for inside Azure – what can you do with Windows Azure #27

Overview on Windows Azure Cloud – Demo for inside Azure – what can you do with Windows Azure[youtube https://www.youtube.com/watch?v=QIjLPa0moNo?feature=player_detailpage&w=640&h=360] From: http://sitestree.com/?p=5346
Categories:27
Tags:
Post Data:2011-12-04 04:42:32

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Web Hosting Companies #27

Best Hosting Companies

I was searching for a suitable webhosting for me. Until now features and cost wise I liked HostGator, VodaHost, HostMonster, BlueHost. Yahoo is another one I like but pricy. I am into hostgator and vodahost mainly. Though, vodahost has some bad reputation and their customer support may not be great. Just few other hosting companies are below. They are also very popular with huge customers. They may be better than Hostgator or Vodahost or HostMonster for you but for me I am sticking with HostGator[Do not have much experience with their customer support though]. It’s really difficult to come up with the best.

From: http://sitestree.com/?p=4753
Categories:27
Tags:
Post Data:2011-05-18 09:29:31

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How to be a SEO Consultant? What do you need to know? #28

How to be a SEO Consultant? What do you need to know?…………………………………………

Note 1: Some information are taken from the Book ‘Search Engine Optimization – Bible’

Note 2: The guide is no way complete. It is not well formatted yet (actually, it’s an ongoing slide). Just use it to know what to learn and to get an introduction on the related topics.

From: http://sitestree.com/?p=5289
Categories:28
Tags:
Post Data:2013-04-30 00:14:51

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How is the Price of Social Networking site Determined? #28

If you have no idea on it, then the following will give you just an idea. Simply, you can think it as follows (just the basics):

  • 1. Take the Number of registered users
  • 2. Only 3 to 10% registered users are usually active (actively participate in the site)
  • 3. Think about the number of registered users growing every day/month/year
  • 4. Also, think about the non-registered visitors every day/month/year
  • 5. For the 3 to 10% of the real/actual visitors, for each visitor calculate $10/year to $20/year of revenue = the value of the social networking site (for one year)

From: http://sitestree.com/?p=5273
Categories:28
Tags:
Post Data:2011-03-30 03:14:40

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Resources for Online Publishing: How to Earn Revenue from Online Advertising: Tools for the Online Publishing #28

Resources for Online Publishing: How to Earn Revenue from Online Advertising: Tools for the Online Publishing

Just some great discussions that you can check

From: http://sitestree.com/?p=5251
Categories:28
Tags:
Post Data:2012-11-15 19:08:32

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>