<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xml:lang="fr">
  
  <title type="html">Le blog à Fred</title>
  <subtitle type="html">Le blog principal</subtitle>
  
  <link href="http://frederic.praca.free.fr/index.php?" rel="alternate" type="text/html" title="Le blog principal" />
  <updated>2013-06-10T09:13:34+02:00</updated>
  <author>
    <name>Fred</name>
  </author>
  <id>urn:md5:aa8fdbf61072948b94b6b73fbda45c54</id>
  <generator uri="http://www.dotclear.org/">Dotclear</generator>
  
    
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BlogAFred-Atom" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="blogafred-atom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    <title>Balancing bullshits</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits" rel="alternate" type="text/html" title="Balancing bullshits" />
    <id>urn:md5:082ace6564093731481152110606184d</id>
    <published>2013-04-19T14:22:00+02:00</published>
    <updated>2013-06-07T09:11:54+02:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
        <dc:subject>Ada</dc:subject><dc:subject>CORBA</dc:subject><dc:subject>Java</dc:subject>    
    <content type="html">&lt;p&gt;After &lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits"&gt;spreading bullshits&lt;/a&gt;, our &lt;em&gt;Bullshit Company&lt;/em&gt; has been overflown by bullshit requests.&lt;br /&gt;
It's time to provide a bigger architecture than the one we used. Let's balance the &lt;a href="http://cbsg.sourceforge.net/cgi-bin/live" hreflang="en" title="Bullshit Generator"&gt;Bullshit Generator&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
For the impatients, this post will deal with several problems that a beginner could encounter or fear : &lt;em&gt;exceptions handling&lt;/em&gt; and &lt;em&gt;sequences&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;After dealing with millions of requests, our &lt;em&gt;CBSG&lt;/em&gt; server was unable to answer to all of these.&lt;br /&gt;
A solution is to provide a &lt;a href="http://en.wikipedia.org/wiki/Load_balancing_%28computing%29" hreflang="en"&gt;load balancing&lt;/a&gt; &lt;em&gt;CBSG&lt;/em&gt;.&lt;br /&gt;
To do this, we planned to dispatch several &lt;em&gt;CBSG&lt;/em&gt; servants on different machines. These servants will have to register themselves to a &lt;em&gt;CBSGBalancer&lt;/em&gt;.%%
&lt;br /&gt;
Let's start with &lt;em&gt;IDL&lt;/em&gt;.&lt;br /&gt;
We add the following at the end of our previous file:&lt;/p&gt;
&lt;pre class="cpp cpp" style="font-family:inherit"&gt;&lt;span style="color: #666666;"&gt;// This exception is thrown when a client is asking for a CBSG&lt;/span&gt;
  &lt;span style="color: #666666;"&gt;//And no more are available&lt;/span&gt;
  exception NoMoreCBSGAvailable
  &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
  &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
  &lt;span style="color: #666666;"&gt;//This exception is thrown when a servant tries to unregister&lt;/span&gt;
  &lt;span style="color: #666666;"&gt;//itself and that a client still uses it&lt;/span&gt;
  exception CBSGInUse
  &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
  &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
  &lt;span style="color: #0000ff;"&gt;typedef&lt;/span&gt; sequence&lt;span style="color: #000080;"&gt;&amp;lt;&lt;/span&gt;CBSG&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt; CBSGSeq&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
  &lt;span style="color: #666666;"&gt;//Our load-balancing object&lt;/span&gt;
  interface CBSGBalancer&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
    &lt;span style="color: #666666;"&gt;//This method allows to register a new servant to put in the balancer&lt;/span&gt;
    &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;register&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;in CBSG newServant&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #666666;"&gt;//This method should be called when a servant is shut down&lt;/span&gt;
    &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; unregister&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;in CBSG servantToRemove&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; raises &lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CBSGInUse&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #666666;"&gt;//This method is for client wanting to use a CBSG&lt;/span&gt;
    CBSG reserve&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; raises &lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;NoMoreCBSGAvailable&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #666666;"&gt;//This method allows a client to reserve several CBSG&lt;/span&gt;
    &lt;span style="color: #666666;"&gt;//Less than the parameter could be returned depending on the number available&lt;/span&gt;
    &lt;span style="color: #666666;"&gt;//The exception is thrown when none can be returned&lt;/span&gt;
    CBSGSeq reserveSeveral&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;in &lt;span style="color: #0000ff;"&gt;long&lt;/span&gt; numberToReserve&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; raises &lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;NoMoreCBSGAvailable&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #666666;"&gt;//This method must be called by client to &lt;/span&gt;
    &lt;span style="color: #666666;"&gt;//release a previously reserved CBSG&lt;/span&gt;
    &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; release&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;in CBSG noMoreUsedCBSG&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
  &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;The IDL code is self-explanatory and reflects what we described before.&lt;br /&gt;
Take care of keeping your last &lt;em&gt;*-impl.ad[sb]&lt;/em&gt; as the generation will overwrite them&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#pnote-635-1" id="rev-pnote-635-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
We generate Ada code from it like in the previous post:&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ iac -i ../idl/cbsg.idl
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Ok, now, we have to write the code of our balancer.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;The Balancer&lt;/h2&gt;

&lt;p&gt;First of all, let's modify the spec :&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #adadad; font-style: italic;"&gt;--[snip...]&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;=&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Left, Right : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; Boolean;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;private&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;package&lt;/span&gt; Ref_Vectors &lt;span style="color: #00007f;"&gt;is&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Containers&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Vectors&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Index_Type =&amp;gt; Positive,
						     Element_Type =&amp;gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;
						    &lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;type&lt;/span&gt; Object &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
     &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;Servant_Base&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;record&lt;/span&gt;
	Usable_Refs : Ref_Vectors.&lt;span style="color: #202020;"&gt;Vector&lt;/span&gt;;
	In_Use_Refs : Ref_Vectors.&lt;span style="color: #202020;"&gt;Vector&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;record&lt;/span&gt;;
&lt;span style="color: #adadad; font-style: italic;"&gt;--[snip...]&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;We will use a standard Ada &lt;a href="http://www.adaic.org/resources/add_content/standards/05rm/html/RM-A-18-2.html" hreflang="en"&gt;Vector&lt;/a&gt; to keep our &lt;em&gt;CBSG&lt;/em&gt; servants. As a consequence, we need a way to test equality on &lt;em&gt;CBSG&lt;/em&gt; references.&lt;br /&gt;
As you can see, we use to vectors for this. This is easy, one for available servants and the other for busy ones.&lt;br /&gt;
Now, here's the implementation. First, the &lt;em&gt;register&lt;/em&gt; method :&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; register
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object;
      newServant : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      Ref_Vectors.&lt;span style="color: #202020;"&gt;Append&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;Usable_Refs&lt;/span&gt;, NewServant&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;A servant was registered&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;It corbaloc is &amp;quot;&lt;/span&gt; &amp;amp; To_Standard_String&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;NewServant&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; register;&lt;/pre&gt;

&lt;p&gt;In fact, we will not receive &lt;em&gt;CBSG&lt;/em&gt; servants directly but references to them&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#pnote-635-2" id="rev-pnote-635-2"&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
We simply add the reference to our vector.&lt;br /&gt;
As in every quick and dirty code, we use standard output for logging :D&lt;br /&gt;
Off course, using &lt;a href="http://www.codelabs.ch/alog/" hreflang="en"&gt;Alog&lt;/a&gt;, &lt;a href="http://libre.adacore.com/tools/gnat-component-collection/" hreflang="en"&gt;GNATCOLL&lt;/a&gt; or &lt;em&gt;whatever&lt;/em&gt; logging framework would be smarter.&lt;br /&gt;
After registering, we need unregistering&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; unregister
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object;
      servantToRemove : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
      Index : Ref_Vectors.&lt;span style="color: #202020;"&gt;Cursor&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- first, test if present in usable&lt;/span&gt;
      index := Ref_Vectors.&lt;span style="color: #202020;"&gt;Find&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;Usable_Refs&lt;/span&gt;, ServantToRemove&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Index /= Ref_Vectors.&lt;span style="color: #202020;"&gt;No_Element&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
	 Ref_Vectors.&lt;span style="color: #202020;"&gt;Delete&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;Usable_Refs&lt;/span&gt;, Index&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;else&lt;/span&gt;
	 &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt; CBSGInUse;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; unregister;&lt;/pre&gt;

&lt;p&gt;We simply remove from the vector where it's referenced... Well, this could be better as we can imagine that the servant which is unregistering would probably quit anyway but reliability is not part of this post :)&lt;br /&gt;
As you could have seen exceptions in CORBA are just plain old Ada exceptions. That's all !!!&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; reserve
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
     &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
      First_Cursor : Ref_Vectors.&lt;span style="color: #202020;"&gt;Cursor&lt;/span&gt; := Ref_Vectors.&lt;span style="color: #202020;"&gt;First&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;Usable_Refs&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      Returned_Ref : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;First_Cursor /= Ref_Vectors.&lt;span style="color: #202020;"&gt;No_Element&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
	 Returned_ref := Ref_Vectors.&lt;span style="color: #202020;"&gt;Element&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;First_Cursor&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;Sending &amp;quot;&lt;/span&gt; &amp;amp; To_Standard_String&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Returned_Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- we put it in use&lt;/span&gt;
	 Ref_Vectors.&lt;span style="color: #202020;"&gt;Append&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;In_Use_Refs&lt;/span&gt;, Ref_Vectors.&lt;span style="color: #202020;"&gt;Element&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;First_Cursor&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- we remove it from usable&lt;/span&gt;
	 Ref_Vectors.&lt;span style="color: #202020;"&gt;Delete&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;Usable_Refs&lt;/span&gt;, First_Cursor&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;else&lt;/span&gt;
	 &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt; NoMoreCBSGAvailable;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; Returned_Ref;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; reserve;&lt;/pre&gt;

&lt;p&gt;Now what about sequences we use in &lt;em&gt;reserveSeveral&lt;/em&gt;?&lt;br /&gt;
Well, it's more complicated than in other languages but let's check.&lt;br /&gt;
In our case as sequence is a &lt;em&gt;typedef&lt;/em&gt; in our package, the specification is in &lt;em&gt;corbacbsg.ads&lt;/em&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #adadad; font-style: italic;"&gt;--snip&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;package&lt;/span&gt; CBSG_Forward &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
     &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Forward&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #adadad; font-style: italic;"&gt;--snip&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;package&lt;/span&gt; IDL_SEQUENCE_CorbaCBSG_CBSG_Forward &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
     &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Sequences&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Unbounded&lt;/span&gt;
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG_Forward&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;type&lt;/span&gt; CBSGSeq &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
     &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;IDL_SEQUENCE_CorbaCBSG_CBSG_Forward&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Sequence&lt;/span&gt;;
&lt;span style="color: #adadad; font-style: italic;"&gt;--snip&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;In fact, in PolyORB, &lt;em&gt;sequences&lt;/em&gt; don't contain directly our object but an adapter object called &lt;em&gt;Forward&lt;/em&gt; as explain on &lt;a href="http://kothar.net/blog/brief-introduction-to-polyorb.html" hreflang="en"&gt;Khotar Labs blog&lt;/a&gt;. So we won't be able to return a reference array but an array of forward objects containing references.&lt;br /&gt;
As sequences are instanciations of &lt;em&gt;CORBA.Sequences.Unbounded&lt;/em&gt; generic package which in fact are &lt;em&gt;PolyORB.Sequences.Unbounded&lt;/em&gt;, all we need is in the &lt;em&gt;polyorb-sequences-unbounded.ads&lt;/em&gt; file.&lt;br /&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #adadad; font-style: italic;"&gt;--snip&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; reserveSeveral
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object;
      NumberToReserve : CORBA.&lt;span style="color: #202020;"&gt;Long&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
     &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGSeq&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
      &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Convert_Forward&lt;/span&gt;;
&amp;nbsp;
      Returned_Seq : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGSeq&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;for&lt;/span&gt; Index &lt;span style="color: #46aa03; font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;..&lt;span style="color: #202020;"&gt;NumberToReserve&lt;/span&gt; &lt;span style="color: #00007f;"&gt;loop&lt;/span&gt;
	 &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
	    Append&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Returned_Seq, 
		   To_Forward&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;
			      Reserve&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
			     &lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 &lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
	    &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; NoMoreCBSGAvailable =&amp;gt;
	       &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Index = &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
		  &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt;;
	       &lt;span style="color: #00007f;"&gt;else&lt;/span&gt;
		  &lt;span style="color: #46aa03; font-weight:bold;"&gt;exit&lt;/span&gt;;
	       &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
	 &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;loop&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; Returned_Seq;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; reserveSeveral;
&lt;span style="color: #adadad; font-style: italic;"&gt;--snip&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;In order to convert our objects into &lt;em&gt;forward&lt;/em&gt; objects, we need to use the &lt;em&gt;To_Forward&lt;/em&gt; function. This function is defined as a package called &lt;em&gt;Convert_Forward&lt;/em&gt; in the file representing the object to store. In our case, it will be in &lt;em&gt;CorbaCBSG-cbsg.ads&lt;/em&gt;.&lt;br /&gt;
Once the object has been converted, we can put it in our sequence using &lt;em&gt;Append&lt;/em&gt;... Easy :)&lt;br /&gt;
Well, this implementation is not really great as it can return fewer references than requested but it conforms to our spec in the IDL file ;)&lt;br /&gt;
&lt;br /&gt;
Finally, the &lt;em&gt;release&lt;/em&gt; function is quite simple.&lt;br /&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; release
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object;
      noMoreUsedCBSG : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
      In_Use_Cursor : Ref_Vectors.&lt;span style="color: #202020;"&gt;Cursor&lt;/span&gt; := Ref_Vectors.&lt;span style="color: #202020;"&gt;Find&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;In_Use_Refs&lt;/span&gt;, noMoreUsedCBSG&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- we remove it from in use vector if present&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;In_Use_Cursor /= Ref_Vectors.&lt;span style="color: #202020;"&gt;No_Element&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
	 Ref_Vectors.&lt;span style="color: #202020;"&gt;Delete&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;In_Use_Refs&lt;/span&gt;, In_Use_Cursor&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 Ref_Vectors.&lt;span style="color: #202020;"&gt;Append&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self.&lt;span style="color: #202020;"&gt;Usable_Refs&lt;/span&gt;, NoMoreUsedCBSG&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; release;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
The last function to implement is the equality for our objects. As &lt;em&gt;Corbaloc&lt;/em&gt; are unique, the test only deals with this :&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;=&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Left, Right : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; Boolean
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;left&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; = PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;right&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
	 &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; True;
      &lt;span style="color: #00007f;"&gt;else&lt;/span&gt;
	 &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; False;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;=&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Our servant is implemented, so it's time to expose it :&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #adadad; font-style: italic;"&gt;-- allows to specify to PolyORB how to run&lt;/span&gt;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Balancer &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- We retrieve paramaters defined in CORBA standard such a InitialRef&lt;/span&gt;
      Argv : CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Arg_List&lt;/span&gt; := CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Command_Line_Arguments&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- We initialize our bus as ORB&lt;/span&gt;
      CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Init&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Argv&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- The PortableObjectAdapter is where we store our objects&lt;/span&gt;
         Root_POA : PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Local_Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- we declare a reference on it&lt;/span&gt;
         Ref : CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- and its implementation&lt;/span&gt;
         Obj : &lt;span style="color: #46aa03; font-weight:bold;"&gt;constant&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_Ptr&lt;/span&gt; := &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Get the root POA&lt;/span&gt;
         Root_POA := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_Local_Ref&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Resolve_Initial_References&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;RootPOA&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Start it&lt;/span&gt;
         PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Activate&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Get_The_POAManager&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Create a reference in the POA&lt;/span&gt;
         Ref := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Servant_To_Reference&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA, PortableServer.&lt;span style="color: #202020;"&gt;Servant&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Obj&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Display the IOR&lt;/span&gt;
         Put_Line
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         New_Line;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  and the corbaloc&lt;/span&gt;
         Put_Line
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  Launch the server. CORBA.ORB.Run is supposed to never return,&lt;/span&gt;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  print a message if it does.&lt;/span&gt;
&amp;nbsp;
         CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Run&lt;/span&gt;;
&amp;nbsp;
         Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB main loop terminated!&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; E : &lt;span style="color: #46aa03; font-weight:bold;"&gt;others&lt;/span&gt; =&amp;gt;
      Put_Line
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;CBSG Balancer server raised &amp;quot;&lt;/span&gt; &amp;amp; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Exception_Information&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;E&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Balancer;&lt;/pre&gt;

&lt;p&gt;There's nothing special to say about it, so we go on with the &lt;em&gt;CBSG&lt;/em&gt; that will register to the &lt;em&gt;balancer&lt;/em&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;The registering &lt;em&gt;CBSG&lt;/em&gt;&lt;/h2&gt;

&lt;p&gt;In fact, our previously implemented &lt;em&gt;CBSG&lt;/em&gt; is still usable without any modification. The only thing we have to do is to change the way we launch it.&lt;br /&gt;
This time, we will also need a reference to the balancer and we will need to register it.&lt;br /&gt;
The code is really simple.&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #adadad; font-style: italic;"&gt;-- Specify to PolyORB how to dea with tasks&lt;/span&gt;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Registering_Servant &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- Allows to get parameters as defined in Corba standard like InitialRef&lt;/span&gt;
      Argv : CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Arg_List&lt;/span&gt; := CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Command_Line_Arguments&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- Init our bus under ORB name&lt;/span&gt;
      CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Init&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Argv&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- PortableObjectAdapter is where we store our objects&lt;/span&gt;
         Root_POA : PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Local_Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- We declare a reference for our object&lt;/span&gt;
         Ref : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- and its implementation&lt;/span&gt;
         Obj : &lt;span style="color: #46aa03; font-weight:bold;"&gt;constant&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_Ptr&lt;/span&gt; := &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- we declare a reference to the balancer&lt;/span&gt;
	 Balancer : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
	 CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Initialize&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; Argument_Count &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt; .. &lt;span style="color: #ff0000;"&gt;2&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
	    Put_Line
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;usage: registered_servant &amp;lt;IOR_string_from_server&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	    &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
	 &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;--  Get a reference on the distributed object through its IOR or corbaloc&lt;/span&gt;
	 CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;String_To_Object&lt;/span&gt;
	   &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Argument&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Balancer&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Check the reference is correct&lt;/span&gt;
	 &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Is_Nil&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Balancer&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
	    Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;main : cannot invoke on a nil reference&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	    &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
	 &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;; 
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Get the root&lt;/span&gt;
	 Root_POA := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_Local_Ref&lt;/span&gt;
	   &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Resolve_Initial_References&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;RootPOA&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Start our POA&lt;/span&gt;
	 PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Activate&lt;/span&gt;
	   &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Get_The_POAManager&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- We create a ref to expose it&lt;/span&gt;
	 Ref := CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_Ref&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Servant_To_Reference&lt;/span&gt;
					       &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA, PortableServer.&lt;span style="color: #202020;"&gt;Servant&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Obj&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- we display the IOR&lt;/span&gt;
	 Put_Line
	   &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 New_Line;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;--  and the CorbaLoc&lt;/span&gt;
	 Put_Line
	   &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Ask to register to the balancer&lt;/span&gt;
	 CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Register&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Balancer, Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;--  Launch the server. CORBA.ORB.Run is supposed to never return,&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;--  print a message if it does.&lt;/span&gt;
&amp;nbsp;
	 CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Run&lt;/span&gt;;
&amp;nbsp;
	 Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB main loop terminated!&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; E : &lt;span style="color: #46aa03; font-weight:bold;"&gt;others&lt;/span&gt; =&amp;gt;
      Put_Line
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;CBSG server raised &amp;quot;&lt;/span&gt; &amp;amp; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Exception_Information&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;E&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Registering_Servant;&lt;/pre&gt;

&lt;p&gt;In this code, we launch our server with a parameter which is the &lt;em&gt;IOR&lt;/em&gt; of our &lt;em&gt;balancer&lt;/em&gt;. This parameter allows to get a reference on it in order to call the &lt;em&gt;register&lt;/em&gt; function.&lt;br /&gt;
That's all for it.&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;Our Java client&lt;/h2&gt;

&lt;p&gt;This time, we will use a &lt;em&gt;Java&lt;/em&gt; client to request bullshits.&lt;br /&gt;&lt;/p&gt;
&lt;pre class="java java" style="font-family:inherit"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;org.omg.CORBA.*&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;CorbaCBSG.*&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #000000; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;class&lt;/span&gt; CBSGClient
&lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
    &lt;span style="color: #000000; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;static&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;void&lt;/span&gt; main&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #003399;"&gt;String&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt; argv&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
	&lt;span style="color: #666666; font-style: italic;"&gt;//First, init the ORB&lt;/span&gt;
	&lt;span style="color: #003399;"&gt;ORB&lt;/span&gt; orb &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #003399;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #006633;"&gt;init&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;argv, &lt;span style="color: #000066; font-weight: bold;"&gt;null&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&amp;nbsp;
	org.&lt;span style="color: #006633;"&gt;omg&lt;/span&gt;.&lt;span style="color: #006633;"&gt;CORBA&lt;/span&gt;.&lt;span style="color: #003399;"&gt;Object&lt;/span&gt; obj &lt;span style="color: #339933;"&gt;=&lt;/span&gt; orb.&lt;span style="color: #006633;"&gt;string_to_object&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;argv&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
	CBSGBalancer cbsgBalancer &lt;span style="color: #339933;"&gt;=&lt;/span&gt; CBSGBalancerHelper.&lt;span style="color: #006633;"&gt;narrow&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;obj&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style="color: #000000; font-weight: bold;"&gt;try&lt;/span&gt;
	&lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
	    CBSG&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt; cbsgArray &lt;span style="color: #339933;"&gt;=&lt;/span&gt; cbsgBalancer.&lt;span style="color: #006633;"&gt;reserveSeveral&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&amp;nbsp;
	    &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;int&lt;/span&gt; i&lt;span style="color: #339933;"&gt;=&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt; i &lt;span style="color: #339933;"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt; i&lt;span style="color: #339933;"&gt;++&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;
	    &lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
		&lt;span style="color: #003399;"&gt;String&lt;/span&gt; returned_l &lt;span style="color: #339933;"&gt;=&lt;/span&gt; cbsgArray&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color: #006633;"&gt;createSentence&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
		&lt;span style="color: #003399;"&gt;System&lt;/span&gt;.&lt;span style="color: #006633;"&gt;out&lt;/span&gt;.&lt;span style="color: #006633;"&gt;println&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;quot;The generator &amp;quot;&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; i &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;&amp;quot; said : &amp;quot;&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; returned_l&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span style="color: #666666; font-style: italic;"&gt;// We release it&lt;/span&gt;
		cbsgBalancer.&lt;span style="color: #006633;"&gt;release&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;cbsgArray&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
	    &lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;
	&lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;
	&lt;span style="color: #000000; font-weight: bold;"&gt;catch&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;NoMoreCBSGAvailable ex&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;
	&lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
	    &lt;span style="color: #003399;"&gt;System&lt;/span&gt;.&lt;span style="color: #006633;"&gt;out&lt;/span&gt;.&lt;span style="color: #006633;"&gt;println&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;quot;Ouch !! We can't reserve one CBSG&amp;quot;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
	&lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Simple !!&lt;br /&gt;
I won't describe here how &lt;em&gt;Java&lt;/em&gt; deals with &lt;em&gt;Corba&lt;/em&gt; through &lt;em&gt;helpers&lt;/em&gt;, &lt;em&gt;Operations&lt;/em&gt;' classes.&lt;br /&gt;
Ok, I forgot one thing and you could say :&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;What about using sequences in &lt;em&gt;Ada&lt;/em&gt; ?&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Ok, we will implement a client in &lt;em&gt;Ada&lt;/em&gt; to show it :)&lt;br /&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;Procedure&lt;/span&gt; Balanced_Client &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&amp;nbsp;
   Argv : CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Arg_List&lt;/span&gt; := CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Command_Line_Arguments&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- We declare a reference to the balancer&lt;/span&gt;
   Balancer : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- The sequence of CBSG to call&lt;/span&gt;
   Callees : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGSeq&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- Init the ORB&lt;/span&gt;
   CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Init&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Argv&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; Argument_Count &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt; .. &lt;span style="color: #ff0000;"&gt;2&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
      Put_Line
	&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;usage: balanced_client &amp;lt;IOR_string_from_server&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- Get our balancer through its corbaloc or IOR&lt;/span&gt;
   CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;String_To_Object&lt;/span&gt;
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Argument&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Balancer&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- Check it's correct&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Is_Nil&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Balancer&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
      Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;main : cannot invoke on a nil reference&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;; 
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- Ask several CBSG to the balancer&lt;/span&gt;
   Callees := CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;ReserveSeveral&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Balancer, &lt;span style="color: #ff0000;"&gt;2&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- Call each one&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;for&lt;/span&gt; Index &lt;span style="color: #46aa03; font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;..&lt;span style="color: #202020;"&gt;CorbaCBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Length&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Callees&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;loop&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
	 The_Cbsg : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt; := 
	   CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Convert_Forward&lt;/span&gt;
	   .&lt;span style="color: #202020;"&gt;From_Forward&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;
			 CorbaCBSG.&lt;span style="color: #202020;"&gt;Get_Element&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Callees, Index&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
			&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Call the element&lt;/span&gt;
	 Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;The generator &amp;quot;&lt;/span&gt; &amp;amp; Positive'Image&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Index&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot; said : &amp;quot;&lt;/span&gt; &amp;amp; Corba.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;The_Cbsg.&lt;span style="color: #202020;"&gt;createSentence&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
	 CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSGBalancer&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Release&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Balancer, The_Cbsg&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;loop&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Balanced_Client;&lt;/pre&gt;

&lt;p&gt;The most difficult part is the last one... But, it's not that diffcult.&lt;br /&gt;
You just have to remember that :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Our sequence was declared inside the top-level part of the IDL&lt;/li&gt;
&lt;li&gt;Our sequence contains &lt;em&gt;forward&lt;/em&gt; objects instead of reference directly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, for the first point, all methods declared for sequences&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#pnote-635-3" id="rev-pnote-635-3"&gt;3&lt;/a&gt;]&lt;/sup&gt; are available in our top-level package.&lt;br /&gt;
For the second point, we will have to convert our &lt;em&gt;forward&lt;/em&gt; objects to the ones we really want. This will be done with &lt;em&gt;From_Forward&lt;/em&gt; function in the &lt;em&gt;Convert_Forward&lt;/em&gt; package. As this conversion package deals with objects, it is declared in the object package and not at the top-level.&lt;br /&gt;
&lt;br /&gt;
We now have a &lt;em&gt;balancer&lt;/em&gt;, a &lt;em&gt;CBSG&lt;/em&gt; able to register itself to the &lt;em&gt;balancer&lt;/em&gt; and two clients.&lt;br /&gt;
It should work &lt;em&gt;out-of-the-box&lt;/em&gt; if you run the programs on the same machine but if you want to run it across several machines&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#pnote-635-4" id="rev-pnote-635-4"&gt;4&lt;/a&gt;]&lt;/sup&gt;, you will have to use &lt;em&gt;InitialRef&lt;/em&gt; or equivalent parameters.&lt;br /&gt;
I can't be more precise as, even if I tested it, I've lost the configuration I used :D&lt;br /&gt;
Maybe, I'll update this post to provide you the correct parameters. Stay tuned ;)&lt;br /&gt;&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#rev-pnote-635-1" id="pnote-635-1"&gt;1&lt;/a&gt;] Something I just forgot few minutes ago :D&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#rev-pnote-635-2" id="pnote-635-2"&gt;2&lt;/a&gt;] Using ValueType would be a different thing but it is not currently implemented in &lt;em&gt;PolyORB&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#rev-pnote-635-3" id="pnote-635-3"&gt;3&lt;/a&gt;] in &lt;em&gt;PolyORB.Sequences.Unbounded&lt;/em&gt; through &lt;em&gt;Corba.Sequences.Unbounded&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#rev-pnote-635-4" id="pnote-635-4"&gt;4&lt;/a&gt;] Which must be the goal of such architecture :)&lt;/p&gt;&lt;/div&gt;
</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2013/04/19/Balancing-bullshits#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/635</wfw:commentRss>
      </entry>
    
  <entry>
    <title>I've got the power (english version)</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2013/04/02/I-ve-got-the-power-%28english-version%29" rel="alternate" type="text/html" title="I've got the power (english version)" />
    <id>urn:md5:d98ef59c72786cea72a7f8d473dd106c</id>
    <published>2013-04-02T10:47:00+02:00</published>
    <updated>2013-04-02T10:50:49+02:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Système et réseau</dc:subject>
        <dc:subject>FreeBSD</dc:subject>    
    <content type="html">&lt;p&gt;This is a translation of an old post in french, see the original &lt;a href="http://frederic.praca.free.fr/index.php?post/2011/03/28/I-ve-got-the-power-%21%21"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
No, I've not become &lt;em&gt;Fred Almighty&lt;/em&gt; and that's happy, it would be a mess :D
&lt;br /&gt;
In the scope of non-profit activities, I received a wonderful UPS that I had to configure for FreeBSD.&lt;br /&gt;&lt;/p&gt;    &lt;p&gt;At the beginnning, to be honest, I was not really motivated to configure this beast for the Wonderful OS especially after seeing that all different tools where in Java&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/02/I-ve-got-the-power-%28english-version%29#pnote-634-1" id="rev-pnote-634-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
After having my server configured to access it from home&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/02/I-ve-got-the-power-%28english-version%29#pnote-634-2" id="rev-pnote-634-2"&gt;2&lt;/a&gt;]&lt;/sup&gt; and plugged to the UPS through the USB cable, I've been looking for a way to make it work.&lt;br /&gt;
A small query on Internet and I have found a small load monitor running of FreeBSD named &lt;a href="http://www.networkupstools.org/index.html" hreflang="en"&gt;Nut&lt;/a&gt; which is hosted by &lt;a href="http://powerquality.eaton.com/USA/Default.asp?CX=3" hreflang="en"&gt;Eaton&lt;/a&gt;... This seems to be good while your UPS is a &lt;em&gt;Eaton Ellipse ASR750&lt;/em&gt; ;-)
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;A quick tour of supported hardware is a piece of cake and confirms that everything will be alright.&lt;br /&gt;
So, I install &lt;em&gt;Nut&lt;/em&gt; through the classical way :&lt;/p&gt;
&lt;pre&gt;
root@rcjserveur : ~&amp;gt; cd /usr/ports/sysutils/nut/ &amp;amp;&amp;amp; make install clean
&lt;/pre&gt;

&lt;p&gt;Configuration is not so hard even if I have to change few points like compared to &lt;a href="http://people.freebsd.org/~thierry/nut_FreeBSD_HowTo.txt" hreflang="en"&gt;this&lt;/a&gt; :&lt;br /&gt;
For &lt;em&gt;ups.conf&lt;/em&gt;, keep it simple :&lt;/p&gt;
&lt;pre&gt;
[eaton]
        driver = usbhid-ups
        port = auto
        desc = &amp;quot;EATON UPS&amp;quot;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;em&gt;hosts.conf&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;
#
MONITOR eaton@localhost &amp;quot;UPS Eaton Ellipse&amp;quot;
# MONITOR su2200@10.64.1.1 &amp;quot;Finance department&amp;quot;
# MONITOR matrix@shs-server.example.edu &amp;quot;Sierra High School data room #1&amp;quot;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
For &lt;em&gt;upsd.users&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;
Sorry, I won't give you this one, there are some credentials in it !!!
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
In &lt;em&gt;upsmon.conf&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;
...
MONITOR eaton@localhost 1 my_user my_password master
...
SHUTDOWNCMD &amp;quot;/sbin/shutdown -p +0&amp;quot;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Everything seemed to be ok but...&lt;br /&gt;
The main problem came from the rights on the USB as usual. In fact, at login time or at startup, rights are really &lt;q&gt;generics&lt;/q&gt;.&lt;br /&gt;
Happily, FreeBSD is here to help you and give you the answer tanks to &lt;a href="http://www.freebsd.org/cgi/man.cgi?query=devd&amp;amp;sektion=8&amp;amp;apropos=0&amp;amp;manpath=FreeBSD+8.2-RELEASE" hreflang="en"&gt;''devd''&lt;/a&gt; and to its configuration curiously named &lt;a href="http://www.freebsd.org/cgi/man.cgi?query=devd.conf&amp;amp;sektion=5&amp;amp;apropos=0&amp;amp;manpath=FreeBSD+8.2-RELEASE" hreflang="en"&gt;''devd.conf''&lt;/a&gt;.
For your information, I found this solution more elegant and more generic than using &lt;em&gt;devfs&lt;/em&gt;.&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;
attach 100 {
        match &amp;quot;vendor&amp;quot; &amp;quot;0x0463&amp;quot;;
        match &amp;quot;product&amp;quot; &amp;quot;0xffff&amp;quot;;
        action &amp;quot;/usr/sbin/chown -R -L uucp:uucp /dev/$device-name&amp;quot;;
};
&lt;/pre&gt;


&lt;p&gt;Off course, these values are not randomly chosen, a quick use of &lt;a href="http://www.freebsd.org/cgi/man.cgi?query=usbconfig&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+8.2-RELEASE&amp;amp;format=html" hreflang="en"&gt;''usbconfig''&lt;/a&gt; gives you the hints&lt;/p&gt;
&lt;pre&gt;
root@rcjserveur : ~&amp;gt; usbconfig -u 4 -a 2 dump_device_desc
ugen4.2: &amp;lt;ELLIPSE EATON&amp;gt; at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0110 
  bDeviceClass = 0x0000 
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0008 
  idVendor = 0x0463 
  idProduct = 0xffff 
  bcdDevice = 0x0001 
  iManufacturer = 0x0001  &amp;lt;EATON&amp;gt;
  iProduct = 0x0002  &amp;lt;ELLIPSE&amp;gt;
  iSerialNumber = 0x0004  &amp;lt;BDCK520CF&amp;gt;
  bNumConfigurations = 0x0001 
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
Tests were simple too. I just checked that I could see the charge of the machine while telling myself that for a shutdown script, I'll look at it later.&lt;br /&gt;
Well, as Murphy's law tells, it was checked by itself as there was a power outage on friday evening until monday morning. Seeking in the logs, I found the Holy Graal :&lt;/p&gt;
&lt;pre&gt;
Mar 11 17:28:35 RCJServeur upsmon[32074]: UPS eaton@localhost on battery
...
Mar 11 17:42:16 RCJServeur upsmon[32074]: UPS eaton@localhost battery is low
Mar 11 17:42:16 RCJServeur upsmon[32074]: Executing automatic power-fail shutdown
Mar 11 17:42:16 RCJServeur upsmon[32074]: Auto logout and shutdown proceeding
Mar 11 17:42:21 RCJServeur shutdown: power-down by fred: 
Mar 11 17:42:23 RCJServeur upsd[32047]: mainloop: Interrupted system call
&lt;/pre&gt;

&lt;p&gt;Great, the server shut down correctly when the UPS was out of power. Well done Fred, you've got the power !!!&lt;br /&gt;
What surprised me is that the server started up by itself when power came back and despite the fact that I did'nt configure anything for that :)&lt;br /&gt;
Well, this is not really a problem so I can sleep well :D&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/02/I-ve-got-the-power-%28english-version%29#rev-pnote-634-1" id="pnote-634-1"&gt;1&lt;/a&gt;] I work with it all the  day, so I won't play with it on my spare time also ;-)&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/04/02/I-ve-got-the-power-%28english-version%29#rev-pnote-634-2" id="pnote-634-2"&gt;2&lt;/a&gt;] Won't tell you how, it would be too risky, bitthirsty hackers !!&lt;/p&gt;&lt;/div&gt;
</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2013/04/02/I-ve-got-the-power-%28english-version%29#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/634</wfw:commentRss>
      </entry>
    
  <entry>
    <title>Spreading bullshits</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits" rel="alternate" type="text/html" title="Spreading bullshits" />
    <id>urn:md5:39ed85e55315b72939f0efbcbc575177</id>
    <published>2013-03-24T22:32:00+01:00</published>
    <updated>2013-03-26T18:56:43+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
        <dc:subject>Ada</dc:subject><dc:subject>C</dc:subject><dc:subject>CORBA</dc:subject>    
    <content type="html">&lt;p&gt;I decided today to write a small cute tutorial to create the best of the best for &lt;q&gt;scalability&lt;/q&gt;, for &lt;q&gt;highly distributed&lt;/q&gt; and &lt;q&gt;high reliability&lt;/q&gt; while being multi-platform, multi-language and potentially multi-paradigm... Well, the two first ones, ok but for the last, I don't really know and finally, I don't give a damn :D&lt;br /&gt;
At this point, with the number of &lt;em&gt;buzzwords&lt;/em&gt; I used, tour tollmeter should explode !! :D&lt;br /&gt;
But, from now, I won't tell you anything else, you'll have to read what follows !!&lt;/p&gt;    &lt;p&gt;What would be better to do the whole thing than &lt;em&gt;web services&lt;/em&gt; ?&lt;br /&gt;
Well, it's simple, something else than &lt;em&gt;web service&lt;/em&gt; :)&lt;br /&gt;
This other thing is an old stuff nobody wants to use anymore because it's too complicated, too heavy to set up and to code, here is &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Common_Object_Request_Broker_Architecture" hreflang="en" title="CORBA"&gt;CORBA&lt;/a&gt;&lt;/em&gt; !!&lt;br /&gt;
&lt;br /&gt;
Well, after thinking about it, it's not a real &lt;em&gt;CORBA&lt;/em&gt; tutorial because there are a lot on Internet but it's more a documented example for a small app done with v&lt;em&gt;&lt;a href="http://libre.adacore.com/tools/polyorb" hreflang="en" title="PolyORB"&gt;PolyORB&lt;/a&gt;&lt;/em&gt; for server-side and &lt;em&gt;&lt;a href="http://omniorb.sourceforge.net/" hreflang="en" title="OmniORB"&gt;OmniORB&lt;/a&gt;&lt;/em&gt; for the C++ client-side.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h4&gt;The dispenser&lt;/h4&gt;

&lt;p&gt;It's as good as a movie title but what are we distributing ?&lt;br /&gt;
As I didn't want to build a whole app to distribute, I decided to use an existing application helping everyone on an almost daily basis. Here is the &lt;em&gt;&lt;a href="http://cbsg.sourceforge.net/cgi-bin/live" hreflang="en" title="CBSG"&gt;Corporate Bullshit Generator&lt;/a&gt;&lt;/em&gt; from my Ada friend Gautier.&lt;br /&gt;
For those who don't know already, this application provides excellent sentences to use in every good meeting with commercials, strategy managers and so on.&lt;br /&gt;
Let's go on &lt;a href="http://sourceforge.net/projects/cbsg/" hreflang="en" title="CBSG"&gt;the project page&lt;/a&gt; in order to download the source code&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits#pnote-633-1" id="rev-pnote-633-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h3&gt;Small analysis of &lt;q&gt;bullshits&lt;/q&gt;&lt;/h3&gt;

&lt;p&gt;To do some &lt;em&gt;CORBA&lt;/em&gt;, we have to know what to distribute. The central package in &lt;em&gt;CSBG&lt;/em&gt; is &lt;em&gt;Corporate_Bullshit&lt;/em&gt;. It's a generic package to define the end of line characters and the sentence to use to simulate a dialog&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits#pnote-633-2" id="rev-pnote-633-2"&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
So, what do we see ?&lt;br /&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Sentence &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Workshop &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Short_Workshop &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Financial_Report &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;&lt;/pre&gt;

&lt;p&gt;Four functions allowing to create a string containing the set of &lt;q&gt;bullshits&lt;/q&gt;. Let's be crazy, we will provide an interface for all of them.&lt;br /&gt;
In &lt;em&gt;CORBA&lt;/em&gt;, it's quite simple, we will get the following &lt;em&gt;&lt;a href="http://www.omg.org/gettingstarted/omg_idl.htm" hreflang="en" title="IDL"&gt;IDL&lt;/a&gt;&lt;/em&gt; file :&lt;/p&gt;
&lt;pre class="cpp cpp" style="font-family:inherit"&gt;module CorbaCBSG &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
  interface CBSG&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
    string createSentence&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    string createWorkshop&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    string createShortWorkshop&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    string createFinancialReport&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
  &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Here, I preferred to use writing conventions in use for C++, Java and others rather than the ones used in Ada in order not to scare the coder that would prefer to write the client with one of these languages ;)&lt;br /&gt;
Well, finally, it's piece of cake ! :D&lt;br /&gt;
&lt;br /&gt;
But this is only a first example...&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h3&gt;Generation&lt;/h3&gt;

&lt;p&gt;Let's go the generation and implementation for server-side part.&lt;br /&gt;
For this reason, I recommand to create a directory &lt;em&gt;corba&lt;/em&gt; containing a directory &lt;em&gt;idl&lt;/em&gt; and directories &lt;em&gt;Ada' and &lt;/em&gt;C++&lt;em&gt;. The whole thing should be placed inside a directory &lt;/em&gt;csbg&lt;em&gt;. The file &lt;/em&gt;csbg.idl&lt;em&gt; defined will fit inside the &lt;/em&gt;idl'' directory.&lt;br /&gt;
Let's make serious things :&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ iac -i ../idl/cbsg.idl
&lt;/pre&gt;

&lt;p&gt;Eleven files are created. Only &lt;em&gt;corbacbsg-cbsg-impl.ads&lt;/em&gt; and &lt;em&gt;corbacbsg-cbsg-impl.adb&lt;/em&gt; will be interesting, the others are only &lt;em&gt;CORBA&lt;/em&gt; plumbing. One important point though, the &lt;em&gt;i&lt;/em&gt; option will overwrite your implementation if it exists already and also the spec if it contains specific fields.&lt;br /&gt;
In the spec file (&lt;em&gt;ads&lt;/em&gt; file), there's nothing to change. In fact, our &lt;em&gt;CORBA&lt;/em&gt; object doesn't hold a specific state as the &lt;em&gt;CBSG&lt;/em&gt; does.&lt;br /&gt;
But, it's interesting to read this file as the reader will notice that generated methods does not use the standard &lt;em&gt;String&lt;/em&gt; type we can find in &lt;em&gt;Ada&lt;/em&gt; but a &lt;em&gt;CORBA&lt;/em&gt; specific type. Our &lt;em&gt;CORBA&lt;/em&gt; object will do the translation.&lt;br /&gt;
As you're really smart, I'll only give the implementation for &lt;em&gt;createSentence&lt;/em&gt; function and how to declare the generic package &lt;em&gt;Corporate_Bullshit&lt;/em&gt;, you'll manage to generalize on your own :&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;package&lt;/span&gt; Simple_Generator &lt;span style="color: #00007f;"&gt;is&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt;  Corporate_Bullshit&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Paragraph =&amp;gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;,
						       Dialog_Mark =&amp;gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;--------------------&lt;/span&gt;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- createSentence --&lt;/span&gt;
   &lt;span style="color: #adadad; font-style: italic;"&gt;--------------------&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; createSentence
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
     &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;String&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
      Generated_Sentence : String := Simple_Generator.&lt;span style="color: #202020;"&gt;Sentence&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Generated_Sentence&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; createSentence;&lt;/pre&gt;

&lt;p&gt;Now that we've defined the behaviour of our object, it's time to statup the &lt;em&gt;CORBA&lt;/em&gt; bus and expose an instance of our brand new class.&lt;br /&gt;
For now, we won't use one of the most used &lt;em&gt;CORBA&lt;/em&gt; service, the &lt;em&gt;Name Service&lt;/em&gt;. Our server will only expose an &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Interoperable_Object_Reference" hreflang="en" title="IOR"&gt;IOR&lt;/a&gt;&lt;/em&gt;, reference to our object.&lt;br /&gt;
For this server, the &lt;em&gt;echo&lt;/em&gt; example provided with &lt;em&gt;PolyORB&lt;/em&gt; will be enough :&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #adadad; font-style: italic;"&gt;-- Allow to specify to PolyORB how to behave from a tasking point of view&lt;/span&gt;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Server &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- Allows to get the paramters such as those defined in the CORBA standard like InitialRef&lt;/span&gt;
      Argv : CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Arg_List&lt;/span&gt; := CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Command_Line_Arguments&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- Initiliaze our bus under the name ORB&lt;/span&gt;
      CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Init&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Argv&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- The PortableObjectAdapter is where we register our objects&lt;/span&gt;
         Root_POA : PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Local_Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- We declare a reference for our object&lt;/span&gt;
         Ref : CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- And its implementation&lt;/span&gt;
         Obj : &lt;span style="color: #46aa03; font-weight:bold;"&gt;constant&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_Ptr&lt;/span&gt; := &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;-- We get the Root POA&lt;/span&gt;
         Root_POA := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_Local_Ref&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Resolve_Initial_References&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;RootPOA&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- We start it up&lt;/span&gt;
         PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Activate&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Get_The_POAManager&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- We create a reference in order to expose it&lt;/span&gt;
         Ref := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Servant_To_Reference&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA, PortableServer.&lt;span style="color: #202020;"&gt;Servant&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Obj&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- We display the IOR&lt;/span&gt;
         Put_Line
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         New_Line;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  and a corbaloc&lt;/span&gt;
         Put_Line
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  Launch the server. CORBA.ORB.Run is supposed to never return,&lt;/span&gt;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  print a message if it does.&lt;/span&gt;
&amp;nbsp;
         CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Run&lt;/span&gt;;
&amp;nbsp;
         Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB main loop terminated!&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; E : &lt;span style="color: #46aa03; font-weight:bold;"&gt;others&lt;/span&gt; =&amp;gt;
      Put_Line
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;CBSG server raised &amp;quot;&lt;/span&gt; &amp;amp; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Exception_Information&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;E&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Server;&lt;/pre&gt;

&lt;p&gt;Even if this code seems complex, it's always the same each time we will expose an object in the bus.&lt;br /&gt;
We just have to compile :&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ mkdir obj
fred@coruscant :~/cbsg/corba/Ada $ gnatmake server.adb -D obj -aI../.. `polyorb-config`
&lt;/pre&gt;

&lt;p&gt;If everything went well, we just have to start the server&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ ./server
'IOR:010000001700000049444c3a436f726261434253472f434253473a312e30000002000000000000005c000000010102000a0000003132372e302e302e3100f1761b0000002f30303030303030313154643637306239663031326565316538300001000000010000001c0000000100000001000100000000000001010002000000010101000201010003004f503c000000010100000c0000003139322e3136382e332e32007a3300001b0000002f30303030303030313154643637306239663031326565316538300000000000'

'corbaloc:iiop:1.2@127.0.0.1:30449//000000011Td670b9f012ee1e80'
&lt;/pre&gt;

&lt;p&gt;if you want the server to listen on another address than 127.0.0.1, we just have to put it in &lt;em&gt;polyorb.conf&lt;/em&gt;  which must be at the place from which you run the server.&lt;br /&gt;&lt;/p&gt;


&lt;h3&gt;Waiter, please&lt;/h3&gt;

&lt;p&gt;Now that our server is wainting for a client, let's code it. First, a small simple &lt;em&gt;Ada&lt;/em&gt; client as everything is reay for it. Once again, the &lt;em&gt;echo&lt;/em&gt; example will be enough to create our client&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Client&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Client&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Client &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;type&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;String&lt;/span&gt;;
&amp;nbsp;
   Rcvd_Bullshits : CORBA.&lt;span style="color: #202020;"&gt;String&lt;/span&gt;;
   Bullshit_Generator : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
   CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Initialize&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; Argument_Count &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt; .. &lt;span style="color: #ff0000;"&gt;2&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
      Put_Line
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;usage: client &amp;lt;IOR_string_from_server&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;--  Get a reference on the distributed object through its IOR or corbaloc&lt;/span&gt;
   CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;String_To_Object&lt;/span&gt;
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Argument&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Bullshit_Generator&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- check that the reference is correct&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Is_Nil&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Bullshit_Generator&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
      Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;main : cannot invoke on a nil reference&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
&amp;nbsp;
   Rcvd_Bullshits := CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;createSentence&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Bullshit_Generator&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;The generator said : &amp;quot;&lt;/span&gt; &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Rcvd_Bullshits&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; E : CORBA.&lt;span style="color: #202020;"&gt;Transient&lt;/span&gt; =&amp;gt;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
         Memb : CORBA.&lt;span style="color: #202020;"&gt;System_Exception_Members&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
         CORBA.&lt;span style="color: #202020;"&gt;Get_Members&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;E, Memb&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;received exception transient, minor&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Unsigned_Long&lt;/span&gt;'Image &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Memb.&lt;span style="color: #202020;"&gt;Minor&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;, completion status: &amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Completion_Status&lt;/span&gt;'Image &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Memb.&lt;span style="color: #202020;"&gt;Completed&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Client;&lt;/pre&gt;

&lt;p&gt;As usual, compilation :&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ gnatmake client -D obj -aI../.. `polyorb-config `
fred@coruscant :~/cbsg/corba/Ada $ ./client 'corbaloc:iiop:1.2@127.0.0.1:30449//000000011Td670b9f012ee1e80'
The generator said : The business leaders embrace a growing execution by thinking outside of the box, whereas the steering committee delivers a top-down interoperability. 
&lt;/pre&gt;

&lt;p&gt;What to say other than &lt;strong&gt;superb&lt;/strong&gt; !!&lt;br /&gt;
&lt;br /&gt;
Ok, I promised a C++ client with &lt;em&gt;OmniORB&lt;/em&gt;. As I always deliver the goods, here it is...&lt;br /&gt;
In the C++ directory, we begin by generating the needed files with the &lt;em&gt;OmniORB&lt;/em&gt; IDL compiler.&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/C++ $ omniidl -bcxx ../idl/cbsg.idl
&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;csbg.hh&lt;/em&gt; and &lt;em&gt;csbg.cc&lt;/em&gt; get created. They contain at the same time &lt;em&gt;stubs&lt;/em&gt; and &lt;em&gt;skeletons&lt;/em&gt;. For the client-side, we will only use the &lt;em&gt;stub&lt;/em&gt; part.&lt;br /&gt;
We create the client by taking ideas from the provided examples with &lt;em&gt;OmniORB&lt;/em&gt; :&lt;br /&gt;&lt;/p&gt;
&lt;pre class="cpp cpp" style="font-family:inherit"&gt;&lt;span style="color: #339900;"&gt;#include &amp;lt;cbsg.hh&amp;gt;&lt;/span&gt;
&lt;span style="color: #339900;"&gt;#ifdef HAVE_STD &lt;/span&gt;
&lt;span style="color: #339900;"&gt;#include &amp;lt;iostream&amp;gt; &lt;/span&gt;
&lt;span style="color: #339900;"&gt;#include &amp;lt;fstream&amp;gt; &lt;/span&gt;
&lt;span style="color: #0000ff;"&gt;using&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;namespace&lt;/span&gt; std&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
&lt;span style="color: #339900;"&gt;#else &lt;/span&gt;
&lt;span style="color: #339900;"&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;
&lt;span style="color: #339900;"&gt;#endif &lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #666666;"&gt;////////////////////////////////////////////////////////////////////// &lt;/span&gt;
&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; main&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; argc, &lt;span style="color: #0000ff;"&gt;char&lt;/span&gt;&lt;span style="color: #000040;"&gt;**&lt;/span&gt; argv&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;try&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
      &lt;span style="color: #666666;"&gt;//ORB Initialisation&lt;/span&gt;
      CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;ORB_var&lt;/span&gt; orb &lt;span style="color: #000080;"&gt;=&lt;/span&gt; CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;ORB_init&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;argc, argv&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt; argc &lt;span style="color: #000040;"&gt;!&lt;/span&gt;&lt;span style="color: #000080;"&gt;=&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;2&lt;/span&gt; &lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
	  &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;usage: client &amp;lt;object reference&amp;gt;&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	  &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//We create the CORBA object from the provided string&lt;/span&gt;
      CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;Object_var&lt;/span&gt; obj &lt;span style="color: #000080;"&gt;=&lt;/span&gt; orb&lt;span style="color: #000040;"&gt;-&lt;/span&gt;&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt;string_to_object&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;argv&lt;span style="color: #008000;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//We cast it to CBSG&lt;/span&gt;
      CorbaCBSG&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;CBSG_var&lt;/span&gt; cbsgRef &lt;span style="color: #000080;"&gt;=&lt;/span&gt; CorbaCBSG&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;CBSG&lt;/span&gt;&lt;span style="color: #008080;"&gt;::&lt;/span&gt;_narrow&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;obj&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//We check that the object exists&lt;/span&gt;
      &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt; CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;is_nil&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;cbsgRef&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
	  &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Can't narrow reference to type CBSG (or it was nil).&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	  &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//And go, we call it&lt;/span&gt;
      CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;String_var&lt;/span&gt; bullshit &lt;span style="color: #000080;"&gt;=&lt;/span&gt; cbsgRef&lt;span style="color: #000040;"&gt;-&lt;/span&gt;&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt;createSentence&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
      &lt;span style="color: #0000dd;"&gt;cout&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;The generator said : &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; bullshit &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//We stop the ORB&lt;/span&gt;
      orb&lt;span style="color: #000040;"&gt;-&lt;/span&gt;&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt;destroy&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;TRANSIENT&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught system exception TRANSIENT -- unable to contact the &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;server.&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;SystemException&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt; ex&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught a CORBA::&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; ex._name&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;Exception&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt; ex&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught CORBA::Exception: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; ex._name&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;omniORB&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;fatalException&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt; fe&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught omniORB::fatalException:&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot; file: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; fe.&lt;span style="color: #007788;"&gt;file&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot; line: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; fe.&lt;span style="color: #007788;"&gt;line&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot; mesg: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; fe.&lt;span style="color: #007788;"&gt;errmsg&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;0&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;We compile and test :&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/C++ $ g++ -o client client.cpp cbsgSK.cc -I. -lomniORB4
fred@coruscant :~/cbsg/corba/C++ $ ./client 'corbaloc:iiop:1.2@127.0.0.1:30449//000000011Td670b9f012ee1e80'
The generator said : The granular low hanging fruit incentivises the steering committee.
&lt;/pre&gt;

&lt;p&gt;Depending on the version of &lt;em&gt;OmniORB&lt;/em&gt;, it could be necessary to include &lt;q&gt;-lomnithread&lt;/q&gt; on the compilation command line.&lt;br /&gt;
And that's it !&lt;br /&gt;
Well, I promised high availability and &lt;em&gt;tutti quanti&lt;/em&gt; but finally, I will keep it for the next time :)&lt;br /&gt;
Hope it pleased you.&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits#rev-pnote-633-1" id="pnote-633-1"&gt;1&lt;/a&gt;] But just read interfaces, you would get a &lt;q&gt;bullshit&lt;/q&gt; overdose&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits#rev-pnote-633-2" id="pnote-633-2"&gt;2&lt;/a&gt;] This second parameter quite obscur is not used by Gautier, so caution :D&lt;/p&gt;&lt;/div&gt;
</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2013/03/24/Spreading-bullshits#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/633</wfw:commentRss>
      </entry>
    
  <entry>
    <title>Distribution de conneries</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries" rel="alternate" type="text/html" title="Distribution de conneries" />
    <id>urn:md5:7fca88b3bb2430353a9bc718b17f0a13</id>
    <published>2013-03-22T16:31:00+01:00</published>
    <updated>2013-03-26T18:54:59+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
        <dc:subject>Ada</dc:subject><dc:subject>C</dc:subject><dc:subject>CORBA</dc:subject>    
    <content type="html">&lt;p&gt;J'ai décidé aujourd'hui de faire un petit tuto sympa pour réaliser le top du top en matière de &lt;q&gt;scalabilité&lt;/q&gt;&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#pnote-632-1" id="rev-pnote-632-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;, de haute distribution ainsi que haute &lt;q&gt;reliabilité&lt;/q&gt;&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#pnote-632-2" id="rev-pnote-632-2"&gt;2&lt;/a&gt;]&lt;/sup&gt; tout en restant multi-plateforme, multi-langage et potentiellement multi-paradigme... Enfin, les deux premiers, c'est sûr, le troisième, j'en sais rien et je m'en tape :D&lt;br /&gt;
Normalement, là, avec le nombre de &lt;em&gt;buzzwords&lt;/em&gt; utilisés, vous devriez déjà avoir le trollomètre au taquet !! :D&lt;br /&gt;
Mais je ne vous en dirai pas plus, il faut aller voir, LA SUITE !!!&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#rev-pnote-632-1" id="pnote-632-1"&gt;1&lt;/a&gt;] J'adore cet anglicisme tellement il est foireux&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#rev-pnote-632-2" id="pnote-632-2"&gt;2&lt;/a&gt;] Bien aussi, celui-là&lt;/p&gt;&lt;/div&gt;
    &lt;p&gt;Quoi de mieux pour réaliser tout ça que les &lt;em&gt;web services&lt;/em&gt; ?&lt;br /&gt;
Et bien, c'est simple, autre chose que des &lt;em&gt;web services&lt;/em&gt; !! :)&lt;br /&gt;
Cette autre chose est un vieux truc que plus personne ne veut utiliser car trop compliqué, trop lourd à mettre en place et à coder, j'ai nommé &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Common_Object_Request_Broker_Architecture" hreflang="en" title="CORBA"&gt;CORBA&lt;/a&gt;&lt;/em&gt;&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#pnote-632-1" id="rev-pnote-632-1"&gt;1&lt;/a&gt;]&lt;/sup&gt; !!&lt;br /&gt;
&lt;br /&gt;
Bon, après réflexion, ce ne sera pas un vrai tutoriel &lt;em&gt;CORBA&lt;/em&gt;, car il y en a déjà sur Internet, mais plutôt un exemple documenté d'une petite application faite avec &lt;em&gt;&lt;a href="http://libre.adacore.com/tools/polyorb" hreflang="en" title="PolyORB"&gt;PolyORB&lt;/a&gt;&lt;/em&gt; pour ce qui est du serveur et &lt;em&gt; &lt;a href="http://omniorb.sourceforge.net/" hreflang="en" title="OmniORB"&gt;OmniORB&lt;/a&gt;&lt;/em&gt; pour la partie C++ cliente.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h4&gt;Le distributeur&lt;/h4&gt;

&lt;p&gt;C'est beau comme un titre de films mais que distribuons-nous ?&lt;br /&gt;
N'ayant pas envie de recoder toute une application pour la distribuer, j'ai décidé de repartir d'une application existante et rendant régulièrement service. J'ai nommé le &lt;em&gt;&lt;a href="http://cbsg.sourceforge.net/cgi-bin/live" hreflang="en" title="CBSG"&gt;Corporate Bullshit Generator&lt;/a&gt;&lt;/em&gt; de mon ami adaïste Gautier.&lt;br /&gt;
Pour ceux qui ne connaîtraient pas encore, cette application fournit d'excellentes phrases à placer dans toute bonne réunion se déroulant en présence de commerciaux, grands statéguères etc.&lt;br /&gt;
Rendez-vous donc sur &lt;a href="http://sourceforge.net/projects/cbsg/" hreflang="en" title="CBSG"&gt;la page du projet&lt;/a&gt; afin de télécharger le code source&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#pnote-632-2" id="rev-pnote-632-2"&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h3&gt;Petite analyse des &lt;q&gt;bullshits&lt;/q&gt;&lt;/h3&gt;

&lt;p&gt;Pour faire du &lt;em&gt;CORBA&lt;/em&gt;, il faut d'abord savoir ce que l'on va distribuer. Le paquetage central du &lt;em&gt;CSBG&lt;/em&gt; est le &lt;em&gt;Corporate_Bullshit&lt;/em&gt;. Il s'agit d'un paquetage générique dont le but est de définir les caractères de saut de lignes ainsi que la phrase à utiliser pour simuler un dialogue&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#pnote-632-3" id="rev-pnote-632-3"&gt;3&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
Quoi qu'on voit ?&lt;br /&gt;&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Sentence &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Workshop &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Short_Workshop &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; Financial_Report &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; String;&lt;/pre&gt;


&lt;p&gt;Quatre fonctions permettant de créer une chaîne de caractères contenant l'ensemble des &lt;q&gt;bullshits&lt;/q&gt;. Soyons fous, nous fournirons donc une interface vers les quatre.&lt;br /&gt;
En &lt;em&gt;CORBA&lt;/em&gt;, c'est assez simple, cela donnera un fichier &lt;em&gt;&lt;a href="http://www.eecg.toronto.edu/~jacobsen/courses/mw/IDL.htm" hreflang="fr" title="IDL"&gt;IDL&lt;/a&gt;&lt;/em&gt; comme montrer ci-dessous&amp;nbsp;:&lt;/p&gt;
&lt;pre class="cpp cpp" style="font-family:inherit"&gt;module CorbaCBSG &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
  interface CBSG&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
    string createSentence&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    string createWorkshop&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    string createShortWorkshop&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    string createFinancialReport&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
  &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Ici, j'ai préféré respecter les conventions d'écriture en vigueur en C++, Java et consorts en lieu et place de celles d'Ada pour ne pas effrayer le programmeur qui voudrait écrire un client dans ces langages ;)&lt;br /&gt;
Au final, c'est bête comme chou&amp;nbsp;! :D&lt;br /&gt;
&lt;br /&gt;
Mais ce n'est qu'un premier exemple...&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h3&gt;Génération&lt;/h3&gt;

&lt;p&gt;Passons maintenant à la génération et à l'implémentation de la partie serveur.&lt;br /&gt;
Pour cela, je conseille la création d'un répertoire &lt;em&gt;corba&lt;/em&gt; contenant un répertoire &lt;em&gt;idl&lt;/em&gt; ainsi que des répertoires &lt;em&gt;Ada&lt;/em&gt; et &lt;em&gt;C++&lt;/em&gt;, le tout dans le répertoire du &lt;em&gt;cbsg&lt;/em&gt;. Le fichier &lt;em&gt;cbsg.idl&lt;/em&gt; définit au-dessus trouvera aisément sa place dans le répertoire &lt;em&gt;idl&lt;/em&gt;.&lt;br /&gt;
Passons aux choses sérieuses&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ iac -i ../idl/cbsg.idl
&lt;/pre&gt;

&lt;p&gt;Onze fichiers sont normalement créés. Seul les fichiers &lt;em&gt;corbacbsg-cbsg-impl.ads&lt;/em&gt; et &lt;em&gt;corbacbsg-cbsg-impl.adb&lt;/em&gt; vont nous intéresser, le reste étant de la tuyauterie &lt;em&gt;CORBA&lt;/em&gt;. Un point toutefois important, l'option &lt;em&gt;i&lt;/em&gt; écrasera votre implémentation si celle-ci existe déjà ainsi que sa spécification si elle contient des champs spécifiques.&lt;br /&gt;
Dans la spécification (fichier &lt;em&gt;ads&lt;/em&gt;), il n'y a rien à changer. En effet, notre objet &lt;em&gt;CORBA&lt;/em&gt; n'a pas d'état en soi tout comme le &lt;em&gt;CBSG&lt;/em&gt;.&lt;br /&gt;
Par contre, il est intéressant de lire ce fichier car le lecteur attentif aura remarqué que les méthodes générées n'utilisent pas le type &lt;em&gt;String&lt;/em&gt; standard d&lt;em&gt;'Ada&lt;/em&gt; mais un type propre à &lt;em&gt;CORBA&lt;/em&gt;. Notre objet &lt;em&gt;CORBA&lt;/em&gt; fera donc la translation.&lt;br /&gt;
Comme vous êtes très forts, je ne donnerai que l'implémentation de la fonction &lt;em&gt;createSentence&lt;/em&gt; ainsi que la déclaration du paquetage générique &lt;em&gt;Corporate_Bullshit&lt;/em&gt; , vous généraliserez par vous-mêmes&amp;nbsp;:&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;package&lt;/span&gt; Simple_Generator &lt;span style="color: #00007f;"&gt;is&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt;  Corporate_Bullshit&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Paragraph =&amp;gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;,
						       Dialog_Mark =&amp;gt; &lt;span style="color: #7f007f;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;--------------------&lt;/span&gt;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- createSentence --&lt;/span&gt;
   &lt;span style="color: #adadad; font-style: italic;"&gt;--------------------&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;function&lt;/span&gt; createSentence
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Self : &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;access&lt;/span&gt; Object&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
     &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;String&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
      Generated_Sentence : String := Simple_Generator.&lt;span style="color: #202020;"&gt;Sentence&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Generated_Sentence&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; createSentence;&lt;/pre&gt;

&lt;p&gt;Maintenant que nous avons défini le comportement de notre objet, il nous faut démarrer le bus &lt;em&gt;CORBA&lt;/em&gt; et exposer une instance de notre toute nouvelle classe.&lt;br /&gt;
Pour le moment, nous n'utiliserons pas l'un des services primordiaux de &lt;em&gt;CORBA&lt;/em&gt;, à savoir le &lt;em&gt;Name Service&lt;/em&gt;. Notre serveur exposera donc seulement une &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Interoperable_Object_Reference" hreflang="en" title="IOR"&gt;IOR&lt;/a&gt;&lt;/em&gt;, référence vers notre objet.&lt;br /&gt;
Pour ce serveur, l'exemple &lt;em&gt;echo&lt;/em&gt; fournit avec &lt;em&gt;PolyORB&lt;/em&gt; suffit amplement&amp;nbsp;:&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #adadad; font-style: italic;"&gt;-- Permet de spécifier à PolyORB son type de fonctionnement&lt;/span&gt;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;No_Tasking_Server&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Server &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- Permet de récupérer les paramètres tels que définis dans le norme CORBA comme InitialRef&lt;/span&gt;
      Argv : CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Arg_List&lt;/span&gt; := CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Command_Line_Arguments&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
      &lt;span style="color: #adadad; font-style: italic;"&gt;-- Initialisation de notre bus sous le nom ORB&lt;/span&gt;
      CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Init&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Argv&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Le PortableObjectAdapter est l'endroit où sont stockés nons objets&lt;/span&gt;
         Root_POA : PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Local_Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- On déclare une référence pour notre objet&lt;/span&gt;
         Ref : CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Et son implémentation&lt;/span&gt;
         Obj : &lt;span style="color: #46aa03; font-weight:bold;"&gt;constant&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_Ptr&lt;/span&gt; := &lt;span style="color: #46aa03; font-weight:bold;"&gt;new&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Impl&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;;
&amp;nbsp;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;-- Récupération du POA racine du bus&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Il s'agit d'une interface CORBA et utilise donc des chaines de caractères CORBA&lt;/span&gt;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- que l'on traduit en référence d'objet&lt;/span&gt;
         Root_POA := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Helper&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_Local_Ref&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Resolve_Initial_References&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;RootPOA&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- On démarre notre POA&lt;/span&gt;
         PortableServer.&lt;span style="color: #202020;"&gt;POAManager&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Activate&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Get_The_POAManager&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- On crée une référence sur notre objet pour l'exposer&lt;/span&gt;
         Ref := PortableServer.&lt;span style="color: #202020;"&gt;POA&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Servant_To_Reference&lt;/span&gt;
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Root_POA, PortableServer.&lt;span style="color: #202020;"&gt;Servant&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Obj&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	 &lt;span style="color: #adadad; font-style: italic;"&gt;-- Et on affiche un IOR&lt;/span&gt;
         Put_Line
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Object&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         New_Line;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  et une corbaloc&lt;/span&gt;
         Put_Line
           &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;
	      &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt;
	      &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;PolyORB.&lt;span style="color: #202020;"&gt;CORBA_P&lt;/span&gt;.&lt;span style="color: #202020;"&gt;CORBALOC&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Object_To_Corbaloc&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ref&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
	      &amp;amp; &lt;span style="color: #7f007f;"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  Launch the server. CORBA.ORB.Run is supposed to never return,&lt;/span&gt;
         &lt;span style="color: #adadad; font-style: italic;"&gt;--  print a message if it does.&lt;/span&gt;
&amp;nbsp;
         CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Run&lt;/span&gt;;
&amp;nbsp;
         Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB main loop terminated!&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; E : &lt;span style="color: #46aa03; font-weight:bold;"&gt;others&lt;/span&gt; =&amp;gt;
      Put_Line
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;CBSG server raised &amp;quot;&lt;/span&gt; &amp;amp; Ada.&lt;span style="color: #202020;"&gt;Exceptions&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Exception_Information&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;E&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #46aa03; font-weight:bold;"&gt;raise&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Server;&lt;/pre&gt;

&lt;p&gt;Même si ce code a l'air complexe, il est quasi identique pour toutes les fois où l'on doit exposer un objet sur le bus.&lt;br /&gt;
Il ne reste plus que la compilation&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ mkdir obj
fred@coruscant :~/cbsg/corba/Ada $ gnatmake server.adb -D obj -aI../.. `polyorb-config`
&lt;/pre&gt;

&lt;p&gt;Si tout c'est bien passé, il ne reste qu'à lancer notre serveur&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ ./server
'IOR:010000001700000049444c3a436f726261434253472f434253473a312e30000002000000000000005c000000010102000a0000003132372e302e302e3100f1761b0000002f30303030303030313154643637306239663031326565316538300001000000010000001c0000000100000001000100000000000001010002000000010101000201010003004f503c000000010100000c0000003139322e3136382e332e32007a3300001b0000002f30303030303030313154643637306239663031326565316538300000000000'

'corbaloc:iiop:1.2@127.0.0.1:30449//000000011Td670b9f012ee1e80'
&lt;/pre&gt;

&lt;p&gt;vous voulez que le serveur écoute sur autre chose que 127.0.0.1, il suffit de le préciser dans le fichier &lt;em&gt;polyorb.conf&lt;/em&gt; qui devra se trouver à l'endroit d'où vous lancez le serveur.&lt;br /&gt;&lt;/p&gt;


&lt;h3&gt;Serveur, s'il vous plaît&lt;/h3&gt;

&lt;p&gt;Maintenant que notre serveur attend le client, codons-le. D'abord un petit client tout simple en &lt;em&gt;Ada&lt;/em&gt; vu que tout est prêt pour cela. Encore une fois, l'exemple &lt;em&gt;echo&lt;/em&gt; fourni nous suffira pour créer notre client&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Client&lt;/span&gt;;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Warnings &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Off, PolyORB.&lt;span style="color: #202020;"&gt;Setup&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Client&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Client &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_IO&lt;/span&gt;;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;type&lt;/span&gt; CORBA.&lt;span style="color: #202020;"&gt;String&lt;/span&gt;;
&amp;nbsp;
   Rcvd_Bullshits : CORBA.&lt;span style="color: #202020;"&gt;String&lt;/span&gt;;
   Bullshit_Generator : CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Ref&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
   CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Initialize&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;ORB&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; Argument_Count &lt;span style="color: #0000ff;"&gt;not&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;in&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;1&lt;/span&gt; .. &lt;span style="color: #ff0000;"&gt;2&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
      Put_Line
        &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;usage: client &amp;lt;IOR_string_from_server&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;--  Récupération d'une référence sur l'objet distribué par son IOR ou corbaloc&lt;/span&gt;
   CORBA.&lt;span style="color: #202020;"&gt;ORB&lt;/span&gt;.&lt;span style="color: #202020;"&gt;String_To_Object&lt;/span&gt;
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;To_CORBA_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Ada.&lt;span style="color: #202020;"&gt;Command_Line&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Argument&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;, Bullshit_Generator&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- On vérifie que la référence est correcte&lt;/span&gt;
   &lt;span style="color: #00007f;"&gt;if&lt;/span&gt; CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;Is_Nil&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Bullshit_Generator&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #00007f;"&gt;then&lt;/span&gt;
      Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;main : cannot invoke on a nil reference&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;return&lt;/span&gt;;
   &lt;span style="color: #00007f;"&gt;end&lt;/span&gt; &lt;span style="color: #00007f;"&gt;if&lt;/span&gt;;
&amp;nbsp;
   Rcvd_Bullshits := CorbaCBSG.&lt;span style="color: #202020;"&gt;CBSG&lt;/span&gt;.&lt;span style="color: #202020;"&gt;createSentence&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Bullshit_Generator&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
   Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;The generator said : &amp;quot;&lt;/span&gt; &amp;amp; CORBA.&lt;span style="color: #202020;"&gt;To_Standard_String&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Rcvd_Bullshits&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;exception&lt;/span&gt;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;when&lt;/span&gt; E : CORBA.&lt;span style="color: #202020;"&gt;Transient&lt;/span&gt; =&amp;gt;
      &lt;span style="color: #00007f;"&gt;declare&lt;/span&gt;
         Memb : CORBA.&lt;span style="color: #202020;"&gt;System_Exception_Members&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
         CORBA.&lt;span style="color: #202020;"&gt;Get_Members&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;E, Memb&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;received exception transient, minor&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Unsigned_Long&lt;/span&gt;'Image &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Memb.&lt;span style="color: #202020;"&gt;Minor&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;, completion status: &amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
         Put_Line &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;CORBA.&lt;span style="color: #202020;"&gt;Completion_Status&lt;/span&gt;'Image &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Memb.&lt;span style="color: #202020;"&gt;Completed&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
      &lt;span style="color: #00007f;"&gt;end&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Client;&lt;/pre&gt;

&lt;p&gt;Comme d'habitude, compilation&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/Ada $ gnatmake client -D obj -aI../.. `polyorb-config `
fred@coruscant :~/cbsg/corba/Ada $ ./client 'corbaloc:iiop:1.2@127.0.0.1:30449//000000011Td670b9f012ee1e80'
The generator said : The business leaders embrace a growing execution by thinking outside of the box, whereas the steering committee delivers a top-down interoperability. 
&lt;/pre&gt;

&lt;p&gt;Que dire de plus que &lt;strong&gt;magnifique&lt;/strong&gt; !!&lt;br /&gt;
&lt;br /&gt;
Ok, j'avais promis un client C++ avec &lt;em&gt;OmniORB&lt;/em&gt;. Comme je tiens toujours mes promesses, le voici...&lt;br /&gt;
Dans le répertoire C++, on commence donc par générer les fichiers nécessaires avec le compilateur d'IDL d&lt;em&gt;'OmniORB&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/C++ $ omniidl -bcxx ../idl/cbsg.idl
&lt;/pre&gt;

&lt;p&gt;Les fichiers &lt;em&gt;cbsg.hh&lt;/em&gt; et &lt;em&gt;cbsg.cc&lt;/em&gt; sont créés. Ils contiennent à la fois les &lt;em&gt;stubs&lt;/em&gt; et les &lt;em&gt;skeletons&lt;/em&gt;. Dans le cadre du client, on n'utilisera que la partie &lt;em&gt;stub&lt;/em&gt;.&lt;br /&gt;
on crée donc le client en s'inspirant des exemples fournis avec &lt;em&gt;OmniORB&lt;/em&gt; :&lt;br /&gt;&lt;/p&gt;
&lt;pre class="cpp cpp" style="font-family:inherit"&gt;&lt;span style="color: #339900;"&gt;#include &amp;lt;cbsg.hh&amp;gt;&lt;/span&gt;
&lt;span style="color: #339900;"&gt;#ifdef HAVE_STD &lt;/span&gt;
&lt;span style="color: #339900;"&gt;#include &amp;lt;iostream&amp;gt; &lt;/span&gt;
&lt;span style="color: #339900;"&gt;#include &amp;lt;fstream&amp;gt; &lt;/span&gt;
&lt;span style="color: #0000ff;"&gt;using&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;namespace&lt;/span&gt; std&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
&lt;span style="color: #339900;"&gt;#else &lt;/span&gt;
&lt;span style="color: #339900;"&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;
&lt;span style="color: #339900;"&gt;#endif &lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #666666;"&gt;////////////////////////////////////////////////////////////////////// &lt;/span&gt;
&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; main&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; argc, &lt;span style="color: #0000ff;"&gt;char&lt;/span&gt;&lt;span style="color: #000040;"&gt;**&lt;/span&gt; argv&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;try&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
      &lt;span style="color: #666666;"&gt;//Initialisation de l'ORB&lt;/span&gt;
      CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;ORB_var&lt;/span&gt; orb &lt;span style="color: #000080;"&gt;=&lt;/span&gt; CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;ORB_init&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;argc, argv&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt; argc &lt;span style="color: #000040;"&gt;!&lt;/span&gt;&lt;span style="color: #000080;"&gt;=&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;2&lt;/span&gt; &lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
	  &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;usage: client &amp;lt;object reference&amp;gt;&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	  &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//On crée un objet CORBA à partir de la chaine fournie&lt;/span&gt;
      CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;Object_var&lt;/span&gt; obj &lt;span style="color: #000080;"&gt;=&lt;/span&gt; orb&lt;span style="color: #000040;"&gt;-&lt;/span&gt;&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt;string_to_object&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;argv&lt;span style="color: #008000;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//Et le castons en CBSG&lt;/span&gt;
      CorbaCBSG&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;CBSG_var&lt;/span&gt; cbsgRef &lt;span style="color: #000080;"&gt;=&lt;/span&gt; CorbaCBSG&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;CBSG&lt;/span&gt;&lt;span style="color: #008080;"&gt;::&lt;/span&gt;_narrow&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;obj&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//On vérifie que l'objet existe&lt;/span&gt;
      &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt; CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;is_nil&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;cbsgRef&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
	  &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Can't narrow reference to type CBSG (or it was nil).&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	  &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
	&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//Et hop, on appelle&lt;/span&gt;
      CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;String_var&lt;/span&gt; bullshit &lt;span style="color: #000080;"&gt;=&lt;/span&gt; cbsgRef&lt;span style="color: #000040;"&gt;-&lt;/span&gt;&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt;createSentence&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
      &lt;span style="color: #0000dd;"&gt;cout&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;The generator said : &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; bullshit &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
&amp;nbsp;
      &lt;span style="color: #666666;"&gt;//On arrête l'ORB&lt;/span&gt;
      orb&lt;span style="color: #000040;"&gt;-&lt;/span&gt;&lt;span style="color: #000080;"&gt;&amp;gt;&lt;/span&gt;destroy&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;TRANSIENT&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught system exception TRANSIENT -- unable to contact the &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;server.&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;SystemException&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt; ex&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught a CORBA::&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; ex._name&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;CORBA&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;Exception&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt; ex&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught CORBA::Exception: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; ex._name&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;catch&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;omniORB&lt;span style="color: #008080;"&gt;::&lt;/span&gt;&lt;span style="color: #007788;"&gt;fatalException&lt;/span&gt;&lt;span style="color: #000040;"&gt;&amp;amp;&lt;/span&gt; fe&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#123;&lt;/span&gt;
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot;Caught omniORB::fatalException:&amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot; file: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; fe.&lt;span style="color: #007788;"&gt;file&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot; line: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; fe.&lt;span style="color: #007788;"&gt;line&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
      &lt;span style="color: #0000dd;"&gt;cerr&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;&amp;quot; mesg: &amp;quot;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; fe.&lt;span style="color: #007788;"&gt;errmsg&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #000080;"&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
    &lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt; 
  &lt;span style="color: #0000ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;0&lt;/span&gt;&lt;span style="color: #008080;"&gt;;&lt;/span&gt; 
&lt;span style="color: #008000;"&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;On compile et on teste&lt;/p&gt;
&lt;pre&gt;
fred@coruscant :~/cbsg/corba/C++ $ g++ -o client client.cpp cbsgSK.cc -I. -lomniORB4
fred@coruscant :~/cbsg/corba/C++ $ ./client 'corbaloc:iiop:1.2@127.0.0.1:30449//000000011Td670b9f012ee1e80'
The generator said : The granular low hanging fruit incentivises the steering committee.
&lt;/pre&gt;

&lt;p&gt;Suivant la version d&lt;em&gt;'OmniORB&lt;/em&gt;, il peut être nécessaire de compléter la ligne de compilation avec &lt;q&gt;-lomnithread&lt;/q&gt;.&lt;br /&gt;
Et voilà !&lt;br /&gt;
Bon, j'avais promis de la haute disponibilité et &lt;em&gt;tutti quanti&lt;/em&gt; mais finalement, on va garder ça pour la prochaine fois :)&lt;br /&gt;
En espérant que cela vous a plu.&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#rev-pnote-632-1" id="pnote-632-1"&gt;1&lt;/a&gt;] Désolé mais la page en français est beaucoup trop incomplête :(&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#rev-pnote-632-2" id="pnote-632-2"&gt;2&lt;/a&gt;] Mais ne lisez que les interfaces, vous risqueriez de choper une overdose de &lt;q&gt;bullshits&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#rev-pnote-632-3" id="pnote-632-3"&gt;3&lt;/a&gt;] Ce second paramètre assez obscure n'est pas utilisé par Gautier donc prudence :D&lt;/p&gt;&lt;/div&gt;
</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2013/03/22/Distribution-de-conneries#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/632</wfw:commentRss>
      </entry>
    
  <entry>
    <title>Merci de fermer les portes !</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2013/02/13/Merci-de-fermer-les-portes-%21" rel="alternate" type="text/html" title="Merci de fermer les portes !" />
    <id>urn:md5:c1526624f970a0acb8da85edb28c66ae</id>
    <published>2013-02-13T14:17:00+01:00</published>
    <updated>2013-02-13T16:27:53+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Système et réseau</dc:subject>
        <dc:subject>Subversion</dc:subject>    
    <content type="html">    &lt;p&gt;J'aurais pu sous-titrer ce billet &lt;em&gt;Quand la confiance ne règne plus&lt;/em&gt; :-/&lt;br /&gt;
&lt;br /&gt;
Il m 'avait déjà été demandé par le passé de sécuriser l'accès à un serveur &lt;em&gt;Subversion&lt;/em&gt; mais vu les effets de bord, j'étais revenu en arrière, histoire de pas embêter mes petits camarades développeurs.&lt;br /&gt;
Comme toutes les choses ont une fin, c'est reparti de plus belle.&lt;br /&gt;
Heureusement, cette fois-ci, j'ai réussi à m'y coller, non sans avoir foutu un beau bordel pendant quelques heures.&lt;br /&gt;
Je vais quand même tenter de vous expliquer ce qu'il y avait à faire et comment je suis arrivé à mes fins.&lt;br /&gt;
Ça vous semblera peut-être très simple mais il y avait des pièges.
&lt;br /&gt;
Imaginons un référentiel &lt;em&gt;Subversion&lt;/em&gt; ayant la structure suivante&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
/
├── Projet1
│   ├── branches
│   ├── tags
│   └── trunk
└── Projet2
    ├── branches
    ├── tags
    └── trunk
&lt;/pre&gt;

&lt;p&gt;Un exemple simple de fichier d'accès est le suivant&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
[groups]
projet1_devs=john, joe
projet1_admins=john
projet2_devs=jane, joe
projet2_admins=jane

[/]
* = r

[Projet1]
@projet1_devs = r

[Projet1/tags]
@projet1_admins = rw
@projet1_devs = r

[Projet1/branches]
@projet1_devs = rw

#Et ainsi de suite pour chaque projet
&lt;/pre&gt;

&lt;p&gt;Jusque là, c'est pas trop grave mais tous les développeurs peuvent voir le code de chaque projet mais ne peuvent pas y écrire, on est typiquement dans le cas classique tel que décrit &lt;a href="http://svnbook.red-bean.com/en/1.7/svn.serverconfig.pathbasedauthz.html" hreflang="en" title="Subversion Auth"&gt;dans la doc&lt;/a&gt;.&lt;br /&gt;
Tant que l'on a confiance, pas de problème mais quand le doute vous habite, ça va plus.&lt;br /&gt;
Allons-y, fermons les portes !&lt;br /&gt;
&lt;br /&gt;
Le premier réflexe est de retirer la partie liée au &lt;em&gt;&lt;a href="http://frederic.praca.free.fr/" title="/"&gt;/&lt;/a&gt;&lt;/em&gt;... C'est une bonne idée mais dont le principal effet de bord est de gêner les outils de navigation dans le référentiel et qui oblige le développeur à connaître l'URL complète vers son projet.&lt;br /&gt;
Alors comment faire pour continuer à pouvoir &lt;em&gt;browser&lt;/em&gt; tranquillement mais que dans les projets où on a les droits ?&lt;br /&gt;
Et bien, au lieu de mettre des droits, on en retire explicitement :&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;
[groups]
projet1_devs=john, joe
projet1_admins=john
projet2_devs=jane, joe
projet2_admins=jane

[/]
* = r

[Projet1]
* =
@projet1_devs = r

[Projet1/tags]
* =
@projet1_admins = rw
@projet1_devs = r

[Projet1/branches]
* = 
@projet1_devs = rw

#Et ainsi de suite pour chaque projet
&lt;/pre&gt;

&lt;p&gt;Vous avez remarqué la subtilité ?&lt;br /&gt;
Pour chaque section de projet, il suffit de retirer les droits mis à tous.&lt;br /&gt;
Bon, c'est simple mais fallait y penser.&lt;/p&gt;</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2013/02/13/Merci-de-fermer-les-portes-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/631</wfw:commentRss>
      </entry>
    
  <entry>
    <title>Bissection !</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2012/12/20/Bissection-%21" rel="alternate" type="text/html" title="Bissection !" />
    <id>urn:md5:5161717ddc8d27ac4e7ee225266fe012</id>
    <published>2012-12-20T22:14:00+01:00</published>
    <updated>2012-12-20T23:49:18+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
        <dc:subject>Monotone</dc:subject>    
    <content type="html">&lt;p&gt;non, je n'ai pas décidé de faire des expériences sur des animaux !&lt;br /&gt;
Non, je n'ai pas décidé de me faire greffer un deuxième organe sexuel, le mien me suffit&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/12/20/Bissection-%21#pnote-630-1" id="rev-pnote-630-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
J'ai décidé de faire un petit billet sur cette fonctionnalité que l'on trouve dans certains logiciels de gestion de versions qui n'est pas mal car elle aide à faire la recherche de la version qui a introduit une régression dans un logiciel.&lt;br /&gt;
D'ailleurs, il est normal de la trouver dans &lt;em&gt;Monotone&lt;/em&gt;, &lt;em&gt;Git&lt;/em&gt; et &lt;em&gt;Mercurial&lt;/em&gt; vu que les historiques ne sont pas forcément linéaires.&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/12/20/Bissection-%21#rev-pnote-630-1" id="pnote-630-1"&gt;1&lt;/a&gt;] Plus, ce serait inconvenant :D&lt;/p&gt;&lt;/div&gt;
    &lt;p&gt;Pour ceux qui ne le sauraient pas, je suis fan de &lt;a href="http://monotone.ca" hreflang="en" title="Monotone"&gt;''Monotone''&lt;/a&gt;, un beau logiciel de gestion des versions qui fut, d'après la légende, une source d'inspiration pour un certain Linus T. au moment de créer un autre logiciel dont j'ai parlé &lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune" hreflang="en" title="Monotone"&gt;ici&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Mais là, ce n'est pas pour casser du sucre sur le dos des autres VCS que j'écris mais pour présenter une fonctionnalité intéressante de &lt;em&gt;Monotone&lt;/em&gt;, j'ai nommé le &lt;a href="http://www.monotone.ca/docs/Bisecting.html#Bisecting" hreflang="en" title="Bisecting"&gt;''bisecting''&lt;/a&gt;.&lt;br /&gt;
But de l'opération&amp;nbsp;? Retrouver LA version qui a introduit une ou plusieurs régressions dans un logiciel.&lt;br /&gt;
Allons-y gaiement pour la démo !&lt;br /&gt;
Toutes les étapes seront détaillées mais il est possible d'utiliser la base de données attachée à ce billet.&lt;br /&gt;
&lt;br /&gt;
Tout d'abord, on initialise une base de données &lt;em&gt;Monotone&lt;/em&gt;.&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev$ mtn --db=bisect_test.mtn db init
&lt;/pre&gt;


&lt;p&gt;Rien de monstrueux alors on continue en créant notre projet&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev$ mtn --db=bisect_test.mtn --branch=bisect_test setup bisect_test
&lt;/pre&gt;

&lt;p&gt;Là encore, si vous suivez le &lt;a href="http://www.monotone.ca/docs/Tutorial.html#Tutorial" hreflang="en" title="Tuto"&gt;tutorial&lt;/a&gt; de &lt;em&gt;Monotone&lt;/em&gt;, toujours rien d'extraordinaire. Ajoutons un peu de code pour notre première version dans le répertoire &lt;em&gt;bisect_test&lt;/em&gt;&amp;nbsp;:&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_Io&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_Io&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Bisect &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
   Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;Hello world&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Bisect;&lt;/pre&gt;


&lt;p&gt;Ok, c'est nul :)&lt;br /&gt;
On ajoute et on &lt;em&gt;committe&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev$ mtn add bisect.adb
fred@dagobah:~/Dev$ mtn ci
&lt;/pre&gt;

&lt;p&gt;Après avoir saisi notre message et notre mot de passe, on a notre version. On continue&amp;nbsp;:&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_Io&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_Io&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Bisect &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;type&lt;/span&gt; My_Type &lt;span style="color: #00007f;"&gt;is&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;range&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;12&lt;/span&gt;..&lt;span style="color: #ff0000;"&gt;21&lt;/span&gt;;
&amp;nbsp;
   My_Var : My_Type := &lt;span style="color: #ff0000;"&gt;12&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
   Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;Hello world&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;My_Var=&amp;quot;&lt;/span&gt; &amp;amp; My_Type'Image&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;My_Var&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Bisect;&lt;/pre&gt;

&lt;p&gt;Rebelote, on &lt;em&gt;committe&lt;/em&gt; et on refait une modif... Bon, je vais pas tout mettre là mais ce qui est intéressant, c'est d'introduire une erreur et de refaire une version après. Voilà la version finale qui finalement compile mais comme le dit le compilateur, ça va foirer :)&lt;br /&gt;
Merci Ada&amp;nbsp;!&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;with&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_Io&lt;/span&gt;; &lt;span style="color: #46aa03; font-weight:bold;"&gt;use&lt;/span&gt; Ada.&lt;span style="color: #202020;"&gt;Text_Io&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #46aa03; font-weight:bold;"&gt;procedure&lt;/span&gt; Bisect &lt;span style="color: #00007f;"&gt;is&lt;/span&gt;
&amp;nbsp;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;type&lt;/span&gt; My_Type &lt;span style="color: #00007f;"&gt;is&lt;/span&gt; &lt;span style="color: #46aa03; font-weight:bold;"&gt;range&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;12&lt;/span&gt;..&lt;span style="color: #ff0000;"&gt;21&lt;/span&gt;;
&amp;nbsp;
   My_Var : My_Type := &lt;span style="color: #ff0000;"&gt;11&lt;/span&gt;;
&amp;nbsp;
&lt;span style="color: #00007f;"&gt;begin&lt;/span&gt;
   Put_Line&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #7f007f;"&gt;&amp;quot;Hello world&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #adadad; font-style: italic;"&gt;-- Put_Line(&amp;quot;My_Var=&amp;quot; &amp;amp; My_Type'Image(My_Var));&lt;/span&gt;
&lt;span style="color: #00007f;"&gt;end&lt;/span&gt; Bisect;&lt;/pre&gt;

&lt;p&gt;Le problème, c'est que cela n'a pas été fait dans cette révision mais une ou plusieurs révisions avant.&lt;br /&gt;
Vite, retrouvons le coupable sans faire de recherche par lecture du code mais par le test.&lt;br /&gt;
On commence par marquer la révision courante comme foireuse&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev$ mtn bisect bad
mtn: bissection débutée à la révision « 99c46344761c157cabd4e8e41e9fb6d3a0442a92 frederic.praca@free.fr 20/12/2012 21:51:39 »
mtn: révisions en cours de bissection ; 0 bonnes, 1 mauvaises, 0 sautées. Veuillez spécifier les bonnes révisions pour débuter la recherche.
&lt;/pre&gt;

&lt;p&gt;Bien sûr, vos révisions n'auront pas forcément les mêmes identifiants.&lt;br /&gt;
Maintenant, on retourne à la version que l'on sait fonctionner pour la marquer comme correcte&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev/bisect_test$ mtn update -r 5e78416bc66278692a30f1a807aa00b25f31ca56
mtn: sélection de la cible 5e78416bc66278692a30f1a807aa00b25f31ca56 pour la mise à jour
mtn: [gauche]  75b7d43d6a0d02baa366d48984c259a8f6df755e
mtn: [droite]  5e78416bc66278692a30f1a807aa00b25f31ca56
mtn: mise à jour de « bisect.adb »
mtn: mise à jour vers la révision de base 5e78416bc66278692a30f1a807aa00b25f31ca56
fred@dagobah:~/Dev/bisect_test$ mtn bisect good
mtn: 4 révisions en cours de bissection ; 1 bonnes, 1 mauvaises, 0 sautées, 2 restantes
mtn: mise à jour vers 2aaa51f8afa82b23d85c95843ff4f75efcd3a2b4 frederic.praca@free.fr 20/12/2012 21:51:19
mtn: mise à jour de « bisect.adb »
&lt;/pre&gt;

&lt;p&gt;Et voilà, on vient de préparer la dichotomie. Une petite vérification&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev/bisect_test$ mtn bisect status
mtn: 4 révisions en cours de bissection ; 1 bonnes, 1 mauvaises, 0 sautées, 2 restantes
mtn: avertissement : prochaine révision pour le test de bissection est e941bd9f9386dd74860eba21a43b35c064c41425
mtn: avertissement : toutefois, cet espace de travail est actuellement à 2aaa51f8afa82b23d85c95843ff4f75efcd3a2b4
mtn: avertissement : exécutez « bisect update » pour mettre à jour vers cette révision avant de tester
&lt;/pre&gt;

&lt;p&gt;L'outil nous dit même comment faire, si c'est pas du luxe !! :)&lt;br /&gt;
Alors, on y va&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev/bisect_test$ mtn bisect update
mtn: 4 révisions en cours de bissection ; 1 bonnes, 1 mauvaises, 0 sautées, 2 restantes
mtn: mise à jour vers e941bd9f9386dd74860eba21a43b35c064c41425 frederic.praca@free.fr 20/12/2012 21:50:33
mtn: mise à jour de « bisect.adb »
&lt;/pre&gt;

&lt;p&gt;Si vous avez bien regardé la base de données fournie ou votre propre base, vous vous rendrez compte que la version vers laquelle on a mis à jour n'est pas juste la suivante mais celle qui se trouve au milieu des révisions, de la dichotomie quoi !&lt;br /&gt;
On teste et comme ça marche, on le dit à l'outil.&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev/bisect_test$ mtn bisect good
mtn: 4 révisions en cours de bissection ; 2 bonnes, 1 mauvaises, 0 sautées, 1 restantes
mtn: mise à jour vers 2aaa51f8afa82b23d85c95843ff4f75efcd3a2b4 frederic.praca@free.fr 20/12/2012 21:51:19
mtn: mise à jour de « bisect.adb »
&lt;/pre&gt;

&lt;p&gt;Et là encore, on se retrouve à mi-chemin entre la dernière bonne et la mauvaise.&lt;br /&gt;
Cette fois-ci, on la teste et... Bang !!! Ça part au tapis !!&lt;br /&gt;
Encore une fois, on le dit à l'outil&lt;/p&gt;
&lt;pre&gt;
fred@dagobah:~/Dev/bisect_test$ mtn bisect bad
mtn: 4 révisions en cours de bissection ; 2 bonnes, 2 mauvaises, 0 sautées, 0 restantes
mtn: bissection terminée à la révision « 2aaa51f8afa82b23d85c95843ff4f75efcd3a2b4 frederic.praca@free.fr 20/12/2012 21:51:19 »
&lt;/pre&gt;

&lt;p&gt;Et là... Youpi !!! La bissection est terminée, la première version qui a introduit l'erreur est trouvée quand la dernière révision restante est marquée comme mauvaise.&lt;br /&gt;
Maintenant, il y a plusieurs options&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Corriger et &lt;em&gt;committer&lt;/em&gt; en créant une divergence&lt;/li&gt;
&lt;li&gt;Désapprouver avec &lt;em&gt;disapprove&lt;/em&gt; la version foireuse&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enfin, il ne faut pas oublier de faire un &lt;em&gt;mtn bisect reset&lt;/em&gt; pour retirer les informations de bissection.&lt;br /&gt;
Voili, voilou, une bonne façon de retrouver des régressions :D&lt;br /&gt;
Amusez-vous bien&amp;nbsp;!&lt;/p&gt;</content>
    
          <link rel="enclosure" href="http://frederic.praca.free.fr/public/bisect.mtn" length="352256" type="text/plain" />
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2012/12/20/Bissection-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/630</wfw:commentRss>
      </entry>
    
  <entry>
    <title>A mort les Spammeeeeeeerrrrrrsssss !!!!!</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2012/11/29/A-mort-les-Spammeeeeeeerrrrrrsssss-%21%21%21%21%21" rel="alternate" type="text/html" title="A mort les Spammeeeeeeerrrrrrsssss !!!!!" />
    <id>urn:md5:fb0883c26ed54b5a88ba7c86f6959eec</id>
    <published>2012-11-29T16:06:00+01:00</published>
    <updated>2012-11-30T14:52:42+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Internet</dc:subject>
            
    <content type="html">    &lt;p&gt;Je suis depuis deux jours la cible de spammers dans les commentaires de mes billets.&lt;br /&gt;
C'est pas bien méchant puisqu'il s'agit juste de faire de la pub pour leur site Web de poker en ligne qui n'est même pas du strip-poker.&lt;br /&gt;
Ce qui me gêne plus, c'est qu'en fait, j'avais activé toute une série de plugins d'antispam qui sont fournis avec Dotclear mais que ça passait quand même.&lt;br /&gt;
En regardant de plus près chacun des plugins dont &lt;a href="http://akismet.com/" hreflang="en"&gt;Akismet&lt;/a&gt;, je me suis rendu compte que ceux-ci ne fonctionnaient plus !!&lt;br /&gt;
Un coup de moteur de recherches et hop, j'ai eu confirmation de mes craintes.&lt;br /&gt;
Tout plugin cherchant à se connecter à un site tiers ne peut le faire en raison des restrictions chez Free.&lt;br /&gt;
Pour l'instant, j'ai essayé de gérer par filtrage d'adresses IP mais bon, c'est lourdingue :)&lt;br /&gt;
Voilà qui me conduit à l'installation d'un petit outil de &lt;a href="http://akismet.com/" hreflang="fr"&gt;captcha&lt;/a&gt; qui je l'espère ne vous ennuiera pas trop :-/&lt;br /&gt;
D'habitude, j'aime pas trop les captcha parce que c'est difficile à lire et pas franchement &lt;q&gt;daltonien-friendly&lt;/q&gt;. Au moins, avec celui-là, je suis tranquille de ce côté-là.&lt;/p&gt;</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2012/11/29/A-mort-les-Spammeeeeeeerrrrrrsssss-%21%21%21%21%21#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/629</wfw:commentRss>
      </entry>
    
  <entry>
    <title>A l'abri dans ma ''Git''-oune</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune" rel="alternate" type="text/html" title="A l'abri dans ma ''Git''-oune" />
    <id>urn:md5:63cde0cb272cb1d6e8a339e8f550c2ce</id>
    <published>2012-11-26T15:33:00+01:00</published>
    <updated>2012-11-27T16:30:56+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
        <dc:subject>Git</dc:subject><dc:subject>Mercurial</dc:subject><dc:subject>Monotone</dc:subject><dc:subject>Subversion</dc:subject>    
    <content type="html">&lt;p&gt;D'après Wikipedia, le terme &lt;a href="http://fr.wikipedia.org/wiki/Guitoune" hreflang="fr" title="Guitoune"&gt;guitoune&lt;/a&gt; désigne une tente ou un abri de fortune.&lt;br /&gt;
Du coup, y a un petit côté camping au mieux ou au pire, un truc fait de bric et de broc.&lt;br /&gt;
Ce que j'aime bien avec la tente, c'est le petit côté communautaire si la tente est grande, un peu comme &lt;a href="http://fr.wikipedia.org/wiki/Yourte" hreflang="fr" title="Yourte"&gt;une yourte&lt;/a&gt;. En plus, la tente, c'est le truc où on a l'impression d'être à l'écart du monde&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-1" id="rev-pnote-628-1"&gt;1&lt;/a&gt;]&lt;/sup&gt; au milieu de nulle part à profiter de la nature, à s'inventer une existence hors des carcans de notre société uniformisante.&lt;br /&gt;
Il y a aussi la tente indienne dans laquelle les personnes importantes du clan se retrouvent autour du shaman qui prédit l'avenir et donne les grandes orientations après avoir bien tiré sur le calumet.&lt;br /&gt;
Finalement, tout ça représente assez bien ce dont je vais parler maintenant.&lt;br /&gt;
Je vous préviens, c'est dense et chiant à lire :D&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-1" id="pnote-628-1"&gt;1&lt;/a&gt;] ok, sauf au mois d'août dans un camping des Landes ou de la Côte d'Azur :D&lt;/p&gt;&lt;/div&gt;
    &lt;p&gt;Je vous l'avais promis donc je le fais. Parlons de &lt;em&gt;Git&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h4&gt;Lingua Franca!!&lt;/h4&gt;

&lt;p&gt;Quand on vit dans une grande tente avec tout pleins de copains ou dans un abri de fortune&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-1" id="rev-pnote-628-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;, il est normal de penser à créer une nouvelle société et à adopter de nouveaux rites.&lt;br /&gt;
Le mieux est même de prendre le contre-pied total de ce que l'on faisait dans sa vie d'avant.&lt;br /&gt;
De là à créer une nouvelle langue, il n'y a qu'un pas... Et ce pas, le créateur de &lt;em&gt;Git&lt;/em&gt; l'a franchi&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-2" id="rev-pnote-628-2"&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
Vous voulez des exemples&amp;nbsp;? Que dire, des preuves ???!!!&lt;br /&gt;
Histoire de rigoler, faisons un tour sur la page Wikipedia anglaise traitant de &lt;a href="http://en.wikipedia.org/wiki/Revision_control#Common_vocabulary" hreflang="en"&gt;la gestion des versions&lt;/a&gt; dans sa partie sur le vocabulaire commun à ces outils. En effet, deux exemples très intéressants se cachent là-dedans.&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Checkout&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A tout seigneur, tout honneur, commençons par &lt;em&gt;Checkout&lt;/em&gt; qui se trouve être le premier dans l'alphabet. Que nous dit la définition ?&lt;br /&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;A check-out (or co) is the act of creating a local working copy from the repository. A user may specify a specific revision or obtain the latest. The term 'checkout' can also be used as a noun to describe the working copy.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Ce terme commun, que l'on retrouve dans moultes systèmes de gestion de version, est utilisé pour désigner l'action de récupérer une révision spécifique depuis le référentiel. Il se trouve que c'est effectivement ce que fait cette commande quand on utilise &lt;em&gt;Subversion&lt;/em&gt;, &lt;em&gt;Clearcase&lt;/em&gt;, &lt;em&gt;CVS&lt;/em&gt;, &lt;em&gt;bazaar&lt;/em&gt;&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-3" id="rev-pnote-628-3"&gt;3&lt;/a&gt;]&lt;/sup&gt; ou &lt;em&gt;Monotone&lt;/em&gt;.&lt;br /&gt;
Par contre, avec &lt;em&gt;Mercurial&lt;/em&gt;, &lt;em&gt;Darcs&lt;/em&gt; et finalement le grand inspirateur &lt;em&gt;Git&lt;/em&gt;, l'équivalent, c'est la commande &lt;em&gt;clone&lt;/em&gt;. Pourquoi pas ?&lt;br /&gt;
Là où moi, ça me stresse, c'est quand on ré-utilise ce terme pour faire autre chose.&lt;br /&gt;
Ben, tiens, justement, en cherchant la commande &lt;em&gt;revert&lt;/em&gt;, spécifique à &lt;em&gt;Subversion&lt;/em&gt;, &lt;em&gt;Monotone&lt;/em&gt; et &lt;em&gt;Mercurial&lt;/em&gt;, je me suis rendu compte que sous &lt;em&gt;Git&lt;/em&gt;, on utilise... &lt;em&gt;Checkout&lt;/em&gt;. Là aussi, pourquoi pas ?&lt;br /&gt;
Le seul truc, c'est que cela permet de le faire sur un seul fichier à la fois donc en toute logique, on utilisera la commande &lt;em&gt;reset&lt;/em&gt; pour l'ensemble des modifications non &lt;q&gt;committées&lt;/q&gt; dans le référentiel.&lt;br /&gt;
Finalement, quand un truc a été committé, il y a moyen de réparer grâce à &lt;em&gt;revert&lt;/em&gt;... Et oui, enfin, elle existe cette foutue commande !!!&lt;br /&gt;
Malgré la petite digression, continuons parce que ce mot &lt;em&gt;Checkout&lt;/em&gt; vaut le coup !&lt;br /&gt;
Le &lt;em&gt;switch&lt;/em&gt; et l&lt;em&gt;'update&lt;/em&gt; de &lt;em&gt;Subversion&lt;/em&gt;, &lt;em&gt;Mercurial&lt;/em&gt; et &lt;em&gt;Monotone&lt;/em&gt;, qui permettent de permuter sa copie de travail vers une autre branche, sont devenus, une fois encore, une autre utilisation de &lt;em&gt;Checkout&lt;/em&gt; !!&lt;br /&gt;
Bon, pourquoi pas ?&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-4" id="rev-pnote-628-4"&gt;4&lt;/a&gt;]&lt;/sup&gt;&lt;br /&gt;
Voilà, c'est fini pour &lt;em&gt;Checkout&lt;/em&gt;, passons au suivant &lt;em&gt;update&lt;/em&gt;.&lt;br /&gt;
La définition, s'il vous plait&amp;nbsp;?&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;An update (or sync) merges changes made in the repository (by other people, for example) into the local working copy. Update is also the term used by some CM tools (CM+, PLS, SMS) for the change package concept (see changelist).&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Là, au moins, &lt;em&gt;Git&lt;/em&gt; est totalement cohérent avec lui-même. Quand on invente une nouvelle langue, le mieux, c'est de retirer des pans entiers de la langue d'origine.&lt;br /&gt;
On aura bien vu que globalement, &lt;em&gt;checkout&lt;/em&gt; fait ce que fait &lt;em&gt;update&lt;/em&gt; fait chez les autres et même plus.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://fr.wikipedia.org/wiki/Lingua_franca" hreflang="fr"&gt;''Lingua Franca''&lt;/a&gt; était donc un titre bien choisi, une langue faite d'emprunts et connaissant de multiples variations :D&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h4&gt;J'ai comme une intuition!!&lt;/h4&gt;

&lt;p&gt;Vous aurez bien remarqué dans le paragraphe précédent à quel point l'utilisation de &lt;em&gt;git&lt;/em&gt; est intuitive et constitue bien une évolution des outils l'ayant précédé. Comme c'est une évolution, regardons les seules nouveautés auxquelles j'ai eu à faire où dont j'ai entendu parler.&lt;br /&gt;
D'abord le &lt;q&gt;stash&lt;/q&gt;, c'est quoi donc&amp;nbsp;? C'est un coin de &lt;em&gt;git&lt;/em&gt; où on stocke temporairement ce qu'on était en train de faire pour attaquer autre chose C'est une sorte de brouillon que l'on met sur le bord de la table parce que Jean-Claude a un truc super urgent à nous faire faire sur la dernière version.&lt;br /&gt;
D'aucun diraient que ce n'est pas grave ils ont une deuxième &lt;em&gt;working copy&lt;/em&gt; pointant justement sur la dernière version. Ben non, quand on fait du &lt;em&gt;git&lt;/em&gt;, on fait tout au même endroit et on commence plein de trucs en même temps. En effet, l'être humain, il est super fort et il sait s'organiser donc il &lt;em&gt;stashe&lt;/em&gt; et il dé-&lt;em&gt;stashe&lt;/em&gt; comme un bête&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-5" id="rev-pnote-628-5"&gt;5&lt;/a&gt;]&lt;/sup&gt;. Et zou, voilà, après dé-&lt;em&gt;stashe&lt;/em&gt;, le codeur il retourne faire ce qui lui plaisait tranquillement... Faut pas l'emmerder le codeur !!&lt;br /&gt;
Allez, un lien sur le &lt;em&gt;&lt;a href="http://alx.github.com/gitbook/4_le_cache_%28stashing%29.html" hreflang="fr"&gt;stashing&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Le codeur, il est très fort mais des fois, malgré ses grandes capacités d'organisation, il fait des trucs pas jolis, jolis et il aimerait pas que ça se voit de trop. D'ailleurs, il aime bien aussi montrer qu'il est super fort et qu'il sait commencer des modifications avant que la fonctionnalité existe. Heureusement, &lt;em&gt;git&lt;/em&gt;, il a pensé à son ego au codeur, il a la commande &lt;em&gt;rebase&lt;/em&gt;.&lt;br /&gt;
Cette commande magnifique lui permet de montrer, comme dans &lt;a href="http://alx.github.com/gitbook/4_recombinaison_%28rebase%29.html" hreflang="fr"&gt;l'exemple ici&lt;/a&gt;, qu'il a même pas eu besoin de faire de merge et ainsi il peut garder un bel historique bien linéaire avec le poil soyeux. Ben oui, on a beau faire du distribué et dire que on peut faire des branches comme on veut et forker comme des dingues, montrer qu'on a fait une branche qu'on a dû merger, c'est mal.&lt;br /&gt;
Si en plus, comble du sale, on a fait tout pleins de commits pas très bien ordonnés, ça va se voir ?&lt;br /&gt;
Et non, &lt;em&gt;rebase&lt;/em&gt; est ton ami, toi codeur pas toujours très propre sur toi !!&lt;br /&gt;
Un petit coup de &lt;a href="http://alx.github.com/gitbook/4_recombinaison_interactive.html" hreflang="fr"&gt;''rebase -i''&lt;/a&gt; et le tour est joué !!&lt;br /&gt;
Bon, certains verraient ça comme une modification de l'historique mais là, c'est une fonctionnalité... Au risque de choquer, y a guère que les révisionnistes qui ré-arrangent l'histoire... Enfin, bon, quand on lit que Linus regardait &lt;em&gt;Monotone&lt;/em&gt; de très près pour finalement cracher dessus comme un goret&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-6" id="rev-pnote-628-6"&gt;6&lt;/a&gt;]&lt;/sup&gt; (voir &lt;a href="http://en.wikipedia.org/wiki/Monotone_%28software%29#Monotone_as_Git_inspiration" hreflang="en"&gt;là&lt;/a&gt;, on se dit que la ré-écriture de l'histoire, c'est bien une fonctionnalité :-(&lt;br /&gt;
&lt;br /&gt;
Je vais finir par un ou deux trucs auquels j'ai eu un peu de mal à me faire.&lt;br /&gt;
Si vous voulez &lt;em&gt;committer&lt;/em&gt; quelque chose, il faut toujours faire un &lt;em&gt;add&lt;/em&gt; avant. C'est con mais c'est comme ça, Git ne le tracera pas tout seul. Il faut placer vos changements dans le &lt;em&gt;staging area&lt;/em&gt;&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-7" id="rev-pnote-628-7"&gt;7&lt;/a&gt;]&lt;/sup&gt; qui est au final une sorte d'index où vous préparez vos &lt;em&gt;commits&lt;/em&gt;. Pour moi, le gros inconvénient de la chose est que si on &lt;em&gt;committe&lt;/em&gt; plusieurs centaines de fichiers, on peut louper qu'un fichier n'a pas été ajouté. Pire, si vous modifiez puis ajouté puis re-modifiez, il faut refaire un &lt;em&gt;add&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Et enfin, le ponpon pour la fin. &lt;em&gt;CVS&lt;/em&gt; ne savait pas gérer les répertoires correctement dans l'historique et tracer les changements effectués sur ceux-ci ce qui a conduit à l'utilisation de &lt;em&gt;Subversion&lt;/em&gt;. Et bien, sachez, mes chers amis, que &lt;em&gt;&lt;a href="http://stackoverflow.com/questions/7093602/how-to-list-the-change-history-of-the-directory-tree-in-git" hreflang="en"&gt;git ne sait pas le faire non plus&lt;/a&gt;&lt;/em&gt; !!&lt;br /&gt;
Enfin, autant tout le monde hurlait quand &lt;em&gt;CVS&lt;/em&gt; ne savait pas le faire, autant on n'entend plus personne là-dessus quand il s'agit de &lt;em&gt;git&lt;/em&gt;...&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;h4&gt;Conclusion!!&lt;/h4&gt;

&lt;p&gt;Bon, mon expérience avec &lt;em&gt;git&lt;/em&gt;, sans avoir été désagréable, n'a pas non plus été la révolution annoncé en termes de gestion de versions. Se familiariser avec la gestion de versions distribuée est déjà une étape en soi pour ce qui est de la compréhension de l'architecture donc si on doit rajouter à ça, l'apprentissage d'un outil qui, bien que très puissant, n'est absolument pas intuitif, bonjour les dégâts.&lt;br /&gt;
J'aurais pu parler de la complexité de l'outil vu que le nombre de commandes, d'options, de comportements différents pour une même commande est assez effarant mais je préfère mettre ça sur le compte des nombreuses fonctionnalités. Pour l'anecdote, j'ai un jour lu sur un blog que &lt;em&gt;git&lt;/em&gt; ne se composait que de 3 exécutables&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#pnote-628-8" id="rev-pnote-628-8"&gt;8&lt;/a&gt;]&lt;/sup&gt; mais soyons un peu honnêtes, &lt;em&gt;git&lt;/em&gt; comporte 21 sous-commandes dont les options peuvent modifier le comportement de façon drastique.&lt;br /&gt;
Enfin, il y a une mention spéciale pour les pages de manuel pour leur clarté toute relative mais qui heureusement sont truffées d'exemples.&lt;br /&gt;
&lt;br /&gt;
Bon, quelques recommandations&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;lisez le &lt;a href="http://alx.github.com/gitbook/" hreflang="fr"&gt;git book&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;faites des choses simples&lt;/li&gt;
&lt;li&gt;utilisez l'outil pour ce qu'il est, une gestion de versions et donc un outil d'aide au développeur pas une fin en soi&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
Voilà, c'est fini, j'en suis crevé tiens !!&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-1" id="pnote-628-1"&gt;1&lt;/a&gt;] Comme dans &lt;a href="http://fr.wikipedia.org/wiki/Les_Babas_Cool" hreflang="fr" title="les babas-cool"&gt;les babas-cool&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-2" id="pnote-628-2"&gt;2&lt;/a&gt;] Vous remarquerez que pour éviter de rameuter un troupeau de &lt;em&gt;zealot&lt;/em&gt;, je ne donne pas son nom :)&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-3" id="pnote-628-3"&gt;3&lt;/a&gt;] A vérifier quand même tellement la doc est obscure sur ce point&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-4" id="pnote-628-4"&gt;4&lt;/a&gt;] Vous remarquerez qu'on se rapproche de plus en plus du sketch de la chauve-souris de Bigard avec son &lt;q&gt;Bon bah, admettons !!&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-5" id="pnote-628-5"&gt;5&lt;/a&gt;] Ou K2R qui est bien connu pour être un grand &lt;q&gt;destasheur&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-6" id="pnote-628-6"&gt;6&lt;/a&gt;] Si Linus était &lt;em&gt;fair-play&lt;/em&gt;, ça se saurait !&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-7" id="pnote-628-7"&gt;7&lt;/a&gt;] qui n'a rien à voir avec le &lt;em&gt;stash&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#rev-pnote-628-8" id="pnote-628-8"&gt;8&lt;/a&gt;] contre plus d'une centaines dans les premières versions !!&lt;/p&gt;&lt;/div&gt;
</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2012/11/26/A-l-abri-dans-ma-Git-oune#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/628</wfw:commentRss>
      </entry>
    
  <entry>
    <title>C'est moi que j'ai la plus grosse !!</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2012/11/23/C-est-moi-que-j-ai-la-plus-grosse-%21%21" rel="alternate" type="text/html" title="C'est moi que j'ai la plus grosse !!" />
    <id>urn:md5:0a701499cff9d6c9e7e08301d4deccf0</id>
    <published>2012-11-23T15:26:00+01:00</published>
    <updated>2012-11-23T16:30:45+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
            
    <content type="html">&lt;p&gt;Bien que ce soit la vérité, ce n'est pas de ce que tu crois, ô lecteur pervers et lubrique, que je vais parler.&lt;br /&gt;
Certes, il y a analogie mais je viens te parler ici et maintenant d'un site souvent fréquenté et peu critiqué... Pourtant, il mériterait de l'être.&lt;br /&gt;
&lt;br /&gt;
Si c'est pas du teasing ça !!!&lt;/p&gt;    &lt;p&gt;Ce site, c'est le &lt;a href="http://shootout.alioth.debian.org/" hreflang="en"&gt;Computer Language Benchmarks Game&lt;/a&gt;.&lt;br /&gt;
Les non-initiés disent déjà&amp;nbsp;:&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;Cékoidonk ??&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Simple, c'est une comparaison de langages de programmation pour des programmes identiques sur des machines identiques... Enfin, ça, c'est la théorie !&lt;br /&gt;
Regardons d'un peu plus près.&lt;br /&gt;
&lt;br /&gt;
Déjà, ça part mal puisque quatre types de machines servent aux tests, leur différence étant sur le nombre de bits et le nombre de cœurs.&lt;br /&gt;
On peut se dire que déjà &lt;a href="http://shootout.alioth.debian.org/u32/performance.php?test=mandelbrot" hreflang="en"&gt;la phrase qui dit&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Va largement foirer quand on voit la différence qu'il y a entre penser un programme en mono-tâche ou en multi-tâche.&lt;br /&gt;
Toujours dans le programme &lt;em&gt;Mandelbrot&lt;/em&gt;, si l'on y prête bien attention, on voit que le C ne possède rien que 7 entrées&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/23/C-est-moi-que-j-ai-la-plus-grosse-%21%21#pnote-627-1" id="rev-pnote-627-1"&gt;1&lt;/a&gt;]&lt;/sup&gt;, l'Ada 3 et le C++ 8.&lt;br /&gt;
Diantre !!!! On peut donc écrire le même algorithme de 8 façons différentes ???&lt;br /&gt;
A part, en changeant le nom des variables et l'ordre de certaines lignes, c'est quand même chaud.&lt;br /&gt;
Alors qu'est-ce qu'il se passe ?&lt;br /&gt;
Prenons &lt;a href="http://shootout.alioth.debian.org/u32/program.php?test=mandelbrot&amp;amp;lang=gcc&amp;amp;id=4" hreflang="en"&gt;la version C&lt;/a&gt; arrivant en premier. Attention, ça va aller très vite&lt;/p&gt;
&lt;pre class="c c" style="font-family:inherit"&gt;&lt;span style="color: #339933;"&gt;#pragma omp parallel for&lt;/span&gt;
    &lt;span style="color: #b1b100;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;i &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;0&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt; i &lt;span style="color: #339933;"&gt;&amp;lt;&lt;/span&gt; N&lt;span style="color: #339933;"&gt;;&lt;/span&gt; i&lt;span style="color: #339933;"&gt;+=&lt;/span&gt;&lt;span style="color: #0000dd;"&gt;2&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
        v2df Crv &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;i&lt;span style="color: #339933;"&gt;+&lt;/span&gt;&lt;span style="color:#800080;"&gt;1.0&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;*&lt;/span&gt;inverse_w&lt;span style="color: #339933;"&gt;-&lt;/span&gt;&lt;span style="color:#800080;"&gt;1.5&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;i&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;*&lt;/span&gt;inverse_w&lt;span style="color: #339933;"&gt;-&lt;/span&gt;&lt;span style="color:#800080;"&gt;1.5&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
        Crvs&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;i &lt;span style="color: #339933;"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Crv&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;C'est quoi ce &lt;em&gt;pragma&lt;/em&gt;&amp;nbsp;? Et bien, c'est simple, il s'agit de l'utilisation d'&lt;a href="http://openmp.org/wp/" hreflang="en"&gt;OpenMP&lt;/a&gt;.&lt;br /&gt;
La question que l'on est en droit de se poser est&amp;nbsp;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Est-ce vraiment le même algo que la version &lt;q&gt;standard&lt;/q&gt; en C&amp;nbsp;?&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;D'ailleurs, elle contient quoi la version standard&amp;nbsp;?&lt;/p&gt;
&lt;pre class="c c" style="font-family:inherit"&gt;&lt;span style="color: #b1b100;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;i &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #0000dd;"&gt;0&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt; i &lt;span style="color: #339933;"&gt;&amp;lt;&lt;/span&gt; NWORKERS&lt;span style="color: #339933;"&gt;;&lt;/span&gt; i&lt;span style="color: #339933;"&gt;++&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;
        pthread_create&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #339933;"&gt;&amp;amp;&lt;/span&gt;ids&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt; NULL&lt;span style="color: #339933;"&gt;,&lt;/span&gt; worker&lt;span style="color: #339933;"&gt;,&lt;/span&gt; NULL&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Des &lt;em&gt;threads&lt;/em&gt; !!! Ben, ça fait pas non plus partie de la norme C tout ça.&lt;br /&gt;
&lt;br /&gt;
Et en Ada, ça donne quoi&amp;nbsp;? Et bien, sur cet exemple-là, ça va mais ce n'est pas le cas de &lt;a href="http://shootout.alioth.debian.org/u32/program.php?test=spectralnorm&amp;amp;lang=gnat&amp;amp;id=4" hreflang="en"&gt;celui-là&lt;/a&gt; où on trouve, sans complexe&lt;/p&gt;
&lt;pre class="ada ada" style="font-family:inherit"&gt;&lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Import &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Intrinsic, &lt;span style="color: #7f007f;"&gt;&amp;quot;+&amp;quot;&lt;/span&gt;, &lt;span style="color: #7f007f;"&gt;&amp;quot;__builtin_ia32_addpd&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Import &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Intrinsic, &lt;span style="color: #7f007f;"&gt;&amp;quot;*&amp;quot;&lt;/span&gt;, &lt;span style="color: #7f007f;"&gt;&amp;quot;__builtin_ia32_mulpd&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;
   &lt;span style="color: #46aa03; font-weight:bold;"&gt;pragma&lt;/span&gt; Import &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;Intrinsic, &lt;span style="color: #7f007f;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;, &lt;span style="color: #7f007f;"&gt;&amp;quot;__builtin_ia32_divpd&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;

&lt;p&gt;ou comment faire des appels système non prévu dans le langage&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/23/C-est-moi-que-j-ai-la-plus-grosse-%21%21#pnote-627-2" id="rev-pnote-627-2"&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;br /&gt;
&lt;br /&gt;
Bon, je ne vais pas décortiquer tous les exemples mais cela reflète bien la guerre sainte des langages.&lt;br /&gt;
Malgré les consignes demandant de suivre le même algorithme, une grande partie du code fourni contient des éléments afin d'optimiser à mort le code, quitte à le rendre illisible, mais à gagner la guerre.&lt;br /&gt;
&lt;br /&gt;
Ceci dit, après &lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/20/Ruby-sur-l-ongle" hreflang="en"&gt;mon excellent ticket sur Ruby&lt;/a&gt;, je peux quand même dire que les langages de script sont à la ramasse mais c'est NORMAL !!!&lt;br /&gt;
On ne leur demande pas de la performance.&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/23/C-est-moi-que-j-ai-la-plus-grosse-%21%21#rev-pnote-627-1" id="pnote-627-1"&gt;1&lt;/a&gt;] si j'ai bien regardé&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/23/C-est-moi-que-j-ai-la-plus-grosse-%21%21#rev-pnote-627-2" id="pnote-627-2"&gt;2&lt;/a&gt;] bien que l'utilisation d&lt;em&gt;'Import&lt;/em&gt; le soit&lt;/p&gt;&lt;/div&gt;
</content>
    
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2012/11/23/C-est-moi-que-j-ai-la-plus-grosse-%21%21#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/627</wfw:commentRss>
      </entry>
    
  <entry>
    <title>Release often... Enfin, presque</title>
    <link href="http://frederic.praca.free.fr/index.php?post/2012/11/21/Release-often...-Enfin%2C-presque" rel="alternate" type="text/html" title="Release often... Enfin, presque" />
    <id>urn:md5:3b0e9039664ccec135eb975898cca865</id>
    <published>2012-11-21T00:48:00+01:00</published>
    <updated>2012-11-21T01:52:01+01:00</updated>
    <author><name>Fred</name></author>
        <dc:subject>Développement</dc:subject>
        <dc:subject>Ada</dc:subject><dc:subject>Guitare</dc:subject>    
    <content type="html">    &lt;p&gt;Bon, je sais plus trop si je vous ai déjà filé une version de mon excellent petit soft de gammes et accords que j'ai décidé de nommer &lt;em&gt;Scalada&lt;/em&gt;.&lt;br /&gt;
Comme mon pote Albert&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/21/Release-often...-Enfin%2C-presque#pnote-626-1" id="rev-pnote-626-1"&gt;1&lt;/a&gt;]&lt;/sup&gt; me guette, voici donc cette &lt;q&gt;masterpiece of code&lt;/q&gt; :D&lt;br /&gt;
C'est sous licence BSD modifiée, histoire d'être compatible GPL et c'est fourni en l'état.&lt;br /&gt;
Mais comme je suis gentil, vous trouverez à la fois l'archive proprement dite ainsi que le référentiel &lt;em&gt;Monotone&lt;/em&gt;&lt;sup&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/21/Release-often...-Enfin%2C-presque#pnote-626-2" id="rev-pnote-626-2"&gt;2&lt;/a&gt;]&lt;/sup&gt; pour naviguer dans l'historique et voir ainsi mes errements.&lt;br /&gt;
Vous pourrez même contribuer activement... Si je veux bien accepter vos &lt;em&gt;pull requests&lt;/em&gt; :)&lt;/p&gt;
&lt;div class="footnotes"&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/21/Release-often...-Enfin%2C-presque#rev-pnote-626-1" id="pnote-626-1"&gt;1&lt;/a&gt;] Zheimer dit Al Zheimer&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://frederic.praca.free.fr/index.php?post/2012/11/21/Release-often...-Enfin%2C-presque#rev-pnote-626-2" id="pnote-626-2"&gt;2&lt;/a&gt;] En version 1.0 me semble-t-il&lt;/p&gt;&lt;/div&gt;
</content>
    
          <link rel="enclosure" href="http://frederic.praca.free.fr/public/scales-20121121.tgz" length="120768" type="application/x-gtar" />
          <link rel="enclosure" href="http://frederic.praca.free.fr/public/scales-20121121.mtn" length="860160" type="text/plain" />
    

    
          <wfw:comment>http://frederic.praca.free.fr/index.php?post/2012/11/21/Release-often...-Enfin%2C-presque#comment-form</wfw:comment>
      <wfw:commentRss>http://frederic.praca.free.fr/index.php?feed/atom/comments/626</wfw:commentRss>
      </entry>
  
</feed>
