<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Razazwork</title>
	<atom:link href="http://razazwork.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://razazwork.com</link>
	<description>Xtreme Development Resources,Software Security Products</description>
	<lastBuildDate>Thu, 13 Jan 2011 07:37:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Modify Table Fields / Coulmns in Oracle 10g</title>
		<link>http://razazwork.com/microsoft-dot-net/create-field-coulmn-on-table-in-oracle-10g/</link>
		<comments>http://razazwork.com/microsoft-dot-net/create-field-coulmn-on-table-in-oracle-10g/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 12:51:36 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[DataBase]]></category>
		<category><![CDATA[Add Field to Database Table]]></category>
		<category><![CDATA[DataBase Coulmn]]></category>
		<category><![CDATA[Oracle 10G]]></category>
		<category><![CDATA[RDBMS Oracle 10g]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=173</guid>
		<description><![CDATA[While Working with Microsoft Database its really easy to create Table(s) and fields with visual Designer(s). On oracle you have to do it all manually by hand. Use Alter Keyword to Modify a Table. To Run Queries you have to execute  SQL Plus that comes with oracle. The Query Below would add a field &#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>While Working with Microsoft Database its really easy to create Table(s) and fields with visual Designer(s). On oracle you have to do it all manually by hand.</p>
<p><span id="more-173"></span></p>
<p>Use <strong>Alter</strong> Keyword to Modify a Table. To Run Queries you have to execute  SQL Plus that comes with oracle.</p>
<p><strong>The Query Below would add a field &#8221; Identifier&#8221; of var chart type  to Table Mapping<br />
</strong></p>
<blockquote><p>Add Field or Column to Data Base Table Use Alter Keyword with <strong>Add</strong></p>
<p>ALTER TABLE MAPPING</p>
<p>ADD (Identifier varChar (255));</p></blockquote>
<p><strong>To Drop existing Field From table Use Drop Keyword,</strong></p>
<blockquote><p>ALTER TABLE MAPPING</p>
<p>drop (Identifier );</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/create-field-coulmn-on-table-in-oracle-10g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linq in simple english</title>
		<link>http://razazwork.com/microsoft-dot-net/linq-in-simple-english/</link>
		<comments>http://razazwork.com/microsoft-dot-net/linq-in-simple-english/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 06:53:53 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Linq to Object]]></category>
		<category><![CDATA[Visual Studios 2008]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=168</guid>
		<description><![CDATA[Linq is an interesting extension to C sharp 3.0, with linq we can query objects, sql and xml inline with ease. Lets say you have a list of generic collection you can query this collection with linq and create small result set out of this list as in example // we use Collection Initialize var [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Linq</strong> is an interesting extension to C sharp 3.0, with linq we can query objects, sql and xml inline with ease.</p>
<p><span id="more-168"></span></p>
<p style="text-align: left;">Lets say you have a list of generic collection you can query this collection with linq and create small result</p>
<p style="text-align: left;">set out of this list as in example</p>
<p style="text-align: left;">
<pre class="brush:csharp">// we use Collection Initialize

var PeopleList = new List&lt;String&gt; {"Ali", "Ahemed", "Anwar", "Khan", "Saleem"};

// Here comes Linq Query to extract name start with A in collection List PeopleList

var PeoplewhoseNamestartswithA = from ppl in PeopleList where ppl.StartsWith("A") select new {Name = ppl.TrimEnd()};

//Name is the variable that keep hold of the Names it could be any thing //

foreach (var ppA in PeoplewhoseNamestartswithA)
{

// Accessing item in SubList

MessageBox.Show(ppA.Name);

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/linq-in-simple-english/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy WCF Service on Freshly Installed Windows 2003 Server</title>
		<link>http://razazwork.com/microsoft-dot-net/deploy-wcf-service-on-freshly-installed-windows-2003-server/</link>
		<comments>http://razazwork.com/microsoft-dot-net/deploy-wcf-service-on-freshly-installed-windows-2003-server/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 09:36:56 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Aspx Page Not Found]]></category>
		<category><![CDATA[Deploy WCF Service on Windows 2003]]></category>
		<category><![CDATA[Wcf Error File Not Found]]></category>
		<category><![CDATA[Windows 2003]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=162</guid>
		<description><![CDATA[You may get a Page cannot be found message when you browse Wcf Service .svc file in a freshly installed Windows Server 2003 environment. That is because in Windows 2003, all the webservice extensions are &#34;Prohibited&#34; by default to ensure security. so to Deploy WCF Service on Freshly Installed Windows 2003 Machine Use the instructions [...]]]></description>
			<content:encoded><![CDATA[<p>You may get a Page cannot be found message when you browse Wcf Service .svc file in a freshly installed Windows Server 2003 environment.</p>
<p>	<span id="more-162"></span><br />
	That is because in Windows 2003, all the webservice extensions are &quot;Prohibited&quot; by default to ensure security. so to Deploy WCF Service on Freshly Installed Windows 2003 Machine Use the instructions given below.</p>
<p><font color="#000080" face="Tahoma" size="2">1. From your Run command, type inetmgr and press enter.<br />
	2. Expand the appropriate nodes in the IIS to locate the &quot;Webservice Extensions&quot; Node<br />
	3. Click on the same.<br />
	4. You will find a list of &quot;prohibited&quot; extensions in the right.<br />
	5. Click on ASP.NET and &quot;allow&quot; it</font></p>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/deploy-wcf-service-on-freshly-installed-windows-2003-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn Your List of Collection Class to DataTable</title>
		<link>http://razazwork.com/microsoft-dot-net/turn-your-list-of-collection-class-to-datatable/</link>
		<comments>http://razazwork.com/microsoft-dot-net/turn-your-list-of-collection-class-to-datatable/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 07:49:20 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[.Net Collection to DataTable]]></category>
		<category><![CDATA[C# Generics Conversion]]></category>
		<category><![CDATA[Collection class to datatable]]></category>
		<category><![CDATA[List to DataTable]]></category>
		<category><![CDATA[Visual Studios 2008]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=153</guid>
		<description><![CDATA[Some Time we need to turn a collection of Class to Data table Well its Easy in C# 3 just call this method of static Class make sure your class holds properties not fields. var Data=new List { new MailingList("A.R", "Suite 102", "Karachi", "Pakistan"), new MailingList("Umair Butt", "Suite 106", "Karachi", "Pakistan"), new MailingList("Afzal Hussain", "Suite [...]]]></description>
			<content:encoded><![CDATA[<p>Some Time we need to turn a collection of Class to Data table Well its Easy in C# 3 just call this method of static Class make sure your class holds properties not fields.</p>
<p><span id="more-153"></span></p>
<pre class="brush:csharp">var Data=new List
{
new MailingList("A.R", "Suite 102", "Karachi", "Pakistan"),
new MailingList("Umair Butt", "Suite 106", "Karachi", "Pakistan"),
new MailingList("Afzal Hussain", "Suite 109", "Karachi", "Pakistan"),
new MailingList("Saleem Khan", "Suite 108", "Karachi", "Pakistan")
};

DataTable dt = GenericCollectionToDataTable.ConvertTo(Data);

public class GenericCollectionToDataTable
{
///

/// Default Constructor
///

private GenericCollectionToDataTable()
{ }
///

///
///

/// Custome Class
///
List Of The Custome Class
/// Return the class datatbl
public static DataTable ConvertTo(IList lst)
{
//create DataTable Structure
DataTable tbl = CreateTable();
Type entType = typeof(T);

PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entType);
//get the list item and add into the list
foreach (T item in lst)
{
DataRow row = tbl.NewRow();
foreach (PropertyDescriptor prop in properties)
{
row[prop.Name] = prop.GetValue(item);
}
tbl.Rows.Add(row);
}

return tbl;
}

///

///
///

/// Custome Class
///
private static DataTable CreateTable()
{
//T –&gt; ClassName
Type entType = typeof(T);
//set the datatable name as class name
DataTable tbl = new DataTable(entType.Name);
//get the property list
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entType);
foreach (PropertyDescriptor prop in properties)
{
//add property as column
tbl.Columns.Add(prop.Name, prop.PropertyType);
}
return tbl;
}
}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/turn-your-list-of-collection-class-to-datatable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Extract All Pdf Form Fields Using iTextSharp</title>
		<link>http://razazwork.com/microsoft-dot-net/c-extract-all-pdf-form-fields-using-itextsharp/</link>
		<comments>http://razazwork.com/microsoft-dot-net/c-extract-all-pdf-form-fields-using-itextsharp/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 11:36:55 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[C# List Pdf Form Fields]]></category>
		<category><![CDATA[Extract Information from Pdf File]]></category>
		<category><![CDATA[IText Sharp]]></category>
		<category><![CDATA[Pdf Form Fields]]></category>
		<category><![CDATA[Read All Form Fields]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=145</guid>
		<description><![CDATA[Extract All Form Fields From Pdf File Using C # and IText Sharp Library private void ListPdfFormFields() { string pdfTemplate = Application.StartupPath + "\\a.pdf"; lstfields.Items.Clear(); // create a new PDF reader based on the PDF template document PdfReader pdfReader = new PdfReader(pdfTemplate); // create and populate a string builder with each of the // field [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Extract All Form Fields From Pdf File Using C # and IText Sharp Library</strong></p>
<p><strong><span id="more-145"></span><br />
</strong></p>
<pre class="brush:csharp">private void ListPdfFormFields()
{

string pdfTemplate = Application.StartupPath + "\\a.pdf";

lstfields.Items.Clear();

// create a new PDF reader based on the PDF template document

PdfReader pdfReader = new PdfReader(pdfTemplate);

// create and populate a string builder with each of the

// field names available in the subject PDF

foreach (DictionaryEntry de in pdfReader.AcroFields.Fields)
{

var currentfield =
de.Key.ToString();

currentfield = ParseFormField(currentfield);
lstfields.Items.Add(currentfield);

}

lstfields.Sorted = true;

}

private string ParseFormField(string fieldname)
{
fieldname = fieldname.Replace("form1[0].#subform[0].", "");
fieldname = fieldname.Replace("[0]", "");
fieldname.TrimEnd();
return fieldname;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/c-extract-all-pdf-form-fields-using-itextsharp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compressing and Decompressing Your Files C#</title>
		<link>http://razazwork.com/microsoft-dot-net/compressing-and-decompressing-your-files-c/</link>
		<comments>http://razazwork.com/microsoft-dot-net/compressing-and-decompressing-your-files-c/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 17:54:12 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=124</guid>
		<description><![CDATA[Use the System.IO.Compression.DeflateStream or the System.IO.Compression. GZipStream classes to read and write compressed data to a file using a “chunking” routine. The CompressFile method accepts a path to the source file to compress, a path to the destination of the compressed file, and a CompressionType enumeration value indicating which type of compression algorithm to use [...]]]></description>
			<content:encoded><![CDATA[<p>Use the System.IO.Compression.DeflateStream or the System.IO.Compression.<br />
GZipStream classes to read and write compressed data to a file using a “chunking”<br />
routine.</p>
<p><span id="more-124"></span></p>
<p style="text-align: justify;">The <strong>CompressFile</strong> method accepts a path to the source file to compress, a path to the<br />
destination of the compressed file, and a CompressionType enumeration value indicating<br />
which type of compression algorithm to use (Deflate or GZip). This method produces<br />
a file containing the compressed data.<br />
The <strong>DecompressFile</strong> method accepts a path to the source compressed file to decompress,<br />
a path to the destination of the decompressed file, and a CompressionType enumeration<br />
value indicating which type of decompression algorithm to use (Deflate or GZip)</p>
<p style="text-align: justify;">
<pre class="brush:csharp">/// &lt;summary&gt;
/// Compress the source file to the destination file.
/// This is done in 1MB chunks to not overwhelm the memory usage.
/// &lt;/summary&gt;
/// &lt;param name="sourceFile"&gt;the uncompressed file&lt;/param&gt;
/// &lt;param name="destinationFile"&gt;the compressed file&lt;/param&gt;
/// &lt;param name="compressionType"&gt;the type of compression to use&lt;/param&gt;
public static void CompressFile(string sourceFile,
string destinationFile,
CompressionType compressionType)
{
if (sourceFile != null)
{
FileStream streamSource = null;
FileStream streamDestination = null;
Stream streamCompressed = null;
try
{
streamSource = File.OpenRead(sourceFile);
streamDestination = File.OpenWrite(destinationFile);
// read 1MB chunks and compress them
long fileLength = streamSource.Length;
// write out the fileLength size
byte[] size = BitConverter.GetBytes(fileLength);
streamDestination.Write(size, 0, size.Length);

long chunkSize = 1048576; // 1MB
while (fileLength &gt; 0)
{
// read the chunk
byte[] data = new byte[chunkSize];
streamSource.Read(data, 0, data.Length);
// compress the chunk
MemoryStream compressedDataStream =
new MemoryStream( );
if (compressionType == CompressionType.Deflate)
streamCompressed =
new DeflateStream(compressedDataStream,
CompressionMode.Compress);
else
streamCompressed =
new GZipStream(compressedDataStream,
CompressionMode.Compress);
using (streamCompressed)
{
// write the chunk in the compressed stream
streamCompressed.Write(data, 0, data.Length);
}
// get the bytes for the compressed chunk
byte[] compressedData =
compressedDataStream.GetBuffer( );
// write out the chunk size
size = BitConverter.GetBytes(chunkSize);
streamDestination.Write(size, 0, size.Length);
// write out the compressed size
size = BitConverter.GetBytes(compressedData.Length);
streamDestination.Write(size, 0, size.Length);
// write out the compressed chunk
streamDestination.Write(compressedData, 0,
compressedData.Length);
// subtract the chunk size from the file size
fileLength -= chunkSize;
// if chunk is less than remaining file use
// remaining file
if (fileLength &lt; chunkSize)
chunkSize = fileLength;
}
}
finally
streamSource.Close( );
streamDestination.Close( );
}
}
}
/// &lt;summary&gt;
/// This function will decompress the chunked compressed file
/// created by the CompressFile function.
/// &lt;/summary&gt;
/// &lt;param name="sourceFile"&gt;the compressed file&lt;/param&gt;
/// &lt;param name="destinationFile"&gt;the destination file&lt;/param&gt;
/// &lt;param name="compressionType"&gt;the type of compression to use&lt;/param&gt;
public static void DecompressFile(string sourceFile,
string destinationFile,
CompressionType compressionType)
{
FileStream streamSource = null;
FileStream streamDestination = null;
Stream streamUncompressed = null;
try
{
streamSource = File.OpenRead(sourceFile);
streamDestination = File.OpenWrite(destinationFile);
// read the fileLength size
// read the chunk size
byte[] size = new byte[sizeof(long)];
streamSource.Read(size, 0, size.Length);
// convert the size back to a number
long fileLength = BitConverter.ToInt64(size, 0);
long chunkSize = 0;
int storedSize = 0;
while (fileLength &gt; 0)
{
// read the chunk size
size = new byte[sizeof(long)];
streamSource.Read(size, 0, size.Length);
// convert the size back to a number
chunkSize = BitConverter.ToInt64(size, 0);
if (chunkSize &gt; fileLength ||
chunkSize &gt; workingSet)
throw new InvalidDataException( );
// read the compressed size
size = new byte[sizeof(int)];
streamSource.Read(size, 0, size.Length);
// convert the size back to a number
storedSize = BitConverter.ToInt32(size, 0);

Compressing and Decompressing Your Files | 485
if (storedSize &gt; fileLength ||
storedSize &gt; workingSet)
throw new InvalidDataException( );
if (storedSize &gt; chunkSize)
throw new InvalidDataException( );
byte[] uncompressedData = new byte[chunkSize];
byte[] compressedData = new byte[storedSize];
streamSource.Read(compressedData, 0,
compressedData.Length);
// uncompress the chunk
MemoryStream uncompressedDataStream =
new MemoryStream(compressedData);
if (compressionType == CompressionType.Deflate)
streamUncompressed =
new DeflateStream(uncompressedDataStream,
CompressionMode.Decompress);
else
streamUncompressed =
new GZipStream(uncompressedDataStream,
CompressionMode.Decompress);
using (streamUncompressed)
{
// read the chunk in the compressed stream
streamUncompressed.Read(uncompressedData, 0,
uncompressedData.Length);
}
// write out the uncompressed chunk
streamDestination.Write(uncompressedData, 0,
uncompressedData.Length);
// subtract the chunk size from the file size
fileLength -= chunkSize;
// if chunk is less than remaining file use remaining file
if (fileLength &lt; chunkSize)
chunkSize = fileLength;
}
}
finally
{
streamSource.Close( );
streamDestination.Close( );
}
}
public enum CompressionType
{
Deflate,
GZip
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/compressing-and-decompressing-your-files-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Hack Proof !</title>
		<link>http://razazwork.com/featured/be-hack-proof/</link>
		<comments>http://razazwork.com/featured/be-hack-proof/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 19:00:32 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=76</guid>
		<description><![CDATA[Defend your privacy the ultimate way never being victim of hacking or internet security threat. Protect yourself from intruders, hackers, malicious internet Attacks. stay secure for ever ! Be Hack proof. KeyGuard protects you from Every malicious threat that target user privacy by stealing sensitive information from User system such as Password(s), email Access credentials [...]]]></description>
			<content:encoded><![CDATA[<p>Defend your privacy the ultimate way never being victim of hacking or internet security threat. Protect yourself from intruders, hackers, malicious internet Attacks. stay secure for ever ! Be Hack proof. KeyGuard protects you from Every malicious threat that target user privacy by stealing sensitive information from User system such as Password(s), email Access credentials and other confidential information</p>
<p><span id="more-76"></span></p>
<p>&nbsp;</p>
<p><a class="small blue button" href="http://www.hackproofsecurity.com"><span>Read More</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/featured/be-hack-proof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://razazwork.com/uncategorized/hello-world/</link>
		<comments>http://razazwork.com/uncategorized/hello-world/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 06:26:18 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/uncategorized/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Programming</title>
		<link>http://razazwork.com/articles/introduction-to-programming/</link>
		<comments>http://razazwork.com/articles/introduction-to-programming/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 13:50:44 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=114</guid>
		<description><![CDATA[Programming is a very natural and intuitive concept. A program is nothing more than a series of statements written in a specific language. Programs are everywhere, and even the technophobes of the world use programs every day. Driving directions, cooking recipes, football plays, and DNA are all programs that exist in the lives and even [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 13pt; font-family: Arial;"><span style="font-weight: normal; font-size: 10pt; color: black; font-style: normal; font-family: Arial; text-decoration: none;">Programming is a very natural and intuitive concept. A program is nothing more than a series of statements written in a specific language. Programs are everywhere, and even the technophobes of the world use programs every day. Driving directions, cooking recipes, football plays, and DNA are all programs that exist in the lives and even the cellular makeup of people everywhere.<br />
	<span id="more-114"></span><br />
	A typical &quot;program&quot; for driving directions might look something like this:</p>
<p>	&quot;Start out down Main Street headed east. Continue on Main until you see a&nbsp;Market on your right. If the street is blocked because of construction, turn right there at 15th street, turn left on Pine Street, and then turn right on 16th street. Otherwise, you can just continue and make a right on 16th street. Continue on 16th street and turn left onto Destination Road. Drive straight down Destination Road for 5 miles and then the house is on the right. The address is 743 Destination Road. &quot;</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>	Anyone who knows English can understand and follow these driving directions; they&#39;re written in English. Granted, they&#39;re not eloquent, but each instruction is clear and easy to understand, at least for someone who reads English.</p>
<p>	But a computer doesn&#39;t natively understand English; it only understands machine language . To instruct a computer to do something, the instructions must be written in its language. However, machine language is arcane and difficult to work with. Machine language consists of raw bits and bytes, and it differs from architecture to architecture. So to write a program in machine language for an Intel x86 processor, one would have to figure out the value associated with each instruction, how each instruction interacts, and a myriad of other low-level details. Programming like this is painstaking and cumbersome, and it is certainly not intuitive.</p>
<p>	What&#39;s needed to overcome the complication of writing machine language is a translator. An assembler is one form of machine-language translator: It is a program that translates assembly language into machine-readable code. Assembly language is less cryptic than machine language, because it uses names for the different instructions and variables, instead of just using numbers. However assembly language is still far from intuitive. The instruction names are very esoteric and the language is still architecture-specific. This means that just as machine language for Intel x86 processors is different from machine language for Sparc processors, x86 assembly language is different from Sparc assembly language. Any program written using assembly language for one processor&#39;s architecture will not work in another processor&#39;s architecture. If a program is written in x86 assembly language, it must be rewritten to run on Sparc architecture. In addition, to write an effective program in assembly language, one must still know many low-level details of that processor&#39;s architecture.</p>
<p>	These problems can be mitigated by yet another form of translator called a compiler . A compiler converts a high-level language into machine language. High-level languages are much more intuitive than assembly language and can be converted into many different types of machine language for different processor architectures. This means that if a program is written in a high-level language, the program only needs to be written once, and the same piece of program code can be compiled by a compiler into machine language for various specific architectures. C, C++, and FORTRAN are all examples of high-level languages.</p>
<p>	A program written in a high-level language is much more readable and English-like than assembly language or machine language, but it still must follow very strict rules about how the instructions are worded or the compiler won&#39;t be able to understand it.</p>
<p>	Programmers have yet another form of programming language called pseudo-code. Pseudo-code is simply English arranged with a general structure similar to a high-level language. It isn&#39;t understood by compilers, assemblers, or any computers, but it is a useful way for a programmer to arrange instructions. Pseudo-code isn&#39;t well defined. In fact, many people write pseudo-code slightly differently. It&#39;s sort of the nebulous missing link between natural languages, such as English, and high-level programming languages, such as C. The driving directions from before, converted into pseudo-code, might look something like this:</p>
<p>	<font style="background-color: rgb(255, 255, 0);"><strong>Begin going east on Main street;<br />
	Until (there is a&nbsp;market on the right)<br />
	{<br />
	Drive down Main;<br />
	}<br />
	If (street is blocked)<br />
	{<br />
	Turn(right, 15th street);<br />
	Turn(left, Pine street);<br />
	Turn(right, 16th street);<br />
	}<br />
	else<br />
	{<br />
	Turn(right, 16th street);<br />
	}<br />
	Turn(left, Destination Road);<br />
	For (5 iterations)<br />
	{<br />
	Drive straight for 1 mile;<br />
	}<br />
	Stop at 743 Destination Road;</strong><br />
	</font><font size="+0">Each instruction is broken down</font> into its own line, and the control logic of the directions has been broken down into control structures. Without control structures, a program would just be a series of instructions executed in sequential order. But our driving directions weren&#39;t that simple. They included statements like, &quot;Continue on Main until you see a church on your right&quot; and &quot;If the street is blocked because of construction &hellip; .&quot; These are known as control structures , and they change the flow of the program&#39;s execution from a simple sequential order to a more complex and more useful flow.</p>
<p>	In addition, the instructions to turn the car are much more complicated than just &quot;Turn right on 16th street.&quot; Turning the car might involve locating the correct street, slowing down, turning on the blinker, turning the steering wheel, and finally speeding back up to the speed of traffic on the new street. Because many of these actions are the same for any street, they can be put into a function . A function takes in a set of arguments as input, processes its own set of instructions based on the input, and then returns back to where it was originally called. A turning function in pseudo-code might look something like this:</p>
<p>	<strong><font style="background-color: rgb(255, 255, 0);">Function Turn(the_direction, the_street)<br />
	{<br />
	locate the_street;<br />
	slow down;<br />
	if(the_direction == right)<br />
	{<br />
	turn on the right blinker;<br />
	turn the steering wheel to the right;<br />
	}<br />
	else<br />
	{<br />
	turn on the left blinker;<br />
	turn the steering wheel to the left;<br />
	}<br />
	speed back up<br />
	};</font><br />
	</strong><br />
	By using this function repeatedly, the car can be turned on any street, in any direction, without having to write out every little instruction each time. The important thing to remember about functions is that when they are called the program execution actually jumps over to a different place to execute the function and then returns back to where it left off after the function finishes executing.</p>
<p>	One final important point about functions is that each function has its own context. This means that the local variables found within each function are unique to that function. Each function has its own context, or environment , which it executes within. The core of the program is a function, itself, with its own context, and as each function is called from this main function, a new context for the called function is created within the main function. If the called function calls another function, a new context for that function is created within the previous function&#39;s context, and so on. This layering of functional contexts allows each function to be somewhat atomic.</p>
<p>	The control structures and functional concepts found in pseudo-code are also found in many different programming languages. Pseudo-code can look like anything, but the preceding pseudo-code was written to resemble the C programming language. This resemblance is useful, because C is a very common programming language. In fact, the majority of Linux and other modern implementations of Unix operating systems are written in C. Because Linux is an open source operating system with easy access to compilers, assemblers, and debuggers, this makes it an excellent platform to learn from. For the purposes of this book, the assumption will be made that all operations are occurring on an x86-based processor running Linux.<br />
	</span></span></p>
<p><span style="font-size: 10pt; font-family: Arial;"><span style="font-weight: normal; font-size: 10pt; color: black; font-style: normal; font-family: Arial; text-decoration: none;"><strong><em><br />
	</em></strong></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/articles/introduction-to-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding the Location of All Occurrences of a String Within Another String C#</title>
		<link>http://razazwork.com/microsoft-dot-net/finding-the-location-of-all-occurrences-of-a-string-within-another-string-c/</link>
		<comments>http://razazwork.com/microsoft-dot-net/finding-the-location-of-all-occurrences-of-a-string-within-another-string-c/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 18:35:45 +0000</pubDate>
		<dc:creator>sarn</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://razazwork.com/?p=136</guid>
		<description><![CDATA[Using IndexOf or IndexOfAny in a loop, you can determine how many occurrences of a character or string exist as well as their locations within the string. To find each occurrence of a string in another string using a case-sensitive search using System; using System.Collections; using System.Collections.Generic; static class CharStrExtMethods { public static int[] FindAll(this [...]]]></description>
			<content:encoded><![CDATA[<p>Using IndexOf or IndexOfAny in a loop, you can determine how many occurrences of<br />
a character or string exist as well as their locations within the string. To find each<br />
occurrence of a string in another string using a case-sensitive search</p>
<p><span id="more-136"></span></p>
<pre class="brush:csharp">using System;
using System.Collections;
using System.Collections.Generic;
static class CharStrExtMethods
{
public static int[] FindAll(this string matchStr, string searchedStr,
int startPos)
{
int foundPos = -1; // -1 represents not found.
int count = 0;
List&lt;int&gt; foundItems = new List&lt;int&gt;( );
do
{
foundPos = searchedStr.IndexOf(matchStr, startPos, StringComparison.
Ordinal);
if (foundPos &gt; -1)
{
startPos = foundPos + 1;
count++;
foundItems.Add(foundPos);
Console.WriteLine("Found item at position: " + foundPos.
ToString( ));
}
} while (foundPos &gt; -1 &amp;&amp; startPos &lt; searchedStr.Length);
return ((int[])foundItems.ToArray( ));
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://razazwork.com/microsoft-dot-net/finding-the-location-of-all-occurrences-of-a-string-within-another-string-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

