<?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>Tara Andrei &#187; C#</title>
	<atom:link href="http://andreitara.com/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://andreitara.com</link>
	<description>I could change the world if they would let my allocate more instances of myself.</description>
	<lastBuildDate>Wed, 07 Mar 2012 21:30:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>XML serialization of objects in C# and Java</title>
		<link>http://andreitara.com/2010/10/xml-serialization-of-objects-in-c-and-java/</link>
		<comments>http://andreitara.com/2010/10/xml-serialization-of-objects-in-c-and-java/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 19:04:19 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=294</guid>
		<description><![CDATA[In this post I will explain some basic methods for creating XML serialization of objects in C# and Java but before let&#8217;s take a look and see what actually XML is and when should we use it. XML or eXtended Markup Language is as it says his name nothing more the a markup language same [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2010/10/gateau-geek-xml.jpg"><img class="alignleft size-full wp-image-300" title="gateau-geek-xml" src="http://www.andreitara.com/wp-content/uploads/2010/10/gateau-geek-xml.jpg" alt="" width="287" height="215" /></a>In this post I will explain some basic methods for creating XML serialization of objects in C# and Java but before let&#8217;s take a look and see what actually XML is and when should we use it.<br />
XML or eXtended Markup Language is as it says his name nothing more the a markup language same as HTML, but the main difference beside the possibility of creating you&#8217;re own tags, is that XML is used to structure information.<span id="more-294"></span> The posibility of structuring information made from XML a really useful tool to transport data across application that can even reside on different machines across internet, here we can remember the REST  and OData protocol. So  XML can be used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites.</p>
<p>Now that we know what is XML good for is time to get in to the business and write out first class that cam be serialized as XML.</p>
<p>C#</p>
<blockquote>
<pre escaped="true" lang="c#" line="1">using System.Xml.Serialization;
[XmlRoot(ElementName = "PersonalInformations")]

public class PersonalInformations
{
[XmlAttribute(AttributeName="name")]
public string Name { get; set; }

[XmlAttribute(AttributeName="age")]
public uint Age { get; set; }
[XmlAttribute(AttributeName="birth")]
public DateTime DateOfBirth { get; set; }

public string Adress{get;set;}

public static void StoreObject(Stream outStream, PersonalInformations obj)
{
XmlSerializer x = new XmlSerializer(typeof(PersonalInformations));
x.Serialize(outStream, obj);
}
}
public static PersonalInformations LoadObject(Stream inStream)
{
XmlSerializer x = new XmlSerializer(typeof(PersonalInformations));
return  x.Deserialize(inStream) as PersonalInformations;
}
}</pre>
</blockquote>
<p>Java</p>
<blockquote>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">@Root<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;PersonalInformations&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">class</span> PersonalInformations <span style="color: #009900;">&#123;</span>
&nbsp;
@<span style="color: #003399;">Attribute</span><span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> name<span style="color: #339933;">;</span>
&nbsp;
@<span style="color: #003399;">Attribute</span><span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;age&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> age<span style="color: #339933;">;</span>
&nbsp;
@<span style="color: #003399;">Attribute</span><span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;birth&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Date</span> dateOfBirth<span style="color: #339933;">;</span>
&nbsp;
@<span style="color: #003399;">Element</span><span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;birth&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Date</span> dateOfBirth<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> storeObject<span style="color: #009900;">&#40;</span>Stream outStream, PersonalInformations obj<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#123;</span>
      Serializer serializer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Persister<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      serializer.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>obj, outStream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> PersonalInformations loadObject<span style="color: #009900;">&#40;</span>Stream inStream<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#123;</span>
      Serializer serializer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Persister<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>PersonalInformations<span style="color: #009900;">&#41;</span> serializer.<span style="color: #006633;">read</span> <span style="color: #009900;">&#40;</span>PersonalInformations.<span style="color: #000000; font-weight: bold;">class</span>,inStream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</blockquote>
<p>In the case  of C# we made use of the classes from System.Xml.Serialization namespace, that offers a simple way to serialize classes. In case of Java we use a third part library that can be downloaded from http://simple.sourceforge.net. In both cases we annote the class fields to inform the serialization service about the way we want to create the XML.<br />
As you maybe have already noticed from this sample, XML has become more then a way to store structured information, it is actually a way to express an object state. State that can be stored or sent across applications, applications that can be write in different programming languages.</p>
<p>The goal of this post is not informing about how to serialize classes to XML but to show the simplicity and beauty of XML in communication between applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/10/xml-serialization-of-objects-in-c-and-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless signal power detector</title>
		<link>http://andreitara.com/2009/04/wireless-signal-power-detector/</link>
		<comments>http://andreitara.com/2009/04/wireless-signal-power-detector/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 20:42:31 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[signal quality and strength]]></category>
		<category><![CDATA[wireless signal]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=151</guid>
		<description><![CDATA[Zilele trecute mi-am cumparat un router wireless nou, unul care sa bata o distanta mai mare pentru a-mi oferi un grad mai mare de portabilitate, curios de performantele noului router am cautat pe net un tool care sa imi indice putere semnalului si calitatea deoarece eram nemultumit de cel existent in sistemul de operare . [...]]]></description>
			<content:encoded><![CDATA[<p>Zilele trecute mi-am cumparat un router wireless nou, unul care sa bata o distanta mai mare pentru a-mi oferi un grad mai mare de portabilitate, curios de performantele noului router am cautat pe net un tool care sa imi indice putere semnalului si calitatea deoarece eram nemultumit de cel existent in sistemul de operare . Dupa cateva minute de cautare pe google in care nu am gasit nimic (nimic care sa ma satisfaca) imi suflec manecile si ma hotarasc sa imi scriu propriul programul care sa imi calculeze calitatea si puterea semnalului, dupa cate ore de programare am schitat un programel care m-am gandit ca poate ar mai putea fi util cuiva. Daca sunteti intersati aplicatia o puteti descarca de <a href="http://www.andreitara.com/projects/wireless-signal-power-detector/">aici </a></p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2009/04/wireless-signal-power-detector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>aQua beta release -un utilitar remote desktop connection/control</title>
		<link>http://andreitara.com/2009/04/aqua-beta-release-un-utilitar-remote-desktop-connectioncontrol/</link>
		<comments>http://andreitara.com/2009/04/aqua-beta-release-un-utilitar-remote-desktop-connectioncontrol/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 13:40:58 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[microsoft remote desktop]]></category>
		<category><![CDATA[remote desktop]]></category>
		<category><![CDATA[remote desktop connection]]></category>
		<category><![CDATA[screen capture]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=128</guid>
		<description><![CDATA[In sfarsit am reusit sa imi fac timpul necersar pentru a publica primul proiect, este vorba de un utilitar ce va permite sa va conectati de oriunde si oricand la computerul de acasa/la servici si sa preluati controlul, de asemenea ar putea fi folosit ca si o unealta pentru a supraveghea activitatea ce se inteprinde [...]]]></description>
			<content:encoded><![CDATA[<p>In sfarsit am reusit sa imi fac timpul necersar pentru a publica primul proiect, este vorba de un utilitar ce va permite sa va conectati de oriunde si oricand la computerul de acasa/la servici si sa preluati controlul, de asemenea ar putea fi folosit ca si o unealta pentru a supraveghea activitatea ce se</p>
<p><a href="http://www.andreitara.com/wp-content/uploads/2009/04/11.jpg"><img class="size-medium wp-image-126 alignleft" title="aQua" src="http://www.andreitara.com/wp-content/uploads/2009/04/11-300x225.jpg" alt="" width="293" height="219" /></a><br />
inteprinde pe un calculator.<br />
Trasaturi:</p>
<blockquote><p>Criptarea traficului<br />
Suport pentru control mouse si tastatura<br />
Suport pentru WOL (wake on lan) momentan doar pentru pachet magic<br />
Calitate inalta a imaginii.</p></blockquote>
<p>Mai multe <a title="free remode tesktop tool | utilitar remote desktop" href="http://www.andreitara.com/aqua-free-remode-desktop-tool/" target="_self">aici</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2009/04/aqua-beta-release-un-utilitar-remote-desktop-connectioncontrol/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Componente vizuale in c#</title>
		<link>http://andreitara.com/2009/03/conponente-vizuale-in-c/</link>
		<comments>http://andreitara.com/2009/03/conponente-vizuale-in-c/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 11:42:50 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[component vizuala c#]]></category>
		<category><![CDATA[programare c#]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=103</guid>
		<description><![CDATA[Desi nu imi place trebuie sa reunosc ca limbajul de la Microsoft c#, principalul rival al lui Java, este o adevarata &#8220;unealta&#8221; atunci cand vine vorba de productivitate si viteza in a realiza un program, iar paltforma .net este o adevarata &#8220;lada plina de unelte&#8221; in sensul ca aici poti gasi o sumedenie de clase [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_107" class="wp-caption alignleft" style="width: 310px"><a href="http://www.andreitara.com/wp-content/uploads/2009/03/763.gif"><img class="size-medium wp-image-107" title="763" src="http://www.andreitara.com/wp-content/uploads/2009/03/763-300x210.gif" alt="C#" width="300" height="210" /></a><p class="wp-caption-text">C#</p></div>
<p>Desi nu imi  place trebuie sa reunosc ca limbajul de la Microsoft c#, principalul rival al lui Java, este o adevarata &#8220;unealta&#8221; atunci cand vine vorba de productivitate si viteza in a realiza un program, iar paltforma .net este o adevarata &#8220;lada plina de unelte&#8221; in sensul ca aici poti gasi o sumedenie de clase gata facute pentru tine ce asteapta sa le folosesti.  O sa incerca sa ilustrez cele mentionate printr-un exemplu practic si anume o componenta vizuala pe care o putem folosi ori de cate ori dorim in orice proiect. Pentru cei care au mai relizat astfel de compoente in alte limbaje cum ar fi c++ sau vb se se poate observa simplitatea cu  care realizam o munca relativ complexa daca stam sa ne gandim la principiile care stau la baza unei componente vizuale.</p>
<blockquote><p><a href="http://www.youtube.com/watch?v=3xRduR2Hqf8">Prima componenta vizuala in c#</a></p></blockquote>
<p>P.S. Pentru cei care probabil ca va inrebati de unde vine numele asta de c# (citit c sharp) iata raspunsul <a href="http://www.piano-lesson-online.com/notes-on-the-black-key1.php">aici</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2009/03/conponente-vizuale-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

