<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>exception &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/exception/</link>
	<description>Feed of posts on WordPress.com tagged "exception"</description>
	<pubDate>Mon, 08 Sep 2008 17:49:11 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Why Rape Isn't a Good Reason for Abortion]]></title>
<link>http://littlehumans.wordpress.com/?p=83</link>
<pubDate>Sat, 06 Sep 2008 15:50:20 +0000</pubDate>
<dc:creator>Mike</dc:creator>
<guid>http://littlehumans.wordpress.com/?p=83</guid>
<description><![CDATA[One of the stories coming out of the convention  is that the GOP adopted a stance on abortion that w]]></description>
<content:encoded><![CDATA[<p>One of the <a href="http://littlehumans.wordpress.com/2008/09/03/gop-adopts-unconditional-stance-against-abortion/">stories coming out of the convention </a> is that the GOP adopted a stance on abortion that was tougher than what John McCain has taken.  Namely, the GOP platform does not believe that rape or incest is a valid reason (aka excuse) for abortion.  Unfortunately, many pro-life advocates (and politicians) believe that any law limiting abortion should contain exceptions for rape or incest.  <a href="http://abort73.com/HTML/I-D-5-rape.html">Abort73.com presents the case</a> against using rape as an excuse for abortion:</p>
<blockquote><p>Let's say the woman does carry her child to term and decides to raise her daughter herself. After five years, however, she decides that the little girl's presence in her life is too much of a burden. Should that mother have the right to kill her five year-old daughter who was born to her as a result of sexual assault?</p>
<p>Obviously not. No matter what the circumstances are regarding the little girl's conception, she is a human being with a right to life that cannot be taken away from her. But what about before she is born, does this change anything? No, it doesn't. Abortion is an act of violence that kills a living human being. The circumstances surrounding the conception do not change this simple reality. Rape and abortion share this in common. They are both acts of violent assault against an innocent victim. Aborting a child conceived through rape simply extends this pattern of violence and victimhood. It does not "unrape" the woman, but it will almost certainly increase her regret and misery. Whereas rape is an act of violence for which she bears no responsibility, abortion is an act of violence for which she would be morally culpable. Consider the following email, received by Abort73 on January 19, 2007: </p>
<p>I just wanted to say that I am so pleased to read your stance on abortion in the case of rape. My mother was a 14-year-old girl who was raped, and she tried to have an abortion. The only reason I am alive today is because the doctor miscalculated her due date and thought she was too far in the pregnancy to have the abortion, when in reality he was a month off (this actually happened twice). It pains me every time I hear even die hard pro-lifers say "except in the case of rape". I know it is traumatizing for a girl or woman that is raped to have to carry a child, but it is no more traumatizing than someone who gets shot during a violent attack and has to deal with those wounds. Counseling and therapy can help heal the trauma, but the trauma will be there whether she has the abortion or not, and the abortion could even make it worse. It has caused me so much anxiety over the years to think that many pro-lifers would have approved of my mother's abortion. By the way, she gave me up for adoption, and my adoptive parents were never able to have children. Thank you so much for this wonderful view against abortion even in the case of rape. </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Fazendo unit test usando Doctrine no symfony 1.1]]></title>
<link>http://patrickespake.wordpress.com/?p=118</link>
<pubDate>Mon, 01 Sep 2008 19:26:12 +0000</pubDate>
<dc:creator>patrickespake</dc:creator>
<guid>http://patrickespake.wordpress.com/?p=118</guid>
<description><![CDATA[Algumas vezes é necessário fazer testes de unidades para verificar o funcionamento da camada de mo]]></description>
<content:encoded><![CDATA[<p>Algumas vezes é necessário fazer testes de unidades para verificar o funcionamento da camada de model no symfony.</p>
<p>Você pode criar um arquivo no diretório test/unit do seu projeto, por exemplo: meutesteTest.php.</p>
<p>Nesse arquivo você deve inicializar as configurações do symfony e banco de dados, da seguinte forma:</p>
<p>[sourcecode language="php"]<br />
<?php</p>
<p>require_once(dirname(__FILE__).'/../../../config/ProjectConfiguration.class.php');<br />
$configuration = new ProjectConfiguration();<br />
include($configuration->getSymfonyLibDir().'/vendor/lime/lime.php');<br />
$appcfg = $configuration->getApplicationConfiguration('cron', 'dev', true);<br />
$databaseManager = new sfDatabaseManager($appcfg);</p>
<p>$t = new lime_test(1, new lime_output_color());</p>
<p>try {</p>
<p>  $produtos = Doctrine::getTable('produtos')->find(1);</p>
<p>  $t->pass("Consulta realizada com sucesso.");</p>
<p>} catch (Exception $e) {</p>
<p>  $t->fail("Consulta falhou.");</p>
<p>}<br />
[/sourcecode]</p>
<p>Para rodar o teste de unidade execute:</p>
<p>[sourcecode language="bash"]<br />
symfony test:unit meuteste<br />
[/sourcecode]</p>
<p>O symfony irá executar o teste de unidade e mostrar se foi realizado com sucesso ou sem sucesso.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[city v country in the friendliness stakes]]></title>
<link>http://cityterer.wordpress.com/?p=7</link>
<pubDate>Fri, 29 Aug 2008 08:28:08 +0000</pubDate>
<dc:creator>cityterer</dc:creator>
<guid>http://cityterer.wordpress.com/?p=7</guid>
<description><![CDATA[i really felt for her. she’s not very assertive, as she admitted. she comes from the country and a]]></description>
<content:encoded><![CDATA[<p>i really felt for her. she’s not very assertive, as she admitted. she comes from the country and at one stage, she said that people from the country are much friendlier than in the city. i took exception to that. i said that i didn’t ...<br>passthepopcorn.wordpress.com</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Silverlight custom fonts - How to and issues.]]></title>
<link>http://agkdesign.wordpress.com/?p=278</link>
<pubDate>Wed, 20 Aug 2008 04:38:23 +0000</pubDate>
<dc:creator>agkdesign</dc:creator>
<guid>http://agkdesign.wordpress.com/?p=278</guid>
<description><![CDATA[I have been working on a few projects lately, one of them requiring a custom font to be embedded int]]></description>
<content:encoded><![CDATA[<p>I have been working on a few projects lately, one of them requiring a custom font to be embedded into the Silverlight application. It's really simple to do.</p>
<p>Open your project in Visual Studio. First thing is to add the new font to your project.</p>
<p><a href="http://agkdesign.files.wordpress.com/2008/08/additem.jpg"><img class="alignnone size-medium wp-image-279" src="http://agkdesign.wordpress.com/files/2008/08/additem.jpg?w=300" alt="" width="300" height="166" /></a></p>
<p>Right click your project in the tree &#62; Add &#62; New Item and select the font from the browser. (Note: You can't add a font while it sits within your windows folder, copy the font out of the folder to your desktop or something to add it.)</p>
<p>once the font is in the tree, right click it and go to properties.</p>
<p><a href="http://agkdesign.files.wordpress.com/2008/08/properties.jpg"><img class="alignnone size-medium wp-image-280" src="http://agkdesign.wordpress.com/files/2008/08/properties.jpg?w=280" alt="" width="280" height="180" /></a></p>
<p>Build action = Content<br />
Copy to Output Directory = Copy if newer</p>
<p>So they should now include your font into the project when you build it.</p>
<p>Next up is to put it into the XAML.</p>
<p><span style="color:#339966;"> &#60;TextBlock<br />
Height="29.5"<br />
Text="INFUSION"<br />
TextWrapping="Wrap"<br />
Width="114.417"<br />
FontSize="24" </span><br />
<span style="color:#ff0000;">FontFamily="./GOTHIC.TTF#Century Gothic"</span><span style="color:#339966;"><br />
/&#62;</span></p>
<p>and TADAHHH! Custom font in your Silverlight app.</p>
<p>So that was pretty simple hey, but there is a problem with it.</p>
<p>If you use Expression Blend to make your Silverlight apps you will run into some issues with using custom fonts. Its a bug that seems to cause a lot of trouble when using custom fonts in your application.</p>
<p>If you try to edit your project in Blend you will probably get this error</p>
<p><a href="http://agkdesign.files.wordpress.com/2008/08/sl_exception.jpg"><img class="alignnone size-medium wp-image-281" src="http://agkdesign.wordpress.com/files/2008/08/sl_exception.jpg?w=300" alt="" width="300" height="88" /></a></p>
<p>You can simply get rid of this error by building the project, but you will notice that when it was loaded in blend, it was loaded as a WPF application and not Silverlight, so you don't have the state manager and your project tree is empty. So you can edit your current application, but you cannot add new items to it.</p>
<p>The only way around this is to remove the references to the new font in your application until you have finished your application, then add the font references (or you can just comment them out).</p>
<p>So now you can have all your completely outlandish fonts in your applications and its still real text, not pictures!!! Totally sweet.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[C'mon lets do that generic, it would be pretty [cuil]]]></title>
<link>http://fbthomas.wordpress.com/?p=14</link>
<pubDate>Tue, 05 Aug 2008 18:51:20 +0000</pubDate>
<dc:creator>fbthomas</dc:creator>
<guid>http://fbthomas.wordpress.com/?p=14</guid>
<description><![CDATA[passing an exception and not knowing how many are still out there until your process is going throug]]></description>
<content:encoded><![CDATA[<p>passing an exception and not knowing how many are still out there until your process is going through - this is normal Developing in these  generic  projects.</p>
<p>Today i clicked on the little green arrow .... -&#62; and BOOOOOOOOOOOOOOOOOOOOOOOM there was a result. Unbelievable. There wasn't anything before more beautiful than this tiny little print Message.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Encore.]]></title>
<link>http://chloebyduke.wordpress.com/?p=5</link>
<pubDate>Mon, 04 Aug 2008 21:24:16 +0000</pubDate>
<dc:creator>chloedargelos</dc:creator>
<guid>http://chloebyduke.wordpress.com/?p=5</guid>
<description><![CDATA[Je ne promets rien, je ne fais que tenter. Essayer encore de m&#8217;accorder à cet espace qui semb]]></description>
<content:encoded><![CDATA[<p style="text-align:justify;">Je ne promets rien, je ne fais que tenter. Essayer encore de m'accorder à cet espace qui semble trop grand pour moi, immensément vide et qu'il faudrait emplir jour après jour de l'écume de mes journées.<br />
Ou peut-être me trompé-je.<br />
J'ai laissé en friches l'autre espace qui ne me convenait plus. J'ai voulu marquer une étape, un changement dans ma vie personnelle et mon écriture, puisqu'elles sont intrinsèquement liées. Comme lorsque je change de carnet et mets alors fin à un cycle, à une période, un amour, une tranche de vie et d'écriture, à des tâtonnements.<br />
J'ai très envie d'aborder ce renouveau avec plus de liberté, plus d'insouciance aussi, me risquer à la fiction, admettre que tout est inventé trafiqué modelé par l'écriture et la conscience écrivante.</p>
<p style="text-align:justify;">Ces derniers mois ont été décisifs -  du moins je le crois. J'ai perdu un amour très fort, et avec lui toutes mes armes pour me battre. Je n'ai plus la force de lutter contre l'autre, je ne peux plus m'exténuer, me faire croire que tout ira bien du moment que Le garçon est près de moi. ça ne marche pas. Jusqu'ici je ne voyais dans ma douleur que celle d'avoir été flouée par un amant - maintenant je comprends que je lui volais aussi sa liberté, que je refusais sa douleur sous prétexte qu'il devait être assez fort pour supporter.</p>
<p style="text-align:justify;">En ce moment je suis un peu perdue, je réfléchis, j'hésite. Je voudrais faire les bons choix, ne pas écorcher des personnes auxquelles je tiens. Je n'aime pas bousculer les autres pour me faire une place, je déteste déranger. Alors je m'adapte constamment. Je suis une sorte de caméléon depuis toujours, et j'ai fini par apprécier cette aptitude en prenant conscience des facilités qu'elle pouvait m'apporter. Partout, je semble capable de déceler ce qui pourra être le germe d'un rapprochement, avec presque n'importe qui. Je suis passe-partout. Seules certaines de mes amies connaissent mes emportements et mes faiblesses, mes souffrances et mes contradictions. Mes rêves.</p>
<p style="text-align:justify;">Cette capacité d'adaptation m'a poussée à la méfiance, à l'observation. Ma mère me racontait souvent cette anecdote : lorsque j'étais en Maternelle à l'école publique de Saint-Germain-Des-Prés, la maitresse avait remarqué que j'avais passé un mois à regarder et observer les autres enfants avant de me rapprocher de certains d'entre eux.<br />
Déjà une certaine exigence.<br />
J'ai le sentiment d'avoir gardé cette exigence, l'impression d'être un peu en-dehors, de ne pas faire partie du monde, et c'est ce qui m'a poussée à écrire. D'abord écraser ma souffrance, le dégoût face à mon corps ; puis les passions naissantes, le Bleu.</p>
<p style="text-align:justify;">Voilà, j'écris pour tout ça. Le Bleu, les corps, les pleurs étouffés, l'enfance.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Société Générale-Les prêts à la consommation]]></title>
<link>http://multibanques.wordpress.com/?p=60</link>
<pubDate>Mon, 04 Aug 2008 01:22:57 +0000</pubDate>
<dc:creator>Martin</dc:creator>
<guid>http://multibanques.wordpress.com/?p=60</guid>
<description><![CDATA[
Les prêts à la consommation vous permettent de financer tous vos projets (à l&#8217;exception de]]></description>
<content:encoded><![CDATA[<p><a href="http://multibanques.files.wordpress.com/2008/08/societe_generale_logosvg.png"><img class="alignleft size-medium wp-image-61" src="http://multibanques.wordpress.com/files/2008/08/societe_generale_logosvg.png?w=250" alt="" width="250" height="50" /></a></p>
<p>Les prêts à la consommation vous permettent de financer tous vos projets (à l'exception des opérations de nature immobilière) tels que l'acquisition d'un véhicule, l'achat d'un ordinateur, le financement d'un voyage ou les études de vos enfants. Vous n'avez aucun justificatif à fournir sur la nature de vos dépenses.<a href="http://www.multibanques.com/?p=193" target="_blank">Plus+</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cînd stăpînul nu-i acasă...]]></title>
<link>http://curmarin.wordpress.com/?p=5</link>
<pubDate>Fri, 01 Aug 2008 07:15:47 +0000</pubDate>
<dc:creator>rinatbictaghirov</dc:creator>
<guid>http://curmarin.wordpress.com/?p=5</guid>
<description><![CDATA[Cînd stăpînul nu-i acasă şoarecii joacă pe masă&#8230;
Au trecut 2 săptămîni  de cînd Fa]]></description>
<content:encoded><![CDATA[<p>Cînd stăpînul nu-i acasă şoarecii joacă pe masă...</p>
<p>Au trecut 2 săptămîni  de cînd Fabio ne-a părăsit...</p>
<p>Aceasta se simte foarte bine...</p>
[caption id="attachment_6" align="aligncenter" width="300" caption="CruiseControl madness"]<a href="http://curmarin.files.wordpress.com/2008/08/cc.png"><img class="size-thumbnail wp-image-6" src="http://curmarin.wordpress.com/files/2008/08/cc.png?w=300" alt="CruiseControl madness" width="300" height="200" /></a>[/caption]
<p>Rinat are varianta lui:</p>
<p style="text-align:center;">
[caption id="attachment_36" align="aligncenter" width="300" caption="Waitnig for Fabio"]<a href="http://curmarin.files.wordpress.com/2008/08/cc21.png"><img class="size-medium wp-image-36" src="http://curmarin.wordpress.com/files/2008/08/cc21.png?w=300" alt="Waitnig for Fabio" width="300" height="220" /></a>[/caption]
]]></content:encoded>
</item>
<item>
<title><![CDATA[pick up your microphone...]]></title>
<link>http://butletsbeserious.wordpress.com/?p=11</link>
<pubDate>Mon, 28 Jul 2008 10:32:15 +0000</pubDate>
<dc:creator>butletsbeserious</dc:creator>
<guid>http://butletsbeserious.wordpress.com/?p=11</guid>
<description><![CDATA[Always on the look out for a new paradigm to explain the current situation, the rhythms, repetitions]]></description>
<content:encoded><![CDATA[<p>Always on the look out for a new paradigm to explain the current situation, the rhythms, repetitions and distortions in the political world. The state of emergency seemed as good as any. And, plus, many respected academics seem to agree! So we can rest easy with that decision, for now.</p>
<p>In the US, at least, we seem to live in a world filled with extraordinary threats. By contrast, extraordinary opportunities are running short, as that would imply that the ordinary opportunities we, as Americans, enjoy (or used to), are insufficient. But once we eliminate these threatening distractions, we can get back to all the things that traditional American values have to offer. The Green World of the Clinton years, where the only distraction from making money off of Oracle and Microsoft was the opportunity to chide our president for a common marital indiscretion. Trust me, reality TV will never compare to the rising tide of affluence and political boredom that lay behind that spectacle. Tila Tequila just isn't as much fun when your favorite hedge fund is tanking, live, on MSNBC.</p>
<p>Those days will be back, though. Once the Chinese and the Middle East are under control, Europe stops rankling about our GM agriculture, and Africa stops chafing our collective conscience... But who can deliver us?</p>
<p>Right administration is no longer the province of the government (the executive in particular). Rather, we must choose a leader with the qualities to guide us through this dark time: character, judgment, heroism, patriotism, courage. Obama, or McCain? Where is our Pericles, our Caesar? Who will rally us to defeat our enemies (who even lurk among us)? Perhaps we are right to look for something closer to a monarch than a bureaucrat.</p>
<p>I guess that line from Schmitt got me (and everyone else) all tied in knots: "sovereign is he who decides on the state of exception". A description of the political landscape. But as a contingent one, it leads me to some potentially irritating questions.</p>
<p>But how did we come to this place, the new state of emergency? What's it like to live here? What sustains it? And will we ever leave?</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Basic Object-Oriented Concepts ]]></title>
<link>http://vsreddy.wordpress.com/?p=73</link>
<pubDate>Thu, 24 Jul 2008 08:37:03 +0000</pubDate>
<dc:creator>Venkat Shiva Reddy</dc:creator>
<guid>http://vsreddy.wordpress.com/?p=73</guid>
<description><![CDATA[
How People Understand Technology 
How People Approach Object-Oriented Technology 
Object-Oriented T]]></description>
<content:encoded><![CDATA[<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">How People Understand Technology </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">How People Approach Object-Oriented Technology </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Object-Oriented Terms and Concepts </span></span>
<ul type="circle">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Objects </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Classes, Metaclasses, Parameterized Classes, and Exemplars </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Black Boxes and Interfaces </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Aggregation </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Specialization and Inheritance </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Abstract Classes </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Operations </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Constants </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Exceptions </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Object Coupling and Object Cohesion </span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Systems of Objects </span></span></li>
</ul>
</li>
</ul>
<h3 style="margin:auto 0;"><a name="hput"><span style="font-family:&#34;"><span style="font-size:medium;">How People Understand Technology</span></span></a><span style="font-family:&#34;"><span style="font-size:medium;"> </span></span></h3>
<h1 style="margin:auto 0;"><a name="hput"><span style="font-family:'Verdana','sans-serif';">How People Understand Technology</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">There is an old story of how several blind men set out to understand what an elephant was by examining a live specimen. Each of them explored a different part of the elephant's body. One blind man, falling against the elephant's side, proclaimed that an elephant must be very much like a wall. Another, grasping the elephant's ear, decided that an elephant must closely resemble a leaf. One grabbed the elephant's tail and determined that elephants must resemble ropes. Yet another felt the elephant's leg and came away convinced that elephants are very much like trees. Still another held the elephant's trunk and exclaimed that elephants had much in common with snakes.</span></span></p>
<p style="text-align:center;" align="center"> <a href="http://vsreddy.wordpress.com/files/2008/07/pic11.png"><img class="aligncenter size-medium wp-image-74" src="http://vsreddy.wordpress.com/files/2008/07/pic11.png?w=300" alt="" width="300" height="161" /></a></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:&#34;"><span style="font-size:small;">While there was at least a grain of truth in each blind man's observation, none of them had a complete and accurate understanding of just what an elephant is. We can imagine the many animated debates that these blind men had when they compared notes -- each sure that the others must be wrong.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Often, people studying technology are like the blind men in our story. It is very common to focus intently on one facet of one aspect of a technology while ignoring the vast breadth of the same technology. There is nothing wrong with this -- unless a person studying the facet begins to think that he or she has somehow acquired a good grasp of the entire technology.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">To acquire an in-depth understanding of a technology requires a great deal of research. The sheer bulk of material that must be examined is daunting. The task is further complicated by the unfortunate errors contained in many discussions. Even if an individual can assimilate a large quantity of material and easily identify any errors, there is still the process of analyzing what has been assimilated. To truly understand a technology, an individual must be able to recognize valid patterns, and to easily spot invalid patterns.</span></span></p>
<h3 style="margin:auto 0;"><a name="hpaoot"><span style="font-family:&#34;"><span style="font-size:medium;">How People Approach Object-Oriented Technology</span></span></a><span style="font-family:&#34;"><span style="font-size:medium;"> </span></span></h3>
<h1 style="margin:auto 0;"><a name="hpaoot"><span style="font-family:'Verdana','sans-serif';">How People Approach Object-Oriented Technology</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">Object-oriented technology is both immense and far-reaching. End users of computer systems and computer-based systems notice the effects of object-oriented technology in the form of increasingly easy-to-use software applications and operating systems and in more flexible services being provided by such industries as banking, telecommunications, and cable television. For the software engineer, object-oriented technology encompasses object-oriented programming languages, object-oriented development methodologies, management of object-oriented projects, object-oriented computer hardware, and object-oriented computer aided software engineering, among others.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">It is not surprising, therefore, that there is some confusion regarding object-oriented terms and concepts. In this article, we will provide the reader with working definitions for object-oriented terms and concepts that are necessary for a reader to acquire a basic understanding of object-oriented technology.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Many of the terms commonly used in object-oriented technology were originally used to describe object-oriented programming (coding) concepts. Specifically, although the terms were borrowed from a non-computer-software perspective, they were first used extensively to describe concepts embodied in object-oriented programming languages, such as Smalltalk, C++, and Eiffel. However, these terms are quite useful even if one never intends to write any software at all.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">For example, an industrial modeler could create an object-oriented model of a plastics manufacturing facility. Molding machines, plastic parts, and even the "recipes" (proportional combinations) of the chemicals used to create the various plastics could all be described in object-oriented terms. Further, dynamic and static relationships among these items could also be described in object-oriented terms.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Finally, keep in mind that there is no one ultimate set of definitions for object-oriented terms and concepts. Depending on who you are talking to, terms and definitions will vary slightly. This is normal; in different parts of the United States, the same breakfast item might be referred to as a pancake, a griddle cake, a flapjack, or a hot cake. Even in technical arenas, this variation in terminology is common. A chemist might use the terms "valance" and "oxidation state" to identify the same concept.</span></span></p>
<h3 style="margin:auto 0;"><a name="ootc"><span style="font-family:&#34;"><span style="font-size:medium;">Object-Oriented Terms and Concepts</span></span></a></h3>
<h1 style="margin:auto 0;"><a name="ootc"><span style="font-family:'Verdana','sans-serif';">Object-Oriented Terms and Concepts</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<h3 style="margin:auto 0;"></h3>
<h4 style="margin:auto 0;"><a name="objects"><span style="font-family:&#34;"><span style="font-size:small;">Objects</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<p><span style="font-size:small;"><strong><span style="font-family:&#34;">Objects</span></strong><span style="font-family:&#34;"> are the physical and conceptual things we find in the universe around us. Hardware, software, documents, human beings, and even concepts are all examples of objects. For purposes of modeling his or her company, a chief executive officer could view employees, buildings, divisions, documents, and benefits packages as objects. An automotive engineer would see tires, doors, engines, top speed, and the current fuel level as objects. Atoms, molecules, volumes, and temperatures would all be objects a chemist might consider in creating an object-oriented simulation of a chemical reaction. Finally, a software engineer would consider stacks, queues, windows, and check boxes as objects.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Objects are thought of as having state. The <strong>state</strong> of an object is the condition of the object, or a set of circumstances describing the object. It is not uncommon to hear people talk about the "state information" associated with a particular object. For example, the state of a bank account object would include the current balance, the state of a clock object would be the current time, the state of an electric light bulb would be "on" or "off." For complex objects like a human being or an automobile, a complete description of the state might be very complex. Fortunately, when we use objects to model real world or imagined situations, we typically restrict the possible states of the objects to only those that are relevant to our models.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">We also think of the state of an object as something that is internal to an object. For example, if we place a message in a mailbox, the (internal) state of the mailbox object is changed, whereas the (internal) state of the message object remains unchanged.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Sometimes people think of objects as being strictly static. That is, the state of an object will not change unless something outside of the object requests the object to change its state. Indeed, many objects are passive (static). A list of names does not spontaneously add new names to itself, nor would we expect it to spontaneously delete names from itself.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">However, it is possible for some objects to change their own state. If an object is capable of spontaneously changing its own state, we refer to it as an "<strong>object with life</strong>." (Objects with life are sometimes also called "active objects" or "actors.") Clocks and timers are common examples of objects with life. If we were modeling a business process, we would recognize that salespeople and customers were also objects with life.</span></span></p>
<h4 style="margin:auto 0;"><a name="classes"><span style="font-family:&#34;"><span style="font-size:small;">Classes, Metaclasses, Parameterized Classes, and Exemplars</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="classes"><span style="font-family:'Verdana','sans-serif';">Classes, Metaclasses, Parameterized Classes, and Exemplars</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">There are two broad categories of objects: classes and instances. Users of object-oriented technology usually think of classes as containing the information necessary to create instances, i.e., the structure and capabilities of an instance is determined by its corresponding class. There are three commonly used (and different) views on the definition for "class":</span></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>class</strong> is a pattern, template, or blueprint for a category of structurally identical items. The items created using the class are called <strong>instances</strong>. This is often referred to as the "class as a `cookie cutter'" view. As you might guess, the instances are the "cookies."</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>class</strong> is a thing that consists of both a pattern and a mechanism for creating items based on that pattern. This is the "class as an `instance factory'" view; <strong>instances</strong> are the individual items that are "manufactured" (created) using the class's creation mechanism.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>class</strong> is the set of all items created using a specific pattern. Said another way, the class is the set of all <strong>instances</strong> of that pattern. </span></span></li>
</ul>
</td>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"> </p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:&#34;"><span style="font-size:small;">In this article, we will use the definition of a "class an `instance factory.'"</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">We should note that it is possible for an instance of a class to also be a class. A <strong>metaclass</strong> is a class whose instances themselves are classes. This means when we use the instance creation mechanism in a metaclass, the instance created will itself be a class. The instance creation mechanism of this class can, in turn, be used to create instances -- although these instances may or may not themselves be classes.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">A concept very similar to the metaclass is the parameterized class. A <strong>parameterized class</strong> is a template for a class wherein specific items have been identified as being required to create non-parameterized classes based on the template. In effect, a parameterized class can be viewed as a "fill in the blanks" version of a class. One cannot directly use the instance creation mechanism of a parameterized class. First, we must supply the required parameters, resulting in the creation of a non-parameterized class. Once we have a non-parameterized class, we can use its creation mechanisms to create instances.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">In this article, we will use the term "class" to mean metaclass, parameterized class, or a class that is neither a metaclass nor a parameterized class. We will make a distinction only when it is necessary to do so. Further, we will occasionally refer to "non-class instances." A <strong>non-class instance</strong> is an instance of a class, but is itself not a class. An instance of a metaclass, for example, would <em>not</em> be a non-class instance.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">In this article, we will sometimes refer to "instantiation." <strong>Instantiation</strong> has two common meanings:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">as a <em>verb</em>, instantiation is the process of creating an instance of a class, and</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">as a <em>noun</em>, an instantiation is an instance of a class. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Some people restrict the use of the term "object" to instances of classes. For these people, classes are not objects. However, when these people are confronted with the concepts of metaclasses and parameterized classes, they have a difficulty attempting to resolve the "problems" these concepts introduce. For example, is a class that is an instance of a metaclass an object -- even though it is itself a class? In this article, we will use the term "object" to refer to both classes and their instances. We will only distinguish between the two when needed.</span></span></p>
<h4 style="margin:auto 0;"><a name="bbi"><span style="font-family:&#34;"><span style="font-size:small;">Black Boxes and Interfaces</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="bbi"><span style="font-family:'Verdana','sans-serif';">Black Boxes and Interfaces</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">Objects are "black boxes." Specifically, the underlying implementations of objects are hidden from those that use the object. In object-oriented systems, it is only the producer (creator, designer, or builder) of an object that knows the details about the internal construction of that object. The consumers (users) of an object are denied knowledge of the inner workings of the object, and must deal with an object via one of its three distinct interfaces:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the "public" interface. This is the interface that is open (visible) to everybody.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the "inheritance" interface. This is the interface that is accessible only by direct specializations of the object. (We will discuss inheritance and specialization later in this chapter.) In class-based object-oriented systems, only classes can provide an inheritance interface.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the "parameter" interface. In the case of parameterized classes, the parameter interface defines the parameters that must be supplied to create an instance of the parameterized class. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Another way of saying that an item is in the public interface of an object is to say that the object "exports" that item. Similarly, when an object requires information from outside of itself (e.g., as with the parameters in a parameterized class), we can say that the object needs to "import" that information.</span></span></p>
<h1 style="margin:auto 0;"><a name="aggregation"><span style="font-family:'Verdana','sans-serif';">Aggregation</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">It is, of course, possible for objects to be composed of other objects. <strong>Aggregation</strong> is either:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the process of creating a new object from two or more other objects, or</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">an object that is composed of two or more other objects. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">For example, a date object could be fashioned from a month object, a day object, and a year object. A list of names object, for example, can be thought of as containing many name objects.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">A <strong>monolithic object </strong>is an object that has no externally-discernible structure. Said another way, a monolithic object does not appear to have been constructed from two or more other objects. Specifically, a monolithic object can only be treated as a cohesive whole. Those outside of a monolithic object cannot directly interact with any (real or imagined) objects within the monolithic object. A radio button in a graphical user interface (GUI) is an example of a monolithic object.</span></span></p>
<p><span style="font-size:small;"><strong><span style="font-family:&#34;">Composite objects</span></strong><span style="font-family:&#34;"> are objects that have an externally-discernible structure, and the structure can be addressed via the public interface of the composite object. The objects that comprise a composite object are referred to as <strong>component objects</strong>. Composite objects meet one or both of the following criteria:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the state of a composite object is directly affected by the presence or absence of one or more of its component objects, and/or</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the component objects can be directly referenced via the public interface of their corresponding composite object. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">It is useful to divide composite objects into two subcategories: heterogeneous composite objects and homogeneous composite objects:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>heterogeneous composite object</strong> is a composite object that is conceptually composed of component objects that are not all conceptually the same. For example, a date (made up of a month object, a day object, and a year object) is a heterogeneous composite object.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>homogeneous composite object</strong> is a composite object that is conceptually composed of component objects that are all conceptually the same. For example, a list of addresses is a homogeneous composite object. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">The rules for designing heterogeneous composite objects are different from the rules for designing homogeneous composite objects.</span></span></p>
<h4 style="margin:auto 0;"><a name="sai"><span style="font-family:&#34;"><span style="font-size:small;">Specialization and Inheritance</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="sai"><span style="font-family:'Verdana','sans-serif';">Specialization and Inheritance</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<div><span style="font-family:&#34;"></span></div>
<p><span style="font-family:&#34;"><span style="font-size:small;"></p>
<h4 style="margin:auto 0;"> </h4>
<p> </p>
<p></span></span></p>
<p> </p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Aggregation is not the only way in which two objects can be related. One object can be a specialization of another object. <strong>Specialization </strong>is either:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">the process of defining a new object based on a (typically) more narrow definition of an existing object, or</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">an object that is directly related to, and more narrowly defined than, another object. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Specialization is usually associated with classes. It is usually only in the so-called "classless" object-oriented systems that we think of specialization for objects other than classes.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Depending on their technical background, there are a number of different ways in which people express specialization. For example, those who are familiar with an object-oriented programming language called Smalltalk refer to specializations as "subclasses" and to the corresponding <strong>generalizations</strong> of these specializations as "superclasses." Those with a background in the C++ programming language use the term "derived class" for specialization and "base class" for corresponding generalizations.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">It is common to say that everything that is true for a generalization is also true for its corresponding specialization. We can, for example, define "checking accounts" and "savings accounts" as specializations of "bank accounts." Another way of saying this is that a checking account is a kind of bank account, and a savings account is a kind of bank account. Still another way of expressing this idea is to say that everything that was true for the bank account is also true for the savings account and the checking account.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">In an object-oriented context, we speak of specializations as "inheriting" characteristics from their corresponding generalizations. <strong>Inheritance</strong> can be defined as the process whereby one object acquires (gets, receives) characteristics from one or more other objects. Some object-oriented systems permit only <strong>single inheritance,</strong> a situation in which a specialization may only acquire characteristics from a single generalization. Many object-oriented systems, however, allow for <strong>multiple inheritance</strong>, a situation in which a specialization may acquire characteristics from two or more corresponding generalizations.</span></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"> </p>
</td>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"><span style="font-family:&#34;"><span style="font-size:small;">Our previous discussion of the bank account, checking account, and savings account was an example of single inheritance. A telescope and a television set are both specializations of "device that enables one to see things far away." A television set is also a kind of "electronic device." You might say that a television set acquires characteristics from two different generalizations, "device that enables one to see things far away" and "electronic device." Therefore, a television set is a product of multiple inheritance.</span></span></p>
</td>
</tr>
</tbody>
</table>
<h4 style="margin:auto 0;">
<h1 style="margin:auto 0;"><a name="ac"><span style="font-family:'Verdana','sans-serif';"><span style="font-size:small;">Abstract Classes</span></span></a><span style="font-family:'Verdana','sans-serif';"><span style="font-size:small;"> </span></span></h1>
<p><a name="ac"><span style="font-family:&#34;"><span style="font-size:small;">Abstract Classes</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span><span style="font-family:&#34;"><span style="font-size:small;">We usually think of classes as being complete definitions. However, there are situations where incomplete definitions are useful, and classes that represent these incomplete definitions are equally useful. For example, in everyday conversation, we might talk about such items as bank accounts, insurance policies, and houses. In object-oriented thinking, we often isolate useful, but incomplete, concepts such as these into their own special classes.</span></span></p>
<p><span style="font-size:small;"><strong><span style="font-family:&#34;">Abstract classes</span></strong><span style="font-family:&#34;"> are classes that embody coherent and cohesive, but incomplete, concepts, and in turn, make these characteristics available to their specializations via inheritance. People sometimes use the terms "partial type" and "abstract superclass" as synonyms for abstract class. While we would never create instances of abstract classes, we most certainly would make their individual characteristics available to more specialized classes via inheritance.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">For example, consider the concept of an automobile. On one hand, most people know what an automobile is. On the other hand, "automobile" is not a complete definition for any vehicle. It would be quite accurate to describe "automobile" as the set of characteristics that make a thing an automobile, in other words, the "essence of automobile-ness."</span></span></p>
<h4 style="margin:auto 0;"><a name="operations"><span style="font-family:&#34;"><span style="font-size:small;">Operations</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="operations"><span style="font-family:'Verdana','sans-serif';">Operations</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">The public interface of an object typically contains three different categories of items:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">operations (sometimes referred to as "method selectors," "method interfaces," "messages," or "methods"),</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">constants, and</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">exceptions. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">An operation in the public interface of an object advertises a functional capability of that object. For example, "deposit" would be an operation in the public interface of a bank account object, "what is current temperature" would be an operation in the public interface of a temperature sensor object, and "increment" would be an operation in the public interface of a counter object.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">The actual algorithm for accomplishing an operation is referred to as a <strong>method</strong>. Unlike operations, methods are not in the public interface for an object. Rather, methods are hidden on the inside of an object. So, while users of bank account objects would know that they could make a deposit into a bank account, they would be unaware of the details as to how that deposit actually got credited to the bank account.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">We refer to the operations in the public interface of an object as "suffered operations." <strong>Suffered operations</strong> are operations that meet two criteria: they are things that happen to an object, and they are in the public interface of that object. For example, we can say that a bank account "suffers" the operation of having a deposit made into it. The bank account can also "suffer" the operation of being queried as to its current balance. Some people also refer to suffered operations as "exported operations."</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">There are three broad categories of <em>suffered</em> operations, i.e.:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>selector</strong> is an operation that tells us something about the state of an object, but cannot, by definition, change the state of the object. An operation that tells us the current balance of a bank account is an example of a selector operation.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">A <strong>constructor</strong> is an operation that has the ability to change the state of an object. For example, an operation in the public interface to a mailbox object that added a message to the mailbox would be a constructor operation. (Please note that some people restrict the definition of the term "constructor" to those operations that cause instances of a class to come into existence.)</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">In the context of a homogeneous composite object, an <strong>iterator</strong> is an operation that allows its users to visit (access) each of the component objects that make up the homogeneous composite object. If we have a list of addresses, for example, and we wish to print the entire list, an iterator would allow us to visit each address object within the list and then, in turn, to print each address. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Iterators can be further divided into two broad categories: active (open) iterators and passive (closed) iterators. Active iterators are objects in their own right. Passive iterators are implemented as operations in the interface of the object over which they allow iteration. Passive iterators are further broken down into selective iterators and constructive iterators. Passive selective iterators do not allow their users to change the object over which the iteration takes place. Passive constructive iterators do allow users to change the object over which iteration takes place.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">We can also describe suffered operations as primitive or composite. A <strong>primitive operation</strong> is an operation that cannot be accomplished simply, efficiently, and reliably without direct knowledge of the underlying (hidden) implementation of the object. As an example, we could argue that an operation that added an item to a list object, or an operation that deleted an item from a list object were primitive operations with respect to the list object.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Suppose that we wanted to create a "swap operation," an operation that would swap in a new item in a list, while at the same time swapping out an old item in the same list. This is not a primitive operation since we can accomplish this with a simple combination of the delete operation (deleting the old item) followed by the add operation (adding the new item). The swap operation is an example of a composite operation. A <strong>composite operation</strong> is any operation that is composed, or can be composed, of two or more primitive operations.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Sometimes objects need help in maintaining their characteristics. Suppose, for example, that we wanted to create a "generic ordered list" object. An ordered list is a list that must order its contents from the smallest to the largest. Specifically, every time we add an item to our ordered list, that item would have to be placed in its proper position with respect to all the other items already in the list. By "generic," we mean a template that can be instantiated with the category (class) of items we wish to place in the ordered list.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">It would not be unreasonable to implement this object as a parameterized class. Obviously, one of the parameters would be the category of items (e.g., class) that we desired to place in the list. For example, could instantiate (make an instance) the generic ordered list with a "name class" resulting in the creation of an "ordered list of names class."</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">There is a problem, however. Given that we could instantiate the generic ordered list with just about any category of items, how can we be sure that the ordered lists will know how to properly maintain order <em>-- no matter what we use to instantiate the generic ordered list?</em> Suppose, for example, that we wanted an ordered list of "fazoomas." How could the generic list class tell if one fazooma was greater than or less than another fazooma?</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">A solution would be for the generic ordered list to require a second parameter, a parameter over and above the category of items (class) that we desired to place in the list. This second parameter would be a "&#60;" (less than) operation that worked with the category of items to be placed in the list. In the case of our ordered list of fazoomas, this second parameter would be a "&#60;" that works with fazoomas.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">The "&#60;" that worked with fazoomas is an example of a required operation. A <strong>required operation</strong> is an operation that an object needs to maintain its outwardly observable characteristics, but which the object cannot supply itself. Some people refer to required operations as "imported operations."</span></span></p>
<h4 style="margin:auto 0;"><a name="constants"><span style="font-family:&#34;"><span style="font-size:small;">Constants</span></span></a></h4>
<h1 style="margin:auto 0;"><a name="constants"><span style="font-family:'Verdana','sans-serif';">Constants</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<h4 style="margin:auto 0;"></h4>
<p><span style="font-family:&#34;"><span style="font-size:small;">In addition to suffered operations, the public interface of an object can also contain constants. <strong>Constants</strong> are objects of constant state. Imagine that we want to create a "bounded list of addresses class." A bounded list is a list that has a fixed maximum number of elements. A bounded list can be empty, and it can contain fewer than the maximum number of elements. It can even contain the maximum number of elements, but it can never contain more than the defined maximum number of elements.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Assume that we place a constant in the public interface of our bounded list of addresses. This constant represents the maximum number of elements that can be placed in the bounded list. Assume also that there is a suffered operation that will tell us how many elements (addresses, in our example) are currently in the bounded list. We can now determine how much room is available in the bounded list by inquiring how many addresses are already in the list, and then subtracting this from the previously-defined constant.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">In some cases, as with the bounded list example above, constants are provided more for convenience than necessity. In other cases, such as in the case of encryption algorithms needing a "seed value," constants are an absolute requirement.</span></span></p>
<h4 style="margin:auto 0;"><a name="exceptions"><span style="font-family:&#34;"><span style="font-size:small;">Exceptions</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="exceptions"><span style="font-family:'Verdana','sans-serif';">Exceptions</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">A third category of items that can be found in the public interface of objects is exceptions. <strong>Exceptions</strong> have two different definitions:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">an event that causes suspension of normal application execution, and</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">a set of information directly relating to the event that caused suspension of normal application execution. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Exceptions can be contrasted with an older, less reliable technology: "error codes." The idea behind error codes was fairly simple. You would request that an application, or part of an application, accomplish some work. One of the pieces of information that would be returned to the requester would be an error code. If all had gone well, the error code would typically have a value of zero. If any problems had occurred, the error code would have a non-zero value. It was also quite common to associate different non-zero values of an error code with specific errors.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Error codes suffered from two major problems:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">No one was forced to actually check the value of returned error codes.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Changes (additions, deletions, and modifications) in the meanings of the special values assigned to error codes were not automatically passed on to interested parties. Tracking the effects of a changed error code value often consumed a significant amount of resources. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">To understand how exceptions directly address both of these issues, we first need to understand how exceptions typically work:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Exceptions may be defined by the environment or by the user.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">When an exceptional (but not unforeseen) condition occurs, an appropriate exception is activated. (People use different terms to express the activation of an exception. The most common is "raise." Less commonly, people use the terms "throw" or "activate.") This activation may be automatic (controlled by the environment) or may be expressly requested by the designer of the object or application. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Examples of exceptional conditions include trying to remove something from an empty container, directing an elevator on the top floor to "go up," and attempting to cause a date to take on an invalid value like "February 31, 1993."</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">Once the exception is activated, normal application execution stops and control is transferred to a locally defined exception handler, if one is present. If no locally defined exception handler is present or if the exception handler is not equipped to handle the exception, the exception is propagated to the next higher level of the application. <em>Exceptions cannot be ignored.</em> An exception will continue to be sent to higher levels of the application until it is either turned off or the application ceases to function.</span></span></li>
<li class="MsoNormal"><span style="font-family:&#34;"><span style="font-size:small;">An exception handler checks to see what type of exception has been activated. If the exception is one that the handler recognizes, a specific set of actions is taken. Executing a set of actions in response to an exception is known as "handling the exception." Handling an exception deactivates the exception; the exception will not be propagated any further. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Unlike error codes, exceptions cannot be ignored. Once an exception has been activated, it demands attention. In object-oriented systems, exceptions are placed in the public interfaces of objects. Changes in the public interfaces of objects very often require an automatic rechecking of all other objects that invoke operations in the changed objects. Thus, changes in exceptions result in at least a partially automated propagation of change information.</span></span></p>
<h4 style="margin:auto 0;"><a name="ococ"><span style="font-family:&#34;"><span style="font-size:small;">Object Coupling and Object Cohesion</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="ococ"><span style="font-family:'Verdana','sans-serif';">Object Coupling and Object Cohesion</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">Engineers have known for centuries that the less any one part of a system knows about any other part of that same system, the better the overall system. Systems whose components are highly independent of each other are easier to fix and enhance than systems where there are strong interdependencies among some or all of the components. Highly independent system components are possible when there is minimal coupling among the components, and each component is highly cohesive.</span></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"> </p>
</td>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"><span style="font-family:&#34;"><span style="font-size:small;">Coupling is a measure of the strength of the connection between any two system components. The more any one component knows about another component, the tighter (worse) the coupling is between those two components. Cohesion is a measure of how logically related the parts of an individual component are to each other, and to the overall component. The more logically related the parts of a component are to each other the higher (better) the cohesion of that component.</span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:&#34;"><span style="font-size:small;">The objects that make up an object-oriented system exhibit object coupling and object cohesion. <strong>Object coupling</strong> describes the degree of interrelationships among the objects that make up a system. The more any one object knows about any other object in the system, the tighter (worse) the coupling is between those two objects.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">To construct systems from objects, we must couple (to some degree) the objects that comprise the system. This is <em>necessary </em>object coupling. However, if in the design of an individual object, we give that object direct knowledge of other specific objects, we are unnecessarily coupling the objects. <em>Unnecessary </em>object coupling reduces both the reusability of individual objects, and the reliability of the systems that contain unnecessarily coupled objects.</span></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"> </p>
</td>
<td style="background-color:transparent;border:#ece9d8;padding:0.75pt;">
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><strong><span style="font-family:&#34;">Object cohesion</span></strong><span style="font-family:&#34;">, on the other hand, is a measure of how logically related the components of the <em>external</em> view of an object are to each other. For example, if we are told that a date object is comprised of a month object, a day object, a year object, and the color blue, we should recognize that the color blue is not appropriate, and lowers the cohesion of the date object. We want our objects to be as cohesive as possible for two reasons. First, objects with low cohesion are more likely to be changed, and are more likely to have undesirable side effects when they are changed. Second, objects with low cohesion are seldom easily reusable.</span></span></p>
</td>
</tr>
</tbody>
</table>
<h4 style="margin:auto 0;"><a name="systems"><span style="font-family:&#34;"><span style="font-size:small;">Systems of Objects</span></span></a><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></h4>
<h1 style="margin:auto 0;"><a name="systems"><span style="font-family:'Verdana','sans-serif';">Systems of Objects</span></a><span style="font-family:'Verdana','sans-serif';"> </span></h1>
<p><span style="font-family:&#34;"><span style="font-size:small;">In constructing object-oriented models and object-oriented applications, one quickly finds that single classes and single instances are not enough. You need some way of creating and dealing with large objects. A <strong>system of objects</strong> is defined as two or more interacting or interrelated, non-nested objects. (We exclude simple aggregations of composite objects from our definition of systems of objects.)</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Systems of objects fall into two general categories:</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-size:small;"><strong><span style="font-family:&#34;">kits</span></strong><span style="font-family:&#34;">, which are collections of items (classes, metaclasses, parameterized classes, non-class instances, other kits, and/or systems of interacting objects) all of which support a single, large, coherent, object-oriented concept, such as computer graphics windows or insurance policies. There may indeed be some physical connection among some of the members of a given kit. However, kits are "granular." While all the components of a kit are logically related, there are very few physical connections that bind them together.</span></span></li>
<li class="MsoNormal"><span style="font-size:small;"><strong><span style="font-family:&#34;">systems of interacting objects</span></strong><span style="font-family:&#34;">, which are collections of items (classes, metaclasses, parameterized classes, non-class instances, kits, and/or other systems of interacting objects) all of which support a single, large, coherent, object-oriented concept, and in which there must be a direct or indirect physical connection between any two arbitrary objects within the collection. Further, systems of interacting objects have at least one internal, independently executing thread of control. Lastly, systems of interacting objects may exhibit multiple, completely disjoint public interfaces. </span></span></li>
</ul>
<p><span style="font-family:&#34;"><span style="font-size:small;">Kits resemble libraries. Say, for example, that we had to create a computer application with a graphical user interface. Graphical user interfaces normally contain several different types of windows. It would be very useful if we had a library of windows and window components from which we could construct any window we desired. Windows are objects, and the components of windows (buttons and check boxes) are themselves objects. A collection of windows and window components can be viewed as a kit.</span></span></p>
<p><span style="font-family:&#34;"><span style="font-size:small;">Systems of interacting objects, on the other hand, resemble applications. For example, suppose that we wanted to construct an object-oriented application that controlled the elevators in a particular building. We would assemble elevators, buttons, lamps, panels, and other objects into a working application that would control the elevators. Such an application would not be viewed as a library, but as a highly cohesive whole. The elevator controller application is a system of interacting objects.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:&#34;"><span style="font-size:small;"> </span></span></p>
</h4>
]]></content:encoded>
</item>
<item>
<title><![CDATA[التعامل مع الاخطاء في البرمجة الكائنية : الفئة ExecutionCondition مثالاً]]></title>
<link>http://alnabhani.wordpress.com/?p=37</link>
<pubDate>Tue, 22 Jul 2008 03:37:56 +0000</pubDate>
<dc:creator>alnabhani</dc:creator>
<guid>http://alnabhani.wordpress.com/?p=37</guid>
<description><![CDATA[يعد اسلوب البرمجة الكانئية افضل اسلوب برمجي تطبقه في م]]></description>
<content:encoded><![CDATA[<p dir="rtl">يعد اسلوب البرمجة الكانئية افضل اسلوب برمجي تطبقه في معظم اللغات الحديثة والقوية وخصوصا لغات الدوت نت سواء كانت VB.Net او C# ، وعندما تطبق هذا الاسلوب فمن الاكيد بانك ستقوم ببناء فئات Classes وستحتوي بداخلها على اعضاء Members كـ Properties,Function,Subs وغيرها ، ثم تستخدم هذه الفئات في أي جزء رئيسي من الرنامج بإنشاء كائن جديد منها ثم اسناد القيم والخصائص إليه من خلال المشيد Constructor في حالة وجوده او من خلال الخصائص القابلة للكتابة Writable Properties او لاشيء من هذا !</p>
<p dir="rtl">لاحقا وبعد ان تكتب الاكواد داخل الأعضاء الخاصة بفئتك التي انشاتها للتو واللحظة ، فإنك قد تتساءل حول عملية قنص الاستثناءات Exceptions ، فماذا لو حدث استثناء معين او خطاء وقت التنفيذ في الكود ؟ هذا ما سنناقشه هنا .</p>
<p dir="rtl"><!--more--></p>
<p dir="rtl">لنفترض انك قد قمت بعمل فئة بالإسم MyData والتي تمثل بيانات شخصيه معينه يتم اسنادها لها ،كالخصائص التالية مثلا : FirstName,FamilyName,Age  ، بحيث صارت كالتالي :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">Public Class MyData</p>
<p dir="ltr">    Dim _FirstName As String</p>
<p dir="ltr">    Public Property FirstName() As String</p>
<p dir="ltr">        Get</p>
<p dir="ltr">            Return _FirstName</p>
<p dir="ltr">        End Get</p>
<p dir="ltr">        Set(ByVal value As String)</p>
<p dir="ltr">            _FirstName = value</p>
<p dir="ltr">        End Set</p>
<p dir="ltr">    End Property</p>
<p dir="ltr"> </p>
<p dir="ltr">    Dim _FamilyName As String</p>
<p dir="ltr">    Public Property FamilyName() As String</p>
<p dir="ltr">        Get</p>
<p dir="ltr">            Return _FamilyName</p>
<p dir="ltr">        End Get</p>
<p dir="ltr">        Set(ByVal value As String)</p>
<p dir="ltr">            _FamilyName = value</p>
<p dir="ltr">        End Set</p>
<p dir="ltr">    End Property</p>
<p dir="ltr"> </p>
<p dir="ltr">    Dim _Age As Byte</p>
<p dir="ltr">    Public Property Age()</p>
<p dir="ltr">        Get</p>
<p dir="ltr">            Return _Age</p>
<p dir="ltr">        End Get</p>
<p dir="ltr">        Set(ByVal value)</p>
<p dir="ltr">            _Age = value</p>
<p dir="ltr">        End Set</p>
<p dir="ltr">    End Property</p>
<p dir="ltr"> </p>
<p dir="ltr">End Class</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> ثم طلبت منك ان تضيف لهذه الفئة طريقة Method تقوم بكتابة البيانات الى ملف - وذلك بإضافتها الى بيانات اخرى موجودة سابقا- لتكتب الاسم الاول والعائلة والعمر ، ولنفترض - واقول نفترض- انك كتبت الكود التالي بالضبط ( بما فيه من اخطاء فادحة ! ) :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">    Public Sub WriteDataToFile(ByVal FileName As String)</p>
<p dir="ltr">        Dim FileContent As String</p>
<p dir="ltr">        FileContent = "الإسم الأول : " &#38; Me.FirstName &#38; " العائلة : " &#38; Me.FamilyName &#38; " العمر " &#38; Me.Age</p>
<p dir="ltr"> </p>
<p dir="ltr">        My.Computer.FileSystem.WriteAllText(FileName, FileContent, True)</p>
<p dir="ltr"> </p>
<p dir="ltr"> </p>
<p dir="rtl" align="right">    End Sub</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">الآن لو قمنا بإنشاء كائن جديد من هذه الفئة واعطيناه قيما لخصائصه وطلبنا من الكائن ان يتكرم علينا بتنفيذ الطريقة WriteDataToFile واعطيناه الوسيط المناسب كالتالي :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">Module Module1</p>
<p dir="ltr"> </p>
<p dir="ltr">    Sub Main()</p>
<p dir="ltr"> </p>
<p dir="ltr">        Dim Mohammed As New MyData</p>
<p dir="ltr">        Mohammed.FirstName = "Mohammed"</p>
<p dir="ltr">        Mohammed.FamilyName = "AL-Nabhani"</p>
<p dir="ltr">        Mohammed.Age = 20</p>
<p dir="ltr"> </p>
<p dir="ltr">        Mohammed.WriteDataToFile("C:\Users\Personals\Documents\MyData.txt")</p>
<p dir="ltr"> </p>
<p dir="ltr">        Console.ReadLine()</p>
<p dir="ltr"> </p>
<p dir="ltr">    End Sub</p>
<p dir="ltr"> </p>
<p dir="ltr">End Module</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">ثم قمنا بتجربة البرنامج ، لكن مهلا هناك استثناء وارد بنسبه كبيرة جدا وهو ان الملف MyData غير موجود ! قد تفكر بان عملية التحقق من وجود الملف اولا افضل وانا اتفق معك في ذلك تماما ، لكن ما هي سيناريوهات العملية القادمة ؟ اذا لم يجد الملف ماذا يفعل البرنامج ؟</p>
<p dir="rtl"> </p>
<p dir="rtl">في حالتي لا اريد انشاء ملف لانني اريد ان اضيف البيانات الى الملف MyData لا أن أققوم بإنشاءه في حالة عدم وجودة ، لذلك فإننا نرغب الآن بإعلام المستخدم بأن الملف غير موجود واجزم انك تتفق معي الان في ذلك ، لكن السؤال كيف سنخبر المستخدم بذلك ؟ ان كنت ستقول لنكتب سطرا مثل التالي في الطريقة المعنية :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">    Public Sub WriteDataToFile(ByVal FileName As String)</p>
<p dir="ltr">        Dim FileContent As String</p>
<p dir="ltr">        FileContent = "الإسم الأول : " &#38; Me.FirstName &#38; " العائلة : " &#38; Me.FamilyName &#38; " العمر " &#38; Me.Age</p>
<p dir="ltr"> </p>
<p dir="ltr">        If My.Computer.FileSystem.FileExists(FileName) = True Then</p>
<p dir="ltr">            My.Computer.FileSystem.WriteAllText(FileName, FileContent, True)</p>
<p dir="ltr">        Else</p>
<p dir="ltr">            Console.Write("الملف غير موجود")</p>
<p dir="ltr">        End If</p>
<p dir="ltr"> </p>
<p dir="ltr">    End Sub</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">فسأقول لك ان الطريقة السابقة خاطئة تماما ، صحيح انها ستعطينا الناتج النهائي المطلوب كما قد تشتهيه ، ولكن في في اسلوب البرمجة الكائنيه ذلك خطأ ، فالمفترض ان الفئة التي انشاناها لا تعرض شيء على الشاشة بدون اذن الطريقة Main ، وافرض او اننا اردنا استخدام هذه الفئة في مشروع من نوع WIndowsApplication بدل ConsoleApplication فماذا ستفعل ؟ الادهى لو قمت بترجمه الفئة الى ملف Dll فكيف ستعرف نوع المشروع الحالي ؟ حتى لو عرفت من خلال الكود فهل يعجبك ان تكتب جملة شرطية للتأكد من نوع المشروع ثم اظهار رسالة الخطأ بالطريقة الخاصة بكل واحد ؟</p>
<p dir="rtl"> </p>
<p dir="rtl">اتمنى انك اقتنعت بذلك ، اما الحل فسيكون بتعديل الطريقة WriteDataToFile لتكون  دالة Function بدل Sub وجعلها تعود بقيمة معينه ، طيب فكر معي ، ما هو النوع Type الخاص بهذه الدالة function والتي ستعيده ؟ هل ستعيد Boolean لنعرف ان حدث خطأ ام لا ؟ ام تعيد String في كل مرة ام أي نوع ؟ طيب لنفكر في كل واحدة على حده :</p>
<p dir="rtl"> </p>
<ul>
<li>1- النوع Boolean : فكرة جيدة ، لجعل الدالة تعيد قيمة True ان تم تنفيذها كما يجب ، و False في الحالة المعاكسه ولكن يعيبها عدم اعادتها لرسالة الخطأ ، ففي حالة امكانية حدوث اكثر من خطأ واحد فهناك ستواجه مشكلة حول أي رسالة خطأ ستعرض او أي اجراء ستنفذ .</li>
<li>2- النوع String : طريقة جيدة نوعا ما ، لكن لو اردت كتابة دالة تعيد نوع معينا مثلا تقرأ ملفا معينا وتعيد الاسم الاول فكيف ستعرف ان ما اعادته هو الاسم الاول او رسالة الخطأ ؟</li>
</ul>
<p dir="rtl">لا تقل لي لنضع Field ( حقل ) عام على مستوى المشروع بمثابته متغير من النوع Boolean يعرف اذا حدث خطا ام لا فهذه الطريقة تنتهك OOP من كل النواحي !</p>
<p dir="rtl"> </p>
<p dir="rtl">طيب ما الحل اذا ؟</p>
<p dir="rtl">الحل يتم بعمل نوع جديد خاص بنا لمثل هذه الحالات ، وهو عمل فئة Class تحمل خاصية تخبرنا ان حدث خطا او لا ، وتعطينا ايضا نص رسالة الخطأ او حتى كائن الـ Error بأكمله او أي شيء من هذا القبيل ... كما قد نطورها اكثر لتحمل قيمة ما تود ارجاعه كما في الحالة الثانية اعلاه ، وهو الحل الذي سأتبعه في هذا النطاق مع انه قد يوجد حلول افضل ولكن ذلك يعتمد على الحالات التي تواجهها في برامجك .</p>
<p dir="rtl"> </p>
<p dir="rtl">الفئة الجديدة والتي سنعول عليها معرفة حدوث خطأ وحمل قيمة ناتج عملياتنا اسميتها ExecutionCondition وستحمل الخصائص التالية :</p>
<ul>
<li>HasErrors : وهي خاصية للقراءة فقط ReadOnly ومن النوع Boolean</li>
<li>ErrorMessage : وهي خاصية للقراءة فقط ايضا ومن النوع Strign</li>
<li>Value : وهي خاصية اختيارية لك ، وهي من النوع Object .</li>
</ul>
<p dir="rtl"> </p>
<p dir="rtl">بالنسبة للطرق فقد وضعت اجرائين فقط :</p>
<ul>
<li>SetErrorMessage : وهو الذي نستخدمه في اعطاء الخاصية ErrorMessage قيمتها وبناءا عليه تتحدد قمية الخاصية HasErrors .</li>
<li>Reset : يعيد الكائن الى حالته الاساسية أي بدون خطأ مع عدم المساس بقيمة الكائن المتمثل في الخاصية Value .</li>
</ul>
<p dir="rtl"> </p>
<p dir="rtl">لن اقوم بشرح كل شيء في هذه الفئة ، فهي واضحة وضوح الشمس لكل من لديه اساسيات ولو بسيطة في OOP :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">''' &#60;summary&#62;</p>
<p dir="ltr">''' This class is used to return an object with value and error message when error occur</p>
<p dir="ltr">''' &#60;/summary&#62;</p>
<p dir="ltr">''' &#60;remarks&#62;&#60;/remarks&#62;</p>
<p dir="ltr">Public Class ExecutionCondition</p>
<p dir="ltr">#Region "Properties"</p>
<p dir="ltr">    Dim _HasErrors As Boolean</p>
<p dir="ltr">    ''' &#60;summary&#62;</p>
<p dir="ltr">    ''' Determines if the assosiated process has an errors while executing it</p>
<p dir="ltr">    ''' &#60;/summary&#62;</p>
<p dir="ltr">    ''' &#60;value&#62;&#60;/value&#62;</p>
<p dir="ltr">    ''' &#60;returns&#62;&#60;/returns&#62;</p>
<p dir="ltr">    ''' &#60;remarks&#62;&#60;/remarks&#62;</p>
<p dir="ltr">    Public ReadOnly Property HasErrors() As Boolean</p>
<p dir="ltr">        Get</p>
<p dir="ltr">            If Me._HasErrors = True Then Me._ErrorMessage = "" </p>
<p dir="ltr">            Return _HasErrors</p>
<p dir="ltr">        End Get</p>
<p dir="ltr">    End Property</p>
<p dir="ltr"> </p>
<p dir="ltr">    Dim _ErrorMessage As String</p>
<p dir="ltr">    ''' &#60;summary&#62;</p>
<p dir="ltr">    ''' Gets the error message if the assisiated process has an erors while executing</p>
<p dir="ltr">    ''' &#60;/summary&#62;</p>
<p dir="ltr">    ''' &#60;value&#62;&#60;/value&#62;</p>
<p dir="ltr">    ''' &#60;returns&#62;&#60;/returns&#62;</p>
<p dir="ltr">    ''' &#60;remarks&#62;&#60;/remarks&#62;</p>
<p dir="ltr">    Public ReadOnly Property ErrorMessage() As String</p>
<p dir="ltr">        Get</p>
<p dir="ltr">            Return _ErrorMessage</p>
<p dir="ltr">        End Get</p>
<p dir="ltr"> </p>
<p dir="ltr">    End Property</p>
<p dir="ltr"> </p>
<p dir="ltr">    Dim _Value As Object</p>
<p dir="ltr">    ''' &#60;summary&#62;</p>
<p dir="ltr">    ''' Represents the value of the ibject, it could be any type .</p>
<p dir="ltr">    ''' &#60;/summary&#62;</p>
<p dir="ltr">    ''' &#60;value&#62;&#60;/value&#62;</p>
<p dir="ltr">    ''' &#60;returns&#62;&#60;/returns&#62;</p>
<p dir="ltr">    ''' &#60;remarks&#62;&#60;/remarks&#62;</p>
<p dir="ltr">    Public Property Value() As Object</p>
<p dir="ltr">        Get</p>
<p dir="ltr">            Return _Value</p>
<p dir="ltr">        End Get</p>
<p dir="ltr">        Set(ByVal value As Object)</p>
<p dir="ltr">            _Value = value</p>
<p dir="ltr">        End Set</p>
<p dir="ltr">    End Property</p>
<p dir="ltr">#End Region</p>
<p dir="ltr"> </p>
<p dir="ltr">#Region "Methods"</p>
<p dir="ltr"> </p>
<p dir="ltr">    Public Sub New()</p>
<p dir="ltr"> </p>
<p dir="ltr">    End Sub</p>
<p dir="ltr">    ''' &#60;summary&#62;</p>
<p dir="ltr">    ''' Sets the Error Message</p>
<p dir="ltr">    ''' &#60;/summary&#62;</p>
<p dir="ltr">    ''' &#60;param name="Message"&#62;"the message of the error that will be presented in Error Message property&#60;/param&#62;</p>
<p dir="ltr">    ''' &#60;remarks&#62;&#60;/remarks&#62;</p>
<p dir="ltr">    Public Sub SetErrorMessage(ByVal Message As String)</p>
<p dir="ltr">        _ErrorMessage = Message</p>
<p dir="ltr">        _HasErrors = True</p>
<p dir="ltr">    End Sub</p>
<p dir="ltr">    ''' &#60;summary&#62;</p>
<p dir="ltr">    ''' resets the object so no errors are contained</p>
<p dir="ltr">    ''' &#60;/summary&#62;</p>
<p dir="ltr">    ''' &#60;remarks&#62;&#60;/remarks&#62;</p>
<p dir="ltr">    Public Sub Reset()</p>
<p dir="ltr">        Me._HasErrors = False</p>
<p dir="ltr"> </p>
<p dir="ltr">    End Sub</p>
<p dir="ltr">#End Region</p>
<p dir="ltr">End Class</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">الآن لنقم بعمل مثال عملي جديد لنجرب استخدام هذه الفئة ، اما بخصوص مثالنا السابق والفئة MyData فاعتبره تمرينا لك لحل مشكلتنا الأساسية !</p>
<p dir="rtl"> </p>
<p dir="rtl">في الوحدة النمطية Module1 التي تحتوي على الطريقة Main - الجزء الاساسي من البرنامج بطبيعة الحال - فقد قمت باضافة الدالة التالية فيها :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">    Function WriteOnTheScreen() As ExecutionCondition</p>
<p dir="ltr">        Dim mExCn As New ExecutionCondition</p>
<p dir="ltr"> </p>
<p dir="ltr">        Try</p>
<p dir="ltr">            Console.WriteLine(5 / 1)</p>
<p dir="ltr">            Console.ReadLine()</p>
<p dir="ltr"> </p>
<p dir="ltr">            mExCn.Reset()</p>
<p dir="ltr"> </p>
<p dir="ltr">        Catch ex As Exception</p>
<p dir="ltr">            mExCn.SetErrorMessage(ex.Message)</p>
<p dir="ltr">        End Try</p>
<p dir="ltr"> </p>
<p dir="ltr">        Return mExCn</p>
<p dir="ltr">    End Function</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">وفي الطريقة Main كتبت الكود التالي :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">    Sub Main()</p>
<p dir="ltr">        'لنجرب تنفيذ الدالة</p>
<p dir="ltr">        'WriteOnTheScreen</p>
<p dir="ltr">        If WriteOnTheScreen.HasErrors = True Then</p>
<p dir="ltr">            Console.WriteLine(WriteOnTheScreen.ErrorMessage)</p>
<p dir="ltr">        End If</p>
<p dir="ltr">        Console.ReadLine()</p>
<p dir="ltr">    End Sub</p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">بعد تشغيل البرنامج سيظهر كل شيء على ما يرام هذه المرة وسيطبع 5 ، لنجرب الآن تعديل الطريقة WriteOnTheScreen ولنجعل القسمة مبنية على صفر وهذا خطأ رياضي فادح جدا :</p>
<p dir="rtl">
<table dir="rtl" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="568" valign="top">
<p dir="ltr">    Function WriteOnTheScreen() As ExecutionCondition</p>
<p dir="ltr">        Dim mExCn As New ExecutionCondition</p>
<p dir="ltr"> </p>
<p dir="ltr">        Try</p>
<p dir="ltr"> </p>
<p dir="ltr">            Dim x As Integer = 5</p>
<p dir="ltr">            Dim y As Integer = 0</p>
<p dir="ltr">            Dim z As Integer = x / y</p>
<p dir="ltr">            Console.WriteLine(z)</p>
<p dir="ltr">            Console.ReadLine()</p>
<p dir="ltr"> </p>
<p dir="ltr">            mExCn.Reset()</p>
<p dir="ltr"> </p>
<p dir="ltr">        Catch ex As Exception</p>
<p dir="ltr">            mExCn.SetErrorMessage(ex.Message)</p>
<p dir="ltr">        End Try</p>
<p dir="ltr"> </p>
<p dir="ltr">        Return mExCn</p>
<p dir="ltr">    End Function</p>
<p dir="ltr"> </p>
</td>
</tr>
</tbody>
</table>
<p dir="rtl"> </p>
<p dir="rtl">الآن قم بتنفيذ البرنامج ولاحظ ماسيحدث ، سيطبع نص رسالة الخطأ مهما يكن نوع الخطأ الذي حدث ، سواء القسمة على صفر او أي خطأ آخر وتأكد من كلامي جيدا !</p>
<p dir="rtl"> </p>
<p dir="rtl">ختاما ارجو انني قد وفقت في لفت الانتباء الى مسألة التعامل مع الاخطاء في الكائنات المستقلة واذا وجد هنا أي خطأ فأرجو تنبيهي عليه وجل من لا يسهو .</p>
<p dir="rtl"> </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sharepoint: end of "exception state"]]></title>
<link>http://ntoskrnl.wordpress.com/?p=36</link>
<pubDate>Mon, 21 Jul 2008 08:46:41 +0000</pubDate>
<dc:creator>Max</dc:creator>
<guid>http://ntoskrnl.wordpress.com/?p=36</guid>
<description><![CDATA[Good morning,
this weeks starts brilliantly thanks to the help of Chris Winebarger. He gave me a sol]]></description>
<content:encoded><![CDATA[<p>Good morning,</p>
<p>this weeks starts brilliantly thanks to the help of Chris Winebarger. He gave me a solution to put an end to the most infamous sharepoint 0x80020009 exception when trying to activate Sharepoint Publishing Infrastructure on a site collection. Here is the solution with stsadm :</p>
<p><code><br />
stsadm -o activatefeature -filename publishing\feature.xml -url http://URL -force<br />
stsadm -o activatefeature -filename publishingresources\feature.xml -url http://URL  -force<br />
stsadm -o activatefeature -filename publishingSite\feature.xml -url http://URL -force<br />
stsadm -o activatefeature -filename publishingweb\feature.xml -url http://URL -force<br />
stsadm -o activatefeature -filename publishinglayouts\feature.xml -url http://URL -force<br />
stsadm -o activatefeature -filename navigation\feature.xml -url http://URL -force<br />
</code></p>
<p>(Obviously, replace the URL above with the URL of the site collection)</p>
<p>Many thanks to Chris for saving my day!<br />
Max</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Bỏ qua việc kiểm tra null pointer]]></title>
<link>http://javasimple.wordpress.com/?p=17</link>
<pubDate>Mon, 21 Jul 2008 05:07:24 +0000</pubDate>
<dc:creator>Lê Mạnh Cường</dc:creator>
<guid>http://javasimple.wordpress.com/?p=17</guid>
<description><![CDATA[Thường trong khi lập trình bạn không tránh khỏi có lúc quên không kiểm tra xem đ]]></description>
<content:encoded><![CDATA[<p>Thường trong khi lập trình bạn không tránh khỏi có lúc quên không kiểm tra xem đối tượng có null không. Thế nên chúng ta sẽ tìm cách viết code thế nào để quên không kiểm tra mà vẫn không bị lỗi NullPointerException.</p>
<p>Ví dụ code xấu:</p>
<div class="wp_syntax">
<div class="code">
<pre class="java"><span style="color:#000000;font-weight:bold;">private</span> <span style="color:#993333;">boolean</span> isNullString<span style="color:#66cc66;">(</span><span style="color:#aaaadd;font-weight:bold;">String</span> string<span style="color:#66cc66;">)</span> <span style="color:#66cc66;">{</span>
<span style="color:#000000;font-weight:bold;">return</span> <span style="color:#66cc66;">(</span>string.<span style="color:#006600;">equals</span><span style="color:#66cc66;">(</span><span style="color:#ff0000;">""</span><span style="color:#66cc66;">)</span><span style="color:#66cc66;">)</span>;
<span style="color:#66cc66;">}</span></pre>
</div>
</div>
<p>Như bạn thấy nếu ta gọi isNullString(null); thì phương thức trên sẽ tung ra exception.</p>
<p>Ví dụ code ngon:</p>
<div class="wp_syntax">
<div class="code">
<pre class="java"><span style="color:#000000;font-weight:bold;">private</span> <span style="color:#993333;">boolean</span> isNullString<span style="color:#66cc66;">(</span><span style="color:#aaaadd;font-weight:bold;">String</span> string<span style="color:#66cc66;">)</span> <span style="color:#66cc66;">{</span>
<span style="color:#000000;font-weight:bold;">return</span> <span style="color:#66cc66;">(</span><span style="color:#ff0000;">""</span>.<span style="color:#006600;">equals</span><span style="color:#66cc66;">(</span>string<span style="color:#66cc66;">)</span><span style="color:#66cc66;">)</span>;
<span style="color:#66cc66;">}</span></pre>
</div>
</div>
<p>Bây giờ ta có gọi isNullString(null) thì return ("".equals(null)) sẽ trả về false mà không bị Exception.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Income Tax Section 80C, 80CCC, 80CCD, 80CCE]]></title>
<link>http://amitdarda.wordpress.com/2008/07/15/income-tax-section-80c-80ccc-80ccd-80cce/</link>
<pubDate>Tue, 15 Jul 2008 05:02:04 +0000</pubDate>
<dc:creator>amitdarda</dc:creator>
<guid>http://amitdarda.wordpress.com/2008/07/15/income-tax-section-80c-80ccc-80ccd-80cce/</guid>
<description><![CDATA[Section 80C. - Section 80C was inserted from assessment year 2006-2007. It provides deductions from ]]></description>
<content:encoded><![CDATA[<p align="justify"><strong>Section 80C. - </strong>Section 80C was inserted from assessment year 2006-2007. It provides deductions from gross (total) income for qualified amounts paid or deposited by the assessee in the previous year.
<p align="justify">Main Provisions.</p>
<ol>
<li>
<div align="justify">The deduction is available only to an individual or a HUF from the gross total income,</div>
</li>
<li>
<div align="justify">The deduction is allowed irrespective of whether such amount is paid or deposited by the taxpayer out of his income chargable to tax,</div>
</li>
<li>
<div align="justify">The deduction is available on the basis of specified qualifying investments/contributions/payments made by the taxpayer during the previous year,</div>
</li>
<li>
<div align="justify">The maximum amount deductible under section 80C is Rs. 1,00,000. Also the total amount of deductions under sections 80C, 80CCC and 80CCD is Rs. 1,00,000. </div>
</li>
</ol>
<p align="justify"><em>Gross Qualifying Amount for the Deduction</em><br>Following nature of payments are qualifying amounts</p>
<ol>
<li>
<div align="justify">Life insurance premium subject to 20 per cent of sum assured,</div>
</li>
<li>
<div align="justify">Payment in respect to non-commutable deferred annuity, <br>Deferred annuity deducted from Government employee (subject to maximum of 20 per cent of salary), </div>
</li>
<li>
<div align="justify">Contributions (not the repayment of loan) towards statutory provident fund and recognised provident fund,</div>
</li>
<li>
<div align="justify">Contribution towards an approved superannuation fund,<br>Subscription to National Saving Certificates, VIII Issue,</div>
</li>
<li>
<div align="justify">Contribution to ULIP (unit-linked insurance plan) of Unit Trust of India and or LIC Mutual Fund, </div>
</li>
<li>
<div align="justify">Payments for notified annuity plan of LIC including New Jeevan Dhara, New Jeevan Akshary, New Jeevan Dhara I, New Jeevan Akshary I, II and III.</div>
</li>
<li>
<div align="justify">Subscription towards notified units of Mutual Fund or UTI, <br>Contribution to notified pension fund set up by Mutual Fund or UTI, </div>
</li>
<li>
<div align="justify">Any sum paid (and accrued interest) as subscription to Home Loan Account Scheme of National Housing Bank or contribution to any pension fund of National Housing Bank,</div>
</li>
<li>
<div align="justify">Any sum paid as subscription to any scheme of public sector company engaged in providing longterm finance for purchase/construction of residential houses or from the housing board in India engaged in planning and development of cities.</div>
</li>
<li>
<div align="justify">Any sum paid as tution fees for the admission or otherwise to any university/college/educational institution in India for full time eduction for any two children of the taxpayer,</div>
</li>
<li>
<div align="justify">Any payment towards the cost of construction/purchase of residential property including payment of loan taken from Government bank, cooperative bank, LIC, National Housing Bank, taxpayer's employer where such employer is a public company, public sector company, university or cooperative society,</div>
</li>
<li>
<div align="justify">Amount invested in approved debentures of, and equity shares in, a public company engaged in&#160; infrastructure including power sector or units of mutual fund utilised for infrastructure,</div>
</li>
<li>
<div align="justify">Amount in fixed deposits of 5-years or more with a scheduled bank in accordance with a scheme framed and notified by the Central Government (applicable from assessment year 2007-2008),</div>
</li>
<li>
<div align="justify">Subscription to any notified bonds of National Bank for Agriculture or Rural Development (applicable from assessment year 2008-2009), </div>
</li>
<li>
<div align="justify">5-year time deposit in an account under Post Office Time Deposits Rules 1981, and</div>
</li>
<li>
<div align="justify">Deposit in an account under the Senior Citizen Saving Scheme Rules, 2004. </div>
</li>
</ol>
<p align="justify"><strong>Section 80CCC. Deduction for Contribution to Pension Funds</strong> -Section 80CCC provides deductions from gross (total) income for amounts paid or deposited by the assessee to any annuity plan of Life Insurance Corporation of India or any other insurer for receiving pension from the fund referred to in clause (23AAB). </p>
<p align="justify">Main Provisions.</p>
<ol>
<li>
<div align="justify">The deduction is available to an individual who is resident or non-resident, Indian citizen or foreign citizen</div>
</li>
<li>
<div align="justify">The deduction is allowed only if such amount is paid or deposited by the taxpayer out of his income chargable to tax,</div>
</li>
<li>
<div align="justify">The maximum amount deductible under section 80C is Rs. 1,00,000. Also the total amount of deductions under sections 80C, 80CCC and 80CCD is Rs. 1,00,000.</div>
</li>
<li>
<div align="justify">Surrender value received is taxable in the year of receipt in the hands of the assessee or nominee. </div>
</li>
</ol>
<p align="justify"><strong>Section 80CCD. Deduction for contribution to pension scheme of Central Government. - </strong>Deduction is allowed to an individual employed by the Central Government or any other employer on or after the 1st day of January, 2004, has in the previous year paid or deposited any amount in his account under a pension scheme notified or as may be notified by the Central Government. However, the deduction is limited to 10 per cent of his salary in the previous year. </p>
<p align="justify">Where, the Central Government or any other employer makes any contribution to the employee’s account, the employee shall be allowed a deduction in the computation of his total income. However, the deduction is limited to 10 per cent of his salary in the previous year.
<p align="justify">If after claiming the deduction, any amount together with interest or bonus accrued is received by the assessee or his nominee in whole or in part, in any previous year, is taxable of the assessee or his nominee, as the case may be, if it is received --</p>
<ol>
<li>
<div align="justify">On account of the closure or opting out of the pension, or</div>
</li>
<li>
<div align="justify">As pension received from the annuity plan purchased or taken on such closure or opting out. </div>
</li>
</ol>
<p align="justify">Where any amount paid or deposited by the assessee has been allowed as a deduction under section 80CCD —</p>
<ol>
<li>
<div align="justify">No rebate with reference to such amount shall be allowed under section 88;</div>
</li>
<li>
<div align="justify">No deduction with reference to such amount shall be allowed under section 80C. </div>
</li>
</ol>
<p align="justify">Explanation. For the purposes of 80CCD, “salary” includes dearness allowance, if the terms of employment so provide, but excludes all other allowances and perquisites.
<p align="justify"><strong>Section 80CCE.</strong> - The aggregate amount of deductions under section 80C, section 80CCC and section 80CCD shall not, in any case, exceed Rs. 1,00,000.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[[Doujin] Exception - Light Difficulty]]></title>
<link>http://zetsuboushita.wordpress.com/?p=186</link>
<pubDate>Sat, 12 Jul 2008 08:00:10 +0000</pubDate>
<dc:creator>Eryth</dc:creator>
<guid>http://zetsuboushita.wordpress.com/?p=186</guid>
<description><![CDATA[
So I finally get fraps to work and i finally get the time to record my next set of videos which I d]]></description>
<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://zetsuboushita.wordpress.com/files/2008/07/exceptionbanner.jpg"><img class="size-medium wp-image-187 aligncenter" src="http://zetsuboushita.wordpress.com/files/2008/07/exceptionbanner.jpg" alt="" width="95%" /></a></p>
<p>So I finally get fraps to work and i finally get the time to record my next set of videos which I decided to play Exception. I don't know why I decided to play it but I think it's a fun game.</p>
<p>So here is all you need to know about the game. You play as a cube. You can shoot a laser and you can also lock on and fire homing lasers at the locked on targets. You can also rotate and change your angle of fire. Everything in this game is comprised of rectangular prisms and cubes that explode and break up into smaller pieces when destroyed. The harder the difficulty the more cubes are expelled when destroyed.</p>
<p>I played and recorded on Light difficulty which is the easiest difficulty of the game. I will do these videos for all difficulties just to show you the game and how hectic yet fun it can be. Oh and just for the records, i did use the mouse to aim and I have played this game using a controller and it wasn't much different. I think i did worse with the mouse actually since my hand always moved over the touchpad on my laptop.</p>
<p>Here is the first set of videos for easy difficulty. Enjoy and comment... ^^</p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/vNKbsPrQM_E'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/vNKbsPrQM_E&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span><!--more--></p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/ZNCG4fGNlGU'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/ZNCG4fGNlGU&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/jGYUi5_eFrY'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/jGYUi5_eFrY&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/HP0KI7s9JBc'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/HP0KI7s9JBc&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/HSX6ulyOitM'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/HSX6ulyOitM&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Error and Feedback Handling for PHP]]></title>
<link>http://webwok.wordpress.com/?p=48</link>
<pubDate>Thu, 10 Jul 2008 12:50:24 +0000</pubDate>
<dc:creator>3guineas</dc:creator>
<guid>http://webwok.wordpress.com/?p=48</guid>
<description><![CDATA[This is a simple way to handle your errors and warnings and provide users with a feedbackfor their a]]></description>
<content:encoded><![CDATA[<p>This is a simple way to handle your errors and warnings and provide users with a feedbackfor their actions.</p>
<p><strong>The logic</strong></p>
<p>Write an error handler and assign it to the php built-in error handling mechanism (set_error_handler("yourhandler")) where ever you want it to operate. In my case I put it together with the function definition in the file where I keep all my other defaults as such file gets included in all the files of my project, so I avoid to rewrite code for each other file.</p>
<p>The error handler will throw an exception for every error or warning encountered. So, whenever you wish your user to get a message (whether for error or success), put the critical code in a try/catch construct and in the catch body set two session variables, one "alerts" (String) containing the positive/negative messages and one called "input_errors" (Array) which contains the error parameters if any (e.g. if input from forms). Be sure you exit the script or the code that follows will be executed (usually you don't want that especially if a nasty error had occurred).</p>
<p>In the html pages, retrieve the content of the session variables for disaplay (if the variable "input_errors" is empty, we assume that it is a success message) and then delete them from the session.</p>
<p><strong>Implementation</strong></p>
<p>in the file where you keep all your settings and therefore is contained in all the others (def_inc.php susually):</p>
<p>&#60;?<br />
........<br />
//ERROR HANDLING<br />
//setting general error handler<br />
function handleError($errno, $errstr,$error_file,$error_line,$errcontext)<br />
{<br />
$msg= "Sorry some error occurred. ";<br />
$msg.= "&#60;b&#62;Error:&#60;/b&#62; [$errno] $errstr - $error_file:$error_line";<br />
$msg.= "&#60;br /&#62;";<br />
putsession("alerts",$msg);<br />
putsession("input_errors", "some error");<br />
throw new Exception($msg);<br />
}<br />
//set error handler<br />
set_error_handler("handleError");<br />
...........<br />
?&#62;</p>
<p>In the template for html files which display the feedback messages to the user:<br />
&#60;HEAD&#62;<br />
..........<br />
//handle alerts<br />
$alerts=null;<br />
//check for alerts or errors back from the processing code (putsession('alerts','bla,bla...'),putsession('errors',parameter_errors()))<br />
$input_rules["input_errors"][_structure]=_either_structure;<br />
$input_rules["input_errors"][_sources]=_session;<br />
$input_rules["input_errors"][_required]=false;<br />
$input_rules["input_errors"][_fatal]=false;<br />
$input_rules["alerts"][_structure]=_either_structure;<br />
$input_rules["alerts"][_sources]=_session;<br />
$input_rules["alerts"][_required]=false;<br />
$input_rules["alerts"][_fatal]=false;<br />
$parameters = validate_parameters($input_rules);<br />
$errors = isset($parameters["input_errors"])?$parameters["input_errors"]:null;<br />
$alerts =  isset($parameters["alerts"])?$parameters["alerts"]:null;<br />
delsession("input_errors"); //reset input errors to null<br />
delsession("alerts"); //reset alerts to null<br />
.......<br />
&#60;/HEAD&#62;</p>
<p>&#60;BODY&#62;<br />
....<br />
&#60;? //alert and error system<br />
if(isset($alerts)&#124;&#124;isset($errors)){?&#62;<br />
&#60;div id="alerts"&#62;&#60;?<br />
if(isset($errors)){?&#62;<br />
&#60;div class="fail"&#62;&#60;?=$alerts?&#62;&#60;/div&#62;<br />
&#60;? }else{?&#62;<br />
&#60;div class="success"&#62;&#60;?=$alerts?&#62;&#60;/div&#62;<br />
&#60;? } ?&#62;<br />
&#60;/div&#62;<br />
&#60;?<br />
if(!empty($errors["access"]))return;<br />
}//end alerts box<br />
?&#62;<br />
.....<br />
&#60;/BODY&#62;</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Philadelphia 76ers 2008-09 Cap Projection]]></title>
<link>http://downitgoes.wordpress.com/?p=7</link>
<pubDate>Thu, 10 Jul 2008 04:49:49 +0000</pubDate>
<dc:creator>Joe</dc:creator>
<guid>http://downitgoes.wordpress.com/?p=7</guid>
<description><![CDATA[Well, I have been keeping an excel file on my computer with Sixers cap information.  I figure others]]></description>
<content:encoded><![CDATA[<p>Well, I have been keeping an excel file on my computer with Sixers cap information.  I figure others may want to see it.  So I will try to keep this page updated regularly.  I will put one up for 2009-10 as well once Iguodala and Lou are at least signed.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>Sixers 2008-2009 Cap Situation</strong></p>
<p style="margin-bottom:0;">
<table border="0" cellspacing="0" rules="none"><col width="88"></col><col width="86"></col><col width="131"></col><col width="86"></col></p>
<tbody>
<tr>
<td width="88" height="19" align="right">Last Name</td>
<td width="86" align="right">salary($)</td>
<td width="131" align="right">salary($1,000,000)</td>
<td width="86" align="left"></td>
</tr>
<tr>
<td height="19" align="right">Brand:</td>
<td align="right">13757800</td>
<td align="right">13.76</td>
<td align="left">estimate</td>
</tr>
<tr>
<td height="19" align="right">Dalembert:</td>
<td align="right">10520000</td>
<td align="right">10.52</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Miller:</td>
<td align="right">9999999</td>
<td align="right">10</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Iguodala:</td>
<td align="right">10000000</td>
<td align="right">10</td>
<td align="left">estimate</td>
</tr>
<tr>
<td height="19" align="right">Evans:</td>
<td align="right">4640000</td>
<td align="right">4.64</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Williams:</td>
<td align="right">4500000</td>
<td align="right">4.5</td>
<td align="left">estimate</td>
</tr>
<tr>
<td height="19" align="right">Green:</td>
<td align="right">3388000</td>
<td align="right">3.39</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Young:</td>
<td align="right">1968120</td>
<td align="right">1.97</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Smith:</td>
<td align="right">1326360</td>
<td align="right">1.33</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Speights:</td>
<td align="right">1285500</td>
<td align="right">1.29</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Gordon:</td>
<td align="right">442114</td>
<td align="right">0.44</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">spot #12</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">spot #13</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">spot #14</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">spot #15</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Salary Cap:</td>
<td align="right">58680000</td>
<td align="right">58.68</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Luxury Tax:</td>
<td align="right">71150000</td>
<td align="right">71.15</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Total:</td>
<td align="right">61827893</td>
<td align="right">61.83</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Cap space:</td>
<td align="right">-3147893</td>
<td align="right">-3.15</td>
<td align="left"></td>
</tr>
<tr>
<td height="19" align="right">Tax space:</td>
<td align="right">9322107</td>
<td align="right">9.32</td>
<td align="left"></td>
</tr>
</tbody>
</table>
<p style="margin-bottom:0;">A few notes...</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">This is not right now.  This is a projection for once Andre and Lou are signed.  I am using estimates for Lou and Iggy right now.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">The estimates are for the first year of the contracts for Iggy and Lou.  For example, Iggy could sign a deal starting at 9 with 10.5% increases and still make 10.89 million on average per year.  That is the least I can see Iguodala making personally.  I took the middle ground between the least and most I can see the players making year 1 in my calculations.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Jamont Gordon or another rookie have to make the team.  I put him since he is on the summer league and fits a need.  McClellan from Arizona is a favorite as well as Pat Carroll I would think.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><strong>Exceptions available:</strong></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">None.  By exercising their cap space, the Sixers lost any trade exception or mid-level exception.  All they have is the minimum player exception meaning they can only sign players for the minimum.</p>
<p style="margin-bottom:0;">The Sixers are going to have to do this the hard way and that is via trades and minimum salary players.  Hopefully some vets find the young blood in Philadelphia appealing for their championship aspirations.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[A-610: Tout ça pour... ça?]]></title>
<link>http://richard3.wordpress.com/?p=672</link>
<pubDate>Mon, 23 Jun 2008 04:03:57 +0000</pubDate>
<dc:creator>Richard3</dc:creator>
<guid>http://richard3.wordpress.com/?p=672</guid>
<description><![CDATA[La naissance de l&#8217;autoroute 610, en Estrie, est pratiquement passée inaperçue, parce que tou]]></description>
<content:encoded><![CDATA[<p>La naissance de l'autoroute 610, en Estrie, est pratiquement passée inaperçue, parce que tout ce qui était un tant soit peu gouvernemental, à ce moment précis, était à Laval, en train de faire des pirouettes pour convaincre les gens que le réseau routier québécois était fiable, et que le viaduc de la Concorde, ou à tout le moins le trou béant devant lequel ils se tenaient, puisque le viaduc venait de s'effondrer, ne représentait qu'un événement isolé.</p>
<p>Dans les faits, qu'est-ce que l'A-610, au juste?  Pour ceux qui sont familiers avec les autoroutes de l'Estrie, mais qui ne passent pas souvent dans le coin, pensez au dernier tronçon de l'A-10, qui commençait à la sortie 143, et qui se rendait jusqu'à la route 112, à Fleurimont.  C'est ce tronçon qui fut rebaptisé A-610.  Je ne comprends toujours pas la logique derrière cette manoeuvre du MTQ.  J'ai d'ailleurs écrit au ministère, afin que l'on m'explique, de façon claire, quel sera le réseau autoroutier du futur, selon leurs prévisions.  À part un accusé réception, je n'ai pas eu d'autres nouvelles de cette requête.</p>
<p>Voyons donc voir quelques petits détails de l'A-610.</p>
<p><a href="http://richard3.files.wordpress.com/2008/06/120i.jpg"><img class="alignnone size-full wp-image-673" src="http://richard3.wordpress.com/files/2008/06/120i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">Voici le panneau indiquant le début de l'A-610, que l'on voit quand on arrive de Drummondville, via l'A-55 sud, dans un endroit situé plus ou moins à mi-chemin entre Bromptonville et le centre-ville de Sherbrooke.  Comme on peut le voir, le changement de logo, sur le panneau, n'est pas des plus réussis.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/123i.jpg"><img class="alignnone size-full wp-image-674" src="http://richard3.wordpress.com/files/2008/06/123i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">L'A-610 file vers l'est, à travers la chaîne des Appalaches.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/129i.jpg"><img class="alignnone size-full wp-image-675" src="http://richard3.wordpress.com/files/2008/06/129i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">Un autre rapiéçage de panneau plutôt bâclé.  Surtout que celui-ci indique qu'il n'y a plus de services, à la sortie 7, qui fut autrefois la sortie 150 de l'A-10.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/126i.jpg"><img class="alignnone size-full wp-image-676" src="http://richard3.wordpress.com/files/2008/06/126i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">Une autre preuve du rapiéçage passablement ordinaire des panneaux de l'A-610.  Selon la logique actuellement appliquée par le MTQ, on devrait plutôt voir le logo de l'A-610, suivi du mot "ouest", puis des logos de l'A-10 et de l'A-55, le tout sur une même ligne, puisque c'est là que mène l'A-610.  Mais bon, on s'est contenté de masquer le logo de l'A-10 avec un de l'A-610.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/138i.jpg"><img class="alignnone size-full wp-image-677" src="http://richard3.wordpress.com/files/2008/06/138i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">Dans l'autre sens, et un peu à contrejour, on voit au loin la séparation des chaussées, à environ un kilomètre à l'est de la sortie 7.  Les trois derniers kilomètres de l'A-610 sont construits en super-2.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/135i.jpg"><img class="alignnone size-full wp-image-678" src="http://richard3.wordpress.com/files/2008/06/135i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">Ici, à deux kilomètres de la sortie 7, on peut voir qu'à quelques exceptions près, le terrain nécessaire à la construction de la deuxième chaussée est bien dégagé.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/132i.jpg"><img class="alignnone size-full wp-image-679" src="http://richard3.wordpress.com/files/2008/06/132i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">C'est la fin de l'A-610.  Elle se termine bêtement, à la hauteur de la route 112, dans l'ancienne ville de Fleurimont, qui fait désormais partie de la ville de Sherbrooke.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/06/139i.jpg"><img class="alignnone size-full wp-image-680" src="http://richard3.wordpress.com/files/2008/06/139i.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#993366;">Vous aimez les autoroutes aux fins toutes bêtes?  À Sherbrooke, vous serez bien servis.  Encore plus bête que celle de l'A-610, voici la fin de l'A-410, au boulevard de l'Université.  Comme vous le voyez, on a construit une jolie courbe, plutôt accentuée, puis on a fait une belle pente, pas très longue, au bout de laquelle on a installé un feu de circulation.  Tout ce qu'il faut pour se casser la gueule!  On dit depuis des années que l'A-410 sera prolongée vers Lennoxville, mais il semble que les travaux pourraient débuter en 2009, pour une ouverture possible en 2013.  Reste à voir si cet échéancier tiendra le coup.</span></em></p>
<p>J'avoue que je n'ai pas écrit beaucoup de billets depuis une dizaine de jours.  À part le temps que je passe à répondre à vos commentaires (en passant, merci beaucoup à ceux qui m'écrivent, et ne vous gênez surtout pas!), j'ai procédé à quelques achats, dernièrement, dont un nouvel ordinateur, qui me fait royalement chier depuis une semaine, ainsi qu'un projet de "blogue-mobile", que je vais récupérer ce lundi, et qui prend les airs d'une vieille Jeep Cherokee Chief, de couleur bleue.  Je vous tiendrai au courant des derniers développements dans les deux cas.</p>
<p>D'ici-là, suite à une question de Sam, je tenterai de savoir où se termine la route 155.  Je vous montrerai aussi des travaux sur l'A-20, en Montérégie, sur l'A-10, dans les Cantons-de-l'Est, ainsi que d'autres bouts de routes intéressants, dont un lien inter-rives, où l'on roule sur rien de moins qu'un barrage d'Hydro-Québec!  Alors n'allez pas trop loin, car les prochains jours risquent d'être captivants pour les amateurs de routes.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Firefox 3: "Codigo de error: sec_error_untrusted_issuer"]]></title>
<link>http://kas34.wordpress.com/?p=26</link>
<pubDate>Fri, 20 Jun 2008 11:03:29 +0000</pubDate>
<dc:creator>Andres Vigil Rguez.</dc:creator>
<guid>http://kas34.wordpress.com/?p=26</guid>
<description><![CDATA[Si usais Firefox 3, seguramente en algún momento os habrá salido este error, a la hora de identifi]]></description>
<content:encoded><![CDATA[<p>Si usais Firefox 3, seguramente en algún momento os habrá salido este error, a la hora de identificaros en una página por ejemplo.<br />
Llevaba desde que instalé Hardy Heron con Firefox 3, y no sabía como hacer para acceder a páginas donde me saltaba este error, para lo que abría el VirtualBox, y accedía a la página con IE...<br />
El codigo del error es: <strong><em>sec_error_untrusted_issuer</em></strong><br />
No se a que se debe, pero se que para que nos os salga más el error y podais acceder a la página en cuestión, debeis agregar una nueva excepcion. Para ello se muestra un link, que debemos pulsar.<br />
Una vez añadida la excepción, ya podremos acceder perfectamente.<br />
Saludos!</p>
<p>EDITO:<br />
Aqui una imagen del error que nos da.<br />
Debemos clickear en el enlace que vemos rodeado de negro.<br />
<a href="http://kas34.files.wordpress.com/2008/09/cacert1.png"><img src="http://kas34.wordpress.com/files/2008/09/cacert1.png" alt="" width="400" height="202" class="alignnone size-full wp-image-33" /></a><br />
Despues, seguir los pasos para agregar la excepción.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[0xC0000005]]></title>
<link>http://windowserrors.wordpress.com/?p=3</link>
<pubDate>Sun, 20 Jul 2008 17:57:13 +0000</pubDate>
<dc:creator>windowserrors</dc:creator>
<guid>http://windowserrors.wordpress.com/?p=3</guid>
<description><![CDATA[ 
Finding a Solution for the 0xC0000005 error.
This is a fairly common Windows access violation err]]></description>
<content:encoded><![CDATA[<p> </p>
<p>Finding a Solution for the <strong>0xC0000005 error</strong>.</p>
<p>This is a fairly common Windows access violation error and hopefully this article will help you resolve the problems you are having:</p>
<p><a href="http://www.updatexp.com/0xC0000005.html"><strong>http://www.updatexp.com/0xC0000005.html</strong></a></p>
<p>Kind Regards</p>
<p><strong>Marc Liron - Microsoft MVP</strong></p>
]]></content:encoded>
</item>

</channel>
</rss>
