<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>constructor &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/constructor/</link>
	<description>Feed of posts on WordPress.com tagged "constructor"</description>
	<pubDate>Sun, 20 Jul 2008 12:03:14 +0000</pubDate>

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

<item>
<title><![CDATA[Imagem do Dia - 12/07/2008]]></title>
<link>http://suserania.wordpress.com/?p=378</link>
<pubDate>Sat, 12 Jul 2008 14:22:40 +0000</pubDate>
<dc:creator>suserania</dc:creator>
<guid>http://suserania.wordpress.com/?p=378</guid>
<description><![CDATA[
]]></description>
<content:encoded><![CDATA[<p style="text-align:center;"><img class="aligncenter" src="http://www.wizards.com/dnd/images/mm2_gallery/88268_620_4.jpg" alt="" width="400" height="463" /></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Automatic key generation with App Engine]]></title>
<link>http://padraigkitterick.wordpress.com/?p=41</link>
<pubDate>Sat, 21 Jun 2008 12:57:50 +0000</pubDate>
<dc:creator>Pádraig</dc:creator>
<guid>http://padraigkitterick.wordpress.com/?p=41</guid>
<description><![CDATA[After playing Google App Engine for a few days, I&#8217;ve realised the power that even the basic fr]]></description>
<content:encoded><![CDATA[<p>After playing <a title="Google App Engine" href="http://code.google.com/appengine">Google App Engine</a> for a few days, I've realised the power that even the basic framework provided by Google, <a title="webapp framework" href="http://code.google.com/appengine/docs/webapp/">webapp</a>, provides. Working with Python adds a level of flexibility that I never had when working with PHP many years ago (although this was before OO had really infected PHP).</p>
<p>While working on my first real application for app engine I soon came across the problem of creating sensible key names for objects. If you aren't familiar with the data object models in app engine, each object has a unique key, generated automatically when the object is created, and a key name (property: key_name) which can be specified by the user. The key name can be very useful if you need object identifiers which are human-readable, such as when you use them as part of your apps URLs.</p>
<p><!--more--></p>
<p>All data objects are defined as Python classes which subclass the db.Model class, provided by Google. A simple example, from the app I'm working on, is an object which holds information about an author:</p>
<pre>class Author(db.Model):
  first_name = db.StringProperty(required=True)
  middle_name = db.StringProperty()
  last_name = db.StringProperty(required=True)</pre>
<p>Creating a new author is a simple matter of calling the class and passing property values either as keyword arguments or by accessing the property through the new instance:</p>
<pre>a = Author(first_name='John',
           last_name='Smith')
a.middle_name = 'Thomas'</pre>
<p>We can specify the optional <strong>key_name</strong> property when we create the object:</p>
<pre>a = Author(first_name='Alan',
           middle_name='Simon',
           last_name='Jones',
           key_name='alansimonjones')</pre>
<p>However, it's more than likely that if we want to use the <strong>key_name</strong> property for a class of data objects, we will generate it procedurally based on the initial property values of the object. Above, we create the key name using the authors names. You could create a function which wraps the creation of the author object which does this for you:</p>
<pre>def newAuthor(first_name, last_name, middle_name = ''):
  parts = [first_name, middle_name, last_name]

  # Define the key name from the authors names.
  # We split() and join each name to remove any spaces
  key_name = ''.join([''.join(x.split()) for x in parts]).lower()
  return Author(first_name=first_name,
             last_name=last_name,
             middle_name=middle_name,
             key_name=key_name)</pre>
<p>but this is quite a lot of boilerplate code to solve a simple problem. Moreover, you need to make sure everyone working on the code is aware that this function must be used to create new author objects, rather than by calling the object class directly.</p>
<p>A more elegant solution is to encapsulate the creation of the key_name property in the class definition itself. This is bread and butter stuff for any Pythonista, and is handled by defining a constructor for our author object, using it to define our key name and then to manually call the constructor of the db.Model class. The last step is necessary as once we define our own constructor, the constructor of the super class is not called automatically. To add to the things we need to handle, it's important to know that the db.Model class uses dynamic positional and keyword arguments. If that makes no sense to you, don't worry, it's simpler than you may think.</p>
<p>Python provides an additional way of specifying standard function arguments using the <strong>*variable</strong> syntax, and keyword arguments using the <strong>**variable</strong> syntax. If used in the definition of a function, the <strong>*variable</strong> will be a tuple of positional arguments, and <strong>**variable</strong> will be a dictionary relating keywords to variables. Therefore, we must make sure our new constructor has the same parameters as db.Model to ensure 100% compatibility.</p>
<p>Here is the updated author class, with the new <strong>__init__()</strong> function defined. It has been slightly altered because we access the keyword values using the <strong>kw</strong> dictionary and we need to check whether each of the properties have been specified or not by examining <strong>kw.keys()</strong>:</p>
<pre>class Author(db.Model):
  first_name = db.StringProperty(required=True)
  middle_name = db.StringProperty()
  last_name = db.StringProperty(required=True)

  def __init__(self, *args, **kw):
    parts = ['first_name', 'middle_name', 'last_name']

    # Define the key name from the authors names.
    # We split() and join each name to remove any spaces
    key_name = ''.join([''.join(kw[x].split()) for x in parts if x in kw.keys()]).lower()

    # Insert the new key_name property into the keyword arguments
    kw['key_name'] = key_name

    # Call the constructor of the base class
    db.Model.__init__(self, *args, **kw)</pre>
<p>We can now create new author objects and the key names will be generated automatically and will follow our specified format:</p>
<pre>a = Author(first_name='John', last_name='Smith')
# Will print 'johnsmith'
print a.key().name()

a = Author(first_name='John', middle_name='Alan Mike', last_name='Smith')
# Will print 'johnalanmikesmith'
print a.key().name()</pre>
<p>Being able to alter the properties of an object or preconfigure core properties at the time of instantiation can be useful in all sorts of situations, but this particular example is one which I can see myself using a lot.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[How to catch exceptions from constructor initializer list?]]></title>
<link>http://weseetips.wordpress.com/?p=156</link>
<pubDate>Wed, 04 Jun 2008 18:10:27 +0000</pubDate>
<dc:creator>Jijo.Raj</dc:creator>
<guid>http://weseetips.wordpress.com/?p=156</guid>
<description><![CDATA[
C++ provides constructor initializer list to initialize member variables of type reference, const e]]></description>
<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-11" src="http://weseetips.wordpress.com/files/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /><br />
C++ provides <span style="color:#0000ff;">constructor initializer list</span> to <span style="color:#0000ff;">initialize member variables of type reference, const</span> etc. In the constructor initialize list, we can initialize ordinary objects too. See sample below.</p>
<pre>MyClass::MyClass( int var1, int var2 )
    : m_var1( var1 ),
      m_obj2( var1 ) // If this one throws an exception,
                     // it can't be caught.
{
    try
    {
       // Constructor body.
    }
    catch( ... )
    { }
}</pre>
<p>But did you noticed that, <span style="color:#0000ff;">these constructor initialize list is outside the function body</span>, and if an exception is thrown from any of the member variable's constructor, how it can be caught?</p>
<p><img class="alignnone size-medium wp-image-12" src="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /><br />
There is a special kind of try-catch usage to catch exceptions from constructor initialize list. See the code snippet below.</p>
<pre>MyClass::MyClass( int var1, int var2 )
    <span style="color:#0000ff;">try</span> : m_var1( var1 ),
          m_obj2( var1 )    // Now I can catch the exception.
{
    // Constructor body.
}
<span style="color:#0000ff;">catch( ... )
{ }</span></pre>
<p>Now you can catch exceptions from constructor member initializer list also.</p>
<p><img class="alignnone size-medium wp-image-18" src="http://weseetips.wordpress.com/files/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
You cannot compile this in Visual C++ 6.0, since its does not strictly confirms C++ standards. You can compile this on Visual Studio 7.0 onwards.</p>
<p><img class="alignnone size-medium wp-image-53" src="http://weseetips.wordpress.com/files/2008/03/intermediateseries.jpg?w=248" alt="" width="248" height="32" /><br />
Targeted Audience - Intermediate.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[BasProg Rev 260508]]></title>
<link>http://kacapembesar.wordpress.com/?p=18</link>
<pubDate>Tue, 27 May 2008 18:13:51 +0000</pubDate>
<dc:creator>blubukzz</dc:creator>
<guid>http://kacapembesar.wordpress.com/?p=18</guid>
<description><![CDATA[ 
 Ada beberapa catatan dari praktikum kemarin dan kuliah yang tgl 19nya(pekan sebelumnya) :

Tern]]></description>
<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">Ada beberapa catatan dari praktikum kemarin dan kuliah yang tgl 19nya(pekan sebelumnya) :</span></span></span></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span lang="DA">Ternyata data-data bertipe private dan protected tidak bisa diakses dari fungsi main.<span>  </span>Wah baru menyadari sekarang,, kemarin iya-iya aja kalau dibilang ‘protected itu hanya bisa diakses oleh kelas itu sendiri dan turunannya’ dan ‘private itu hanya bisa diakses oleh kelas itu sendiri’.<span>  </span></span></span></span></li>
</ol>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;">Jadi, misalkan ada </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">class Coba {</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>private:</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"><span>              </span>int u;<span>       </span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public :</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>void setU (int a) {u=a;}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>int getU(){return u;}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;">Misalnya kita ingin mencetak nilai u, maka cara yang seperti ini :</span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;">main () {</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;"><span>     </span>Coba coba;</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>std::cout&#60;&#60;coba.u;</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">}</span></p>
<p class="MsoNormal" style="margin:0 0 0 18pt;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">akan error, karena u itu private, ya to? Jadi untuk mensiasatinya digunakanlah fungsi getter (untuk mengambil nilai dari data2 yang private/protected, di dalam contoh di atas getter nya itu getU ya?) sehingga, coba ganti dengan :</span></span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">std::cout&#60;&#60;coba.getU();</span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;">Kadang kita perlu bener2 mencoba supaya bener2 ngerti.</span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal"><span style="font-size:small;font-family:Times New Roman;">2. Ternyata saat kita membentuk objek dari suatu derived class, maka konstruktor base-nya akan dipanggil terlebih dahulu.<span>  </span>Kode di bawah ini sewaktu dicoba menunjukkan begitu (ya..?):</span></p>
<p class="MsoNormal" style="margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">#include &#60;iostream&#62;</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span> </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">using namespace std; </span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;"><span> </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Mother {</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public :</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span> </span><span>            </span>Mother () {cout&#60;&#60;"base constructor :Mother()\n";}</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>Mother(int a){cout&#60;&#60;"base constructor: Mother("&#60;&#60;a&#60;&#60;")\n";}</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Daughter : public Mother {</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public :</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>Daughter(int){cout &#60;&#60;"Daughter(int)\n";}</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Son : public Mother {</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public :</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>Son (int c) : Mother(c)</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>{cout&#60;&#60; "Son(int)\n";}</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>Son () {cout&#60;&#60; "Son()\n";}</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">main () {</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>Son son, son2(5);</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>Daughter daughter(3);</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 18pt;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">Keluarannya :</span></span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">base constructor :Mother()</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">Son()</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">base constructor:Mother(5)</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">Son(int)</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">base constructor :Mother()</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;">Daughter(int)</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">3. Sekarang tentang pointer.<span>  </span>Benarkah pernyataan2 ini ?</span></span></span></p>
<p class="MsoNormal" style="text-indent:-18pt;margin:0 0 0 72pt;"><span style="font-family:Times New Roman;"><span lang="DA"><span><span style="font-size:small;">-</span><span style="font:7pt;">         </span></span></span><span lang="DA"><span style="font-size:small;">Pointer ke kelas Base bisa menunjuk ke kelas Derived-nya</span></span></span></p>
<p class="MsoNormal" style="text-indent:-18pt;margin:0 0 0 72pt;"><span style="font-family:Times New Roman;"><span lang="DA"><span><span style="font-size:small;">-</span><span style="font:7pt;">         </span></span></span><span lang="DA"><span style="font-size:small;">Pointer ke kelas Derived bisa menunjuk ke kelas Base-nya</span></span></span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">a. benar-benar<span>              </span>b. benar-salah</span></span></span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">c. salah-benar<span>               </span>d. Dua-duanya kurang tepat</span></span></span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span lang="DA"><span style="font-size:small;font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>Selamat buat yang menjawab b... tapi nggak ada hadiahnya ya… ternyata coba2 dikit,, pernyataan pertama benar, tapi yang kedua kurang tepat.<span>  </span>Pointer ke kelas base bisa menunjuk ke derived-nya, kenapa ya? </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">Um,, dipikir,, mungkin karena kelas Derived itu kan turunan dari kelas base-nya, jadi scr nggak langsung derived punya sifat-sifatnya base.<span>  </span>Tapi,, kalau pointer ke kelas derived dipakai untuk menunjuk kelas base nya, ternyata nggak bisa. Alasannya mungkin karena derived itu (umumnya) lebih kaya (lebih banyak lagi/ditambah lagi fungsi2nya) daripada base,<span>  </span>jadi kalau pointer derived dipakai nunjuk ke base, mungkin ibaratnya pointer itu diminta menunjuk ke sesuatu secara nggak utuh (begitukah?), jadi ga bisa deh. Allohua’lam. </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span lang="DA"><span style="font-size:small;font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">//POINTER KE DERIVED MEM-POINT KELAS BASE NYA</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">//BISA NGGAK YA?</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">#include &#60;iostream&#62;</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span> </span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">using namespace std; </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span> </span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Basis {</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public : </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>void cet1(){cout&#60;&#60;"hai1\n";}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Turunan : public Basis<span>  </span>{</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public : </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>void cet2(){cout&#60;&#60;"hai2\n";}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">main () {</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>Basis b;</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>Turunan *tp = &#38;b;</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>tp-&#62;cet1();</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>getch();</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal"><span style="font-size:small;"><span style="font-family:Times New Roman;">4. Masih tentang pointer.<span>  </span>Misalkan kita punya suatu pointer kelas base yang menunjuk ke derived class nya. <span> </span></span></span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Basis {<span>                       </span>//base class</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public : </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>void cet1(){cout&#60;&#60;"hai1\n";}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">class Turunan : public Basis<span>  </span>{ <span>    </span>//derived class</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>      </span>public : </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>             </span>void cet2(){cout&#60;&#60;"hai2\n";}</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">};</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"> </span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;">main () {</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>Turunan t;</span></p>
<p class="MsoNormal" style="text-indent:36pt;margin:0 0 0 36pt;"><span style="font-size:10pt;font-family:courier new;"><span>     </span>Basis *bPtr = &#38;t;<span>  </span>//bPtr point ke t(derived)</span></p>
<p class="MsoNormal" style="margin:0 0 0 36pt;"><span style="font-size:10pt;" lang="DA"><span>     </span></span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span lang="DA"><span style="font-size:small;"><span style="font-family:Times New Roman;">Apakah pointer tersebut memiliki fungsi-fungsi yang ada di derived class (dg kata lain, apakah bPtr memiliki fs. cet2()?</span></span></span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span lang="DA"><span style="font-size:small;font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;">Yap… ternyata jawabannya bPtr ndak punya… ternyata pointer itu hanya memiliki fungsi2 dari kelas yang dia menunjuk kepadanya.<span>  </span>Jadi misalnya dia menunjuk ke objek derived nya,, fungsi2 yang ada di derived dia ndak punya…</span></p>
<p class="MsoNormal" style="text-indent:18pt;margin:0 0 0 18pt;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Sebenrnya masih ada lanjutannya.. tapi, sptnya segini dulu aja.. oia harap merujuk lagi ke referensi2 yang lebih dipercaya (krn sy belum bc,, hanya coba2 kodenya)… kalau sempat, insyaa Alloh dilanjutkan.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Allohua’lam.</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[El Concello de Sada abre una investigación tras perder un contencioso con un constructor]]></title>
<link>http://sadadigital.wordpress.com/?p=4631</link>
<pubDate>Thu, 27 Mar 2008 09:07:08 +0000</pubDate>
<dc:creator>sadadigital</dc:creator>
<guid>http://sadadigital.wordpress.com/?p=4631</guid>
<description><![CDATA[Considera que el anterior gobierno denegó una licencia «saltándose» trámites

El Concello de Sa]]></description>
<content:encoded><![CDATA[<p align="justify"><strong><a target="_blank" href="http://www.lavozdegalicia.es/coruna/2008/03/27/0003_6683168.htm">Considera que el anterior gobierno denegó una licencia «saltándose» trámites</a></strong></p>
<p align="justify"><img border="0" width="300" src="http://www.sadadigital.com/images/stories/fotos/octubre2007/concellosada.jpg" height="450" /></p>
<p align="justify" class="texto">El Concello de Sada ha iniciado una investigación interna después de perder un contencioso administrativo con la promotora Urbasa S.L., al que el equipo de gobierno anterior, presidido por Ramón Rodríguez Ares, denegó una licencia en el año 2006 para construir un edificio de 29 viviendas, garajes y locales comerciales en una parcela de Riobao.</p>
<p align="justify" class="texto">En las últimas semanas los técnicos del Ayuntamiento de Sada estudiaron la viabilidad de recurrir la decisión judicial, pero finalmente no lo harán, aunque sí iniciarán diligencias administrativas para esclarecer la actuación del equipo que adoptó la decisión, en especial la actuación del arquitecto municipal.</p>
<p align="justify" class="texto">La concejala de Urbanismo, la nacionalista María Xosé Carnota, explica que la licencia «denegouna o goberno anterior, sen que fose emitido o informe técnico preceptivo, co agravante de que no informe xurídico que se emitiu, se advertía da obrigación de que fose emitido» el estudio del arquitecto municipal. La edil precisa que «pese a esta advertencia, a xunta de goberno cometeu a irresponsabilidade de denegar a licenza, pois a totalidade dos membros que a formaban votou a favor da denegación», según aclara.</p>
<p align="justify" class="texto"><b><b>Información reservada</b></b></p>
<p align="justify" class="texto">El alcalde, el nacionalista Abel López Soto, firmó un decreto el pasado día 18 en virtud del cual se iniciarán diligencias administrativas «para determinar cales foron os motivos de que non se emitise o informe técnico previamente á denegación da licenza en tempo e forma».</p>
<p align="justify" class="texto">El decreto de alcaldía ordena la instrucción de «información reservada previa á incoación de expediente disciplinario» por las posibles «infraccións cometidas» por el arquitecto municipal. Este declinó ayer realizar declaraciones a La Voz sobre el caso hasta que no finalicen las pesquisas.</p>
<p align="justify" class="texto">Los responsables municipales apuntan que en el proceso judicial contra el Concello fue determinante un informe técnico del departamento de Urbanismo que era favorable a conceder la licencia. Por esta razón la concejala de Urbanismo asegura que el Concello «acatará a sentenza».</p>
<p align="justify" class="texto"><b><b>Irresponsabilidade</b></b></p>
<p align="justify" class="texto">Eso sí, Carnota resalta la «irresponsabilidade» que, a su entender, cometió el anterior gobierno municipal, ya que «saltándose o procedemento denegou unha licenza que puido ter carrexado graves consecuencias económicas para a administración local». La responsable de Urbanismo apunta, no obstante, que la actuación del actual gobierno municipal «encamiñarase a salvagardar os intereses xerais».</p>
<p align="justify" class="texto">Fuente:La Voz de Galicia</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Theme Park Tycoon]]></title>
<link>http://sonyericssongames.wordpress.com/?p=337</link>
<pubDate>Mon, 03 Mar 2008 12:42:51 +0000</pubDate>
<dc:creator>sonyericssongames</dc:creator>
<guid>http://sonyericssongames.wordpress.com/?p=337</guid>
<description><![CDATA[
Construa e administre um parque de diversões, mas não e so colocar os brinquedinhos nao, vc deve ]]></description>
<content:encoded><![CDATA[<p align="center"><img src="http://sonyericssongames.wordpress.com/files/2008/03/theme_pack_ticoon.gif" alt="theme_pack_ticoon.gif" /></p>
<p>Construa e administre um parque de diversões, mas não e so colocar os brinquedinhos nao, vc deve gerar renda com o publico que vai frequentá-lo.</p>
<p><a href="http://w13.easy-share.com/1699740959.html" target="_blank">Download </a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[El edil José Emilio Gómez niega haberse enzarzado en una pelea con otro hombre el pasado jueves]]></title>
<link>http://sadadigital.wordpress.com/?p=3913</link>
<pubDate>Fri, 01 Feb 2008 07:38:17 +0000</pubDate>
<dc:creator>sadadigital</dc:creator>
<guid>http://sadadigital.wordpress.com/?p=3913</guid>
<description><![CDATA[ 
Acogiéndose a los preceptos de la Ley Orgánica 2/1984 de 26 de marzo, reguladora del derecho a ]]></description>
<content:encoded><![CDATA[<p align="justify" class="texto"> <img border="0" width="316" src="http://sadadigital.files.wordpress.com/2008/01/emilio-gomezlavoz.jpg" height="454" /></p>
<p align="justify" class="texto">Acogiéndose a los preceptos de la Ley Orgánica 2/1984 de 26 de marzo, reguladora del derecho a la rectificación, el concejal del PDSP, que fue edil de Urbanismo hasta el año 2007 José Emilio Gómez López ha enviado un escrito a través del que niega haberse enzarzado, el pasado jueves, en una pelea con un constructor de la localidad, como recogió La Voz al día siguiente.</p>
<p align="justify" class="texto">José Emilio Gómez dice que «no es cierta la noticia relativa a que un constructor de Sada se pelea con el ex concejal de Urbanismo». «Tampoco es cierto -asegura- que en las inmediaciones del edificio municipal y ante el pub Legend se enzarzara en una pelea con el constructor sadense Gervasio Carballo Brasa». «Y tampoco responde a la verdad -subraya- que la Guardia Civil tuviese que personarse en la zona para poner orden, tomar declaraciones a ambas partes y que al menos uno terminó en el cuartel».</p>
<p align="justify" class="texto">Fuente: La Voz de Galicia</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Icon Constructor (diseño de íconos)]]></title>
<link>http://chanfainatv.wordpress.com/?p=31</link>
<pubDate>Thu, 31 Jan 2008 15:48:54 +0000</pubDate>
<dc:creator>chanfainatv</dc:creator>
<guid>http://chanfainatv.wordpress.com/?p=31</guid>
<description><![CDATA[


Con este programa podrás diseñar tus propios iconos para Windows a partir de prácticamente cu]]></description>
<content:encoded><![CDATA[<p align="center"><a href="http://chanfainatv.wordpress.com/files/2008/01/main_dlg_01_small.jpg" title="main_dlg_01_small.jpg"></p>
<div style="text-align:center;"><img src="http://chanfainatv.wordpress.com/files/2008/01/main_dlg_01_small.jpg" alt="main_dlg_01_small.jpg" /></div>
<p></a></p>
<p>Con este programa podrás diseñar tus propios iconos para Windows a partir de prácticamente cualquier archivo de imagen.Una de las ventajas de este programa es que te permite crear iconos de alta calidad ya que incorpora, y trabaja en  alpha chanel lo que te permite diseñar iconos con fondo transparente o semi transparente.</p>
<p>Es muy sencillo de utilizar y viene con bastantes plantillas</p>
<p>enlace: <a href="http://rapidshare.com/files/88092036/IconConstructor.rar.html">http://rapidshare.com/files/88092036/IconConstructor.rar.html</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Un constructor de Sada se pelea con el ex concejal de Urbanismo]]></title>
<link>http://sadadigital.wordpress.com/?p=3822</link>
<pubDate>Sun, 27 Jan 2008 07:53:51 +0000</pubDate>
<dc:creator>sadadigital</dc:creator>
<guid>http://sadadigital.wordpress.com/?p=3822</guid>
<description><![CDATA[El enfrentamiento se produjo el pasado jueves, cuando el edil abandonó el pleno

El pasado jueves e]]></description>
<content:encoded><![CDATA[<p align="justify"><a target="_blank" href="http://sadadigital.wordpress.com/2008/01/24/el-partido-creado-por-el-ex-alcalde-de-sada-negocia-reingresar-en-el-pp/"><strong>El enfrentamiento se produjo el pasado jueves, cuando el edil abandonó el pleno</strong></a></p>
<p align="justify"><a href="http://sadadigital.wordpress.com/files/2008/01/gervasio-brasa-la-voz.jpg" title="gervasio-brasa-la-voz.jpg"><img width="242" src="http://sadadigital.wordpress.com/files/2008/01/gervasio-brasa-la-voz.jpg" alt="gervasio-brasa-la-voz.jpg" height="368" style="width:226px;height:312px;" /></a><a href="http://sadadigital.wordpress.com/files/2008/01/emiliogomezlavoz.jpg" title="emiliogomezlavoz.jpg"><img width="254" src="http://sadadigital.wordpress.com/files/2008/01/emiliogomezlavoz.jpg" alt="emiliogomezlavoz.jpg" height="366" style="width:189px;height:311px;" /></a></p>
<p align="justify" class="texto"><strong><em><a target="_blank" href="http://sadadigital.wordpress.com/2008/01/25/el-pleno-de-sada-aprueba-la-retirada-de-las-menciones-honorificas-a-franco/">El pasado jueves el ex edil de Urbanismo de Sada se ausentó del pleno en torno a las diez y veinte de la mañana, justo antes de que comenzase el último punto del día.</a> Ya en la calle, en las inmediaciones del edificio municipal y ante el pub Legend, se enzarzó en una pelea con el constructor sadense Gervasio Carballo Brasa</em></strong></p>
<p align="justify" class="texto">La Guardia Civil tuvo que personarse en la zona para poner orden, tomar declaraciones a ambas partes y al menos uno terminó en el cuartel. Fuentes policiales revelaron que no es la primera vez en las últimas semanas que tienen noticias sobre enfrentamientos entre Emilio Gómez y Gervasio Carballo. Los dos protagonistas del suceso son vecinos y muy conocidos en Sada. De hecho, hasta hace unos meses era notoria su estrecha relación. Gervasio Carballo tiene una empresa de construcción, Gervasio Carballo Brasa e Hijos, y un negocio de ferretería en el centro de Sada. Mientras que Emilio Gómez fue un estrecho colaborador del ex regidor, <a href="http://sadadigital.wordpress.com/2008/01/24/el-partido-creado-por-el-ex-alcalde-de-sada-negocia-reingresar-en-el-pp/">Ramón Rodríguez Ares</a>, junto al que durante varios mandatos fue teniente de alcalde y responsable de Urbanismo.</p>
<p align="justify" class="texto">Fuente: La Voz de  Galicia</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[C# Wishlist: Post-Constructor Method]]></title>
<link>http://xidey.wordpress.com/2008/01/09/c-wishlist-post-constructor-method/</link>
<pubDate>Wed, 09 Jan 2008 22:19:38 +0000</pubDate>
<dc:creator>Anthony Stevens</dc:creator>
<guid>http://xidey.wordpress.com/2008/01/09/c-wishlist-post-constructor-method/</guid>
<description><![CDATA[I would love it if C# had a predefined method that would be guaranteed to be called after every cons]]></description>
<content:encoded><![CDATA[<p>I would love it if C# had a predefined method that would be guaranteed to be called after every constructor is done firing.  I have some checking code that I need to call, but depending on which constructors are called, it could need to be fired in a few different places.  If I had a PostConstructor() method or something, I could centralize the checking code there.</p>
<p>It would also be cool if you could provide a method that would be called before or after every method call, like the SetUp() and TearDown() special methods in NUnit, but without all the reflection overhead at runtime.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Object-Oriented Design: The Curse of Choice]]></title>
<link>http://xidey.wordpress.com/2008/01/06/object-oriented-design-the-curse-of-choice/</link>
<pubDate>Sun, 06 Jan 2008 16:13:29 +0000</pubDate>
<dc:creator>Anthony Stevens</dc:creator>
<guid>http://xidey.wordpress.com/2008/01/06/object-oriented-design-the-curse-of-choice/</guid>
<description><![CDATA[I love OO because there are so many ways to accomplish the same thing.  I hate OO because there are ]]></description>
<content:encoded><![CDATA[<p>I love OO because there are so many ways to accomplish the same thing.  I hate OO because there are so many ways to accomplish the same thing.   But I love to noodle through the issues.</p>
<p>I have a simple one that everyone has run into: let's call it the <b>Constructor vs. Property vs. Method Debate</b>.</p>
<p>Suppose that, given a URL, I want to <a href="http://xidey.wordpress.com/2007/12/29/snapper-back-of-the-envelope-design-for-command-line-version/">save a snapshot image of that URL to a named file</a>.  There are (I think) four OO ways to accomplish that.  Let's assume the worker class is called "Snapshotter".</p>
<p><b>OPTION 1: CONSTRUCTOR ONLY</b></p>
<p><code>Snapshotter s = new Snapshotter("http://foo.com", "c:\foo.jpg");</code></p>
<p><b>OPTION 2: CONSTRUCTOR + METHOD</b></p>
<p><code>Snapshotter s = new Snapshotter("http://foo.com", "c:\foo.jpg");<br />
s.TakeSnapshot();</code></p>
<p><b>OPTION 3: PROPERTIES  + METHOD</b></p>
<p><code>Snapshotter s = new Snapshotter();<br />
s.Url = "http://foo.com";<br />
s.File = "c:\foo.jpg";<br />
s.TakeSnapshot();<br />
</code></p>
<p><b>OPTION 4: METHOD</b></p>
<p><code>Snapshotter s = new Snapshotter();<br />
s.TakeSnapshot("http://foo.com", "c:\foo.jpg");</code></p>
<p>So which is best?  Or, to put it a better way, are there advantages or disadvantages to any of the methods?  XP would probably opt for #1 under the principle <a href="http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html">Do the Simplest Thing that Could Possibly Work</a>.  But is that really the best long-term design?  I have a hunch that overloading constructors as substitutes for methods can get unwieldy pretty fast, and require refactoring.  Isn't that what software engineers are paid for -- to prescribe designs/architectures based on our experience?  However, with <a href="http://testdriven.net/overview.aspx">unit testing and code coverage</a> providing peace of mind, why not?</p>
<p>I also have a hunch that OO purists would gasp at #1 as not being "sufficiently OO", because you're not explicitly sending a message to the object to tell it to do something.</p>
<p>Option 4 seems the next simplest, but here the thought that runs through my head is: why do you need to instantiate an object at all?  Why not just use a static class method:</p>
<p><code>// static method replacement for #4<br />
Snapshotter.TakeSnapshot("http://foo.com", "c:\foo.jpg");</code></p>
<p>This seems easy in the XP sense, if not really OO (even to my way of thinking).</p>
<p>The next thing to consider is: what is this object's state?  Does it have any?  In the previous example, you can see I coded away any notion of a stateful object.</p>
<p>Consider other things you might want to do with this Snapshotter:</p>
<ul>
<li>Send the snapshot via e-mail</li>
<li>Save it to cache so you don't have to retake the snapshot later</li>
<li>Compare the new snapshot against previously cached versions of the same URL</li>
<li>Provide the caller with options to get the snapshot as a binary stream, instead of saving to a target file</li>
</ul>
<p>... all pretty reasonable options, depending on what you might be trying to accomplish.  Now, the design becomes a bit more obvious:</p>
<p><code>Snapshotter s = new Snapshotter("http://foo.com");<br />
s.SaveToFile("c:\foo.jpg");<br />
s.SendTo("anthonys@xidey.com");<br />
DiffInfo d = s.Diff();<br />
Stream s = s.GetStream();</code></p>
<p>Now we see that the state of the object revolves around the URL, and that our original file-saving requirement is just one of many possible actions / methods that we could invoke on this stateful object.  Thus, our original debate comes down to a victory for the <b>OPTION 2: CONSTRUCTOR + METHOD</b> option, albeit with some changes to what we're passing, based on the statefulness of our object.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[img_0677.JPG]]></title>
<link>http://workwest.wordpress.com/files/2006/11/img_0677.JPG</link>
<pubDate>Sun, 19 Nov 2006 18:39:11 +0000</pubDate>
<dc:creator>workwest</dc:creator>
<guid>http://workwest.wordpress.com/files/2006/11/img_0677.JPG</guid>
<description><![CDATA[Missing Attachment

]]></description>
<content:encoded><![CDATA[<br />
]]></content:encoded>
</item>
<item>
<title><![CDATA[It is just AMD(OMG)!]]></title>
<link>http://nwitha.wordpress.com/?p=562</link>
<pubDate>Thu, 29 May 2008 17:36:57 +0000</pubDate>
<dc:creator>techinieks</dc:creator>
<guid>http://nwitha.wordpress.com/?p=562</guid>
<description><![CDATA[Ko tik tu nevari izdarīt, ja tev ir izdoma. Liekās, ka tā ir tikai stulba spēlēšanās? Pamēģ]]></description>
<content:encoded><![CDATA[<p>Ko tik tu nevari izdarīt, ja tev ir izdoma. Liekās, ka tā ir tikai stulba spēlēšanās? Pamēģini uztaisīt k-ko šitādu!<br />
<!--more--><br />
<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/y5cCtnDQhhc'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/y5cCtnDQhhc&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Tutorial C++ : Kelas part I]]></title>
<link>http://johanesgrey.wordpress.com/?p=63</link>
<pubDate>Wed, 02 Apr 2008 16:55:06 +0000</pubDate>
<dc:creator>johanesgrey</dc:creator>
<guid>http://johanesgrey.wordpress.com/?p=63</guid>
<description><![CDATA[Kelas
Sebuah kelas merupakan pengembangan konsep dari struktur data: tidak hanya data, tapi juga dap]]></description>
<content:encoded><![CDATA[<p><b>Kelas</b></p>
<p>Sebuah <b>kelas</b> merupakan pengembangan konsep dari struktur data: tidak hanya data, tapi juga dapat menangani data dan fungsi.</p>
<p>Sebuah <b>objek</b> merupakan perwakilan dari sebuah kelas. Dalam perbandingan dengan variabel, sebuah kelas akan menjadi tipe data dan objeknya menjadi variabel.</p>
<p>Kelas dideklarasi menggunakan kata kunci <b>class</b>, dengan format berikut:</p>
<p><b>class</b> class_name</p>
<p>{</p>
<p>access_specifier_1:</p>
<p>member1;</p>
<p>access_specifier_2:</p>
<p>member2;</p>
<p>....</p>
<p>} object_names;</p>
<p>dimana <i>class_name</i> merupakan identifier sah untuk kelas, <i>object_names</i> merupakan daftar nama opsional dari objek pada kelas ini. Isi deklarasi bisa mencakup anggota yang meliputi deklarasi data atau fungsi, dan "<i>optionally access specifiers</i>".</p>
<p>Seluruhnya sangat mirip dengan deklarasi pada struktur data, kecuali bahwa kita bisa memasukkan fungsi dan anggota, tapi juga hal baru ini disebut access specifier. Access specifier merupakan satu dari tiga kata kunci berikut: <b>private, public, atau protected</b>. Specifiers ini mengatur hak akses dimana anggota dibutuhkan:</p>
<ul>
<li>anggota 	<b>private</b>, dapat diakses hanya oleh anggota pada kelas yang sama dan 	friends mereka</li>
<li>anggota 	<b>protected</b> bisa diakses oelh anggota dari kelas yang sama dan friends 	mereka, namun juga dari anggota turunan kelas mereka</li>
<li>anggota 	<b>public</b> dapat diakses dari mana saja dimana objek terlihat.</li>
</ul>
<p>Secara default, semua anggota kelas dideklarasi dengan kata kunci <b>class</b> memiliki akses private untuk setiap anggotanya. Jadi, setiap anggota yang dideklarasi sebelum specifier kelas lain memiliki akses private. Contohnya:</p>
<table border="2" cellpadding="4" cellspacing="0" width="260">
<tr>
<td valign="top" width="248">class CRectangle {<br />
int x, y;<br />
public:<br />
void set_values (int,int);<br />
int area (void);<br />
} rect;</td>
</tr>
</table>
<p>Deklarasi sebuah kelas(yakni tipe) <i>CREctangle</i> dan sebuah objek yang dinamakan rect.Kelas ini berisi empat anggota: dua anggota data bertipe int(anggota x dan y) dengan akses private(secara default) dan dua anggota fungsi dengan akses publik: <i>set_value()</i> dan<i> area()</i>, di mana sekarang baru disertakan deklarasi, belum definisinya.</p>
<p>Perhatikan perbedaan antara nama kelas dan nama objek: dalam contoh sebelumnya, <i>Crectangle</i> adalah nama kelas, sedangkan <i>rect</i> adalah nama objek dengan tipe <i>Crectangle</i>. Hal ini sama dengan hubungan int dan a pada deklarasi di bawah ini:</p>
<table border="2" cellpadding="4" cellspacing="0" width="58">
<tr>
<td valign="top" width="46">int a;</td>
</tr>
</table>
<p>Dimana <i>int</i> merupakan nama tipe(kelas) dan<i> a</i> merupakan nama variabel(objek).<br />
Setelah deklarasi sebelumnya yakni <i>Crectangle</i> dan <i>rect</i>, kita bisa mengacu dalam isi program untuk anggota publik dari objek <i>rect</i> seperti mereka fungsi dan variabel normal, dengan menambahkan nama objek diikuti dengan dot(.) dan nama anggota. Selayaknya yang kita lakulan pada struktur data sebelumnya. Contohnya:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%">rect.set_values(3,4);<br />
myarea=rect.area();</td>
</tr>
</table>
<p>Anggota <i>rect</i> yang tidak dapat diakses dari isi program kita diluar kelas adalah <i>x</i> dan <i>y</i>, karena mereka dalam akses private dan mereka hanya bisa diacu dari anggota lain pada kelas yang sama.</p>
<p>Ini merupakan contoh lengkap dari kelas <i>CRectangle</i>:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr valign="top">
<td width="50%">// classes example<br />
#include &#60;iostream&#62;<br />
using namespace std;</p>
<p>class CRectangle {<br />
int x, y;<br />
public:<br />
void set_values (int,int);<br />
int area () {return (x*y);}<br />
};</p>
<p>void CRectangle::set_values (int a, int b) {<br />
x = a;<br />
y = b;<br />
}</p>
<p>int main () {<br />
CRectangle rect;<br />
rect.set_values (3,4);<br />
cout &#60;&#60; "area: " &#60;&#60; rect.area();<br />
return 0;<br />
}</td>
<td width="50%">Area: 12</td>
</tr>
</table>
<p>Hal baru yang paling penting dalam koding adalah operator lingkup(::, titik dua) yang mencakup definisi <i>set_values()</i>. Ini digunakan untuk mendefinisi anggota kelas dari luar definisi kelas itu sendiri.</p>
<p>Anda dapat memperhatikan bahwa definisi dari fungsi anggota <i>area() </i>telah meliputi langsing definisi kelas <i>CRectangle</i> yang diberikan secara sederhana, dimana <i>set_value()</i> hanya memiliki prototype yang dideklarasi di dalam kelas,namun definisi ini berada diluarnya. Dalan deklarasi di luar, kita harus menggunakan operator scope(::) untuk menjelaskan bahwa kita mendefinisi sebuah fungsi yang merupakan anggota dari kelas <i>Crectangle</i> dan bukan fungsi global biasa.</p>
<p>Operator Scope(::) menjelaskan kelas dimana anggota tersebut dideklarasi, memperbolehkan lingkup properti yang sama seakan definisi fungsi disertakan dalan definisi kelas. Contohnya, dalam fungsi <i>set_values()</i> dari koding sebelumnya.. kita bisa menggunakan variabel <i>x</i> dan <i>y</i>, yang merupakan anggota privat kelas <i>Crectangle,</i> yang berarti mereka hanya dapat diakses oleh anggota lain dari kelas tersebut.</p>
<p>Perbedaan antara definisi fungsi anggota kelas meliputi kelas tersebut atau mencakup prototype dan kemudian definisinya, adalah dalan kasus pertama, fungsi akan secara otomatis dipertimbangkan dalam fungsi anggota <i>inline</i> oleh compiler, dan kasus keduam merupakan fungsi anggota normal<i>(not-inline) </i>, dimana dalam kenyataannya, tidak ada perbedaan dalam <i>behavior.</i></p>
<p>Anggota x dan y memiliki hak akses <i>private</i>(ingat bahwa jika tidak ada yang dikatakan, semua anggota kelas didefinisi dengan hak akses <i>private</i>). Dengan deklarasi <i>private</i>, kita menolak mengakses mereka dari semua tempat diluar kelas. Ini membuat masalah, sebah kita telah mendefinisikan fungsi anggota untuk mengatur nilai anggota dalan objek: fungsi anggota <i>set_values();</i>. Untuk itu, sisanya dari program tidakmembutuhkan akses langsung untuk mereka. Mungkin dalam contoh singkat, ini sulit untuk melihat kegunaan melindungi dua variabel tersebut, namun dalan proyek lebih besar, akan sangat penting bahwa nilai tidak dapat dimodifikasi dalam cara yang tidak diharapkan( tidak diharapkan dari sudut pandang objek).</p>
<p>satu keuntungan besa dari kelas bahwa, dalam tipe yang lain, kita dapat mendefinisi beberapa objek padanya. Misalnya, dalan contoh sebelumnya, pada kelas Crectangle, ita dapat mendeklarasi object rectb sebagai tambahaan pada objek rect:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr valign="top">
<td height="443" width="50%">// example: one class, two objects<br />
#include &#60;iostream&#62;<br />
using namespace std;</p>
<p>class CRectangle {<br />
int x, y;<br />
public:<br />
void set_values (int,int);<br />
int area () {return (x*y);}<br />
};</p>
<p>void CRectangle::set_values (int a, int b) {<br />
x = a;<br />
y = b;<br />
}</p>
<p>int main () {<br />
CRectangle rect, rectb;<br />
rect.set_values (3,4);<br />
rectb.set_values (5,6);<br />
cout &#60;&#60; "rect area: " &#60;&#60; rect.area() &#60;&#60; endl;<br />
cout &#60;&#60; "rectb area: " &#60;&#60; rectb.area() &#60;&#60; endl;<br />
return 0;<br />
}</td>
<td width="50%">rect area: 12<br />
rectb area: 30</td>
</tr>
</table>
<p>Dalam kasus nyata, kelas(tipe objek) yakni Crectangle, memiliki dua objek instan : rect dan rectb. Setiapnya memiliki anggota dan fungsi variabel/</p>
<p>perhatikan bahwa memanggil rect.area() tidak memberikan hasil yang sama dengan memanggil rectb.area(). Ini dikarenakan setiap objek kelas Crectangle memiliki variabel x dan y tersendiri, dan hal yang sama terjadi pada anggota fungsi set_value() dan area() yang setiapnya menggunakan variabel objeknya untuk beroperasi.</p>
<p>Ini merupakan konsep dasar dari pemrograman berorientasi objek : data dan fungsi merupakan anggota objek. Kita tidak mengg lagi variabel global yang dilewatkan dari satu fungsi ke fungsi lain sebagai parameter, melainkan kita menangani objek yang memiliki data dan fungsi tersendiri sebagai anggotanya. Perhatikan bahawa kita tidak harus selalum memberikan parameter setiap kali memanggil rect.area atau rectb.area. Fungsi anggota tersebut secara langsung menggunakan anggota data dari objek rect dan rectb.</p>
<p><b>Konstraktor dan Destrakor</b></p>
<p>Objek secara umum membutuhkan inisialisasi variabel selama proses pembuatan untuk menjadi operativ dan mencegah mengembalikan nilai yang tidak diharapkan selama dieksekusi. Contohnya, apa yang terjadi jika dalam contoh sebelumnya,kita memanggil fungsi anggota area() sebeum memanggil funsi set_values()? Mungikn ktia akan mendapatkan hasil yang tidak pasti karena anggota x dan y belum diberikan sebuah nilai.</p>
<p>Untukmencegah itu maka sebuah kelas akan disertakan fungsi khusus yakni constraktor, yang secara otomatis dipanggil ketika sebuah objek dari kelas dibuat. Fungsi konstraktor harus memiliki nama yang sama dengan kelas dan tidak dapat mengembalikan sebuah tipe data, tidak juga void.</p>
<p>Kita akan menunjukkan dalam contoh sebelumnya:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr valign="top">
<td width="50%">// example: class constructor<br />
#include &#60;iostream&#62;<br />
using namespace std;</p>
<p>class CRectangle {<br />
int width, height;<br />
public:<br />
CRectangle (int,int);<br />
int area () {return (width*height);}<br />
};</p>
<p>CRectangle::CRectangle (int a, int b) {<br />
width = a;<br />
height = b;<br />
}</p>
<p>int main () {<br />
CRectangle rect (3,4);<br />
CRectangle rectb (5,6);<br />
cout &#60;&#60; "rect area: " &#60;&#60; rect.area() &#60;&#60; endl;<br />
cout &#60;&#60; "rectb area: " &#60;&#60; rectb.area() &#60;&#60; endl;<br />
return 0;<br />
}</td>
<td width="50%">rect area: 12<br />
rectb area: 30</td>
</tr>
</table>
<p>Seperti yang dapat dilihat, hasil dari contoh tersebut sama dengan sebelumnya. Namun kita telah memindahkan fugsi anggota set_values(), dan telah memasukkan sebuah konstraktor yang menampilkan aksi yang sama: ia menginisialisasi nilai x dan y dengan parameter yang diberikan padanya.</p>
<p>Perhatikan bagaimana argumen dipassing ke constraktor pada saat objek dibuat.</p>
<table border="2" cellpadding="4" cellspacing="0" width="220">
<tr>
<td valign="top" width="208">CRectangle rect (3,4);<br />
CRectangle rectb (5,6);</td>
</tr>
</table>
<p>Konstraktor tidak bisa dipanggil langsung seperti fungsi anggota umum. Mereka hanya bisa dijalankan ketika sebuah objek baru pada kelas dibuat.</p>
<p>Anda dapat melihat bagaimana deklarasi prototye konstraktor(dalam kelas) dan definisi konstraktor tidak mengembalikan nilai, bahkan void pun tidak.</p>
<p>Destraktor memenuhi fungsi sebaliknya. Ini akan secara otomatis dipanggil ketika sebuah objek dihancurkan, karena lingkup keberadaannya telah selesai(misalnya, ketika kita mendefinisi sebagai objek lokal dalam sebuah fungsi dan akhir fungsi) atau karena ini merupakan objek yang dinamik ditugasi, dan ini merilis menggunakan operator delete.</p>
<p>Destraktor harus memiliki nama yang sama dengan kelas, namun diawali dengan tanda ~ dan tidak boleh mengembalikan nilai.</p>
<p>Penggunaan destraktor secara khusus cocok ketiak sebuah objek menjalankan memori dinamis selama jalannya dan kemudian dihancurkan ketika kita ingin melepaskan memori objek yang telah dialokasi.</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td height="534" width="50%">// example on constructors and destructors<br />
#include &#60;iostream&#62;<br />
using namespace std;</p>
<p>class CRectangle {<br />
int *width, *height;<br />
public:<br />
CRectangle (int,int);<br />
~CRectangle ();<br />
int area () {return (*width * *height);}<br />
};</p>
<p>CRectangle::CRectangle (int a, int b) {<br />
width = new int;<br />
height = new int;<br />
*width = a;<br />
*height = b;<br />
}</p>
<p>CRectangle::~CRectangle () {<br />
delete width;<br />
delete height;<br />
}</p>
<p>int main () {<br />
CRectangle rect (3,4), rectb (5,6);<br />
cout &#60;&#60; "rect area: " &#60;&#60; rect.area() &#60;&#60; endl;<br />
cout &#60;&#60; "rectb area: " &#60;&#60; rectb.area() &#60;&#60; endl;<br />
return 0;<br />
}</td>
<td valign="top" width="50%">rect area: 12<br />
rectb area: 30</td>
</tr>
</table>
<p><b>Overloading Constructor</b></p>
<p>seperti fungsi lainnya, sebuah konstraktor juga bisa dilebihkan dengan lebihd ari satu fungsi yang memiliki nama yang sama namun tipe dan jumlah parameter yang berbeda. Ingat bahwa pada fungsi overloading, kompiler akan memanggil satu dari parameter yang cocok dengan argumen yang digunakan pada pemanggilan fungsi. Pada kasus konstraktor, yang secara otomatis dipanggil ketika objek dibuat, satu dijalankan adalah yang paling cocok dengan argumen yang dipassing pada deklarasi objek:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr valign="top">
<td width="50%">// overloading class constructors<br />
#include &#60;iostream&#62;<br />
using namespace std;</p>
<p>class CRectangle {<br />
int width, height;<br />
public:<br />
CRectangle ();<br />
CRectangle (int,int);<br />
int area (void) {return (width*height);}<br />
};</p>
<p>CRectangle::CRectangle () {<br />
width = 5;<br />
height = 5;<br />
}</p>
<p>CRectangle::CRectangle (int a, int b) {<br />
width = a;<br />
height = b;<br />
}</p>
<p>int main () {<br />
CRectangle rect (3,4);<br />
CRectangle rectb;<br />
cout &#60;&#60; "rect area: " &#60;&#60; rect.area() &#60;&#60; endl;<br />
cout &#60;&#60; "rectb area: " &#60;&#60; rectb.area() &#60;&#60; endl;<br />
return 0;<br />
}</td>
<td width="50%">rect area: 12<br />
rectb area: 25</td>
</tr>
</table>
<p>Dalam kasus ini, rectb harus dideklarasi tanpa argumen, jadi ini telah diinisialisasi dengan konstraktor yang tidak memiliki parameter, dimana inisialisasi baik width dan height dengan nilai 5.</p>
<p>Penting: perhatikan bahwa jika kita deklarasi sebuah objek baru dan kita ingin menggunakannya sebagai konstraktor default( satu tanpa parameter) kita tidak perlu menambahkan kurung kurawal();</p>
<table border="2" cellpadding="4" cellspacing="0" width="262">
<tr>
<td valign="top" width="250">CRectangle rectb;   // right<br />
CRectangle rectb(); // wrong!</td>
</tr>
</table>
<p><b>Default Constructor</b><br />
Jika anda tidak mendeklarasi sebuah konstraktor pada definisi kelas, kompiler mengasumsikan kelas memiliki konstraktor default tanpa argumen. Jadi, setelah deklarasi kelas seperti berikut:</p>
<table border="2" cellpadding="4" cellspacing="0" width="444">
<tr>
<td height="73" valign="top" width="432">class CExample {<br />
public:<br />
int a,b,c;<br />
void multiply (int n, int m) { a=n; b=m; c=a*b; };<br />
};</td>
</tr>
</table>
<p>Kompiler berasumsi bahwa Cexample memiliki konstraktor default, jadi Anda akan mendeklarasi objek pada kelas ini dengan deklarasi singkat tanpa argumen apapun:</p>
<table border="2" cellpadding="4" cellspacing="0" width="129">
<tr>
<td valign="top" width="117">Cexample 			ex;</td>
</tr>
</table>
<p>Namun sesaat setelah dideklarasi denga konstraktor sendiri pada sebuah kelas, kompiler tidak menyediakan konstraktor default secara implisit. Jadi anda harus mendeklarasi semua objek dari kelas sesuai dengan prototype konstraktor yand didefinisi pada kelas:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td valign="top" width="100%">class CExample {<br />
public:<br />
int a,b,c;<br />
CExample (int n, int m) { a=n; b=m; };<br />
void multiply () { c=a*b; };<br />
};</td>
</tr>
</table>
<p>Kita telah mendeklarasi sebuah konstraktor yang meliputi dua parameter bertipe int. OKI deklarasi objek berikut akan benar:</p>
<table border="2" cellpadding="4" cellspacing="0" width="195">
<tr>
<td valign="top" width="183">CExample ex (2,3);</td>
</tr>
</table>
<p>tetapi</p>
<table border="2" cellpadding="4" cellspacing="0" width="195">
<tr>
<td valign="top" width="183">CExample ex;</td>
</tr>
</table>
<p>akan salah, karena kita telah mendeklarasi kelas memiliki konstraktor eksplisit, jadi menggantikan konstraktor default.</p>
<p>Tetapi kompiler tidak hanya membuat default konstraktor untuk anda jika anda tidak membuatnya sendiri. Kompiler akan menyediakan tiga fungsi anggota khusus bahwa jika tidak dideklarasi sendiri. Ini berupa copy constructor, copy assignment operator, dan default destructor.</p>
<p>Copy constructor dan copy assignment operator menggandakan semua data yang ada dalam objek lain pada anggota data di objek saat ini. Pada Cexample, konstraktor kopi dideklarasi secara implisit oleh compiler seperti berikut:</p>
<table border="2" cellpadding="4" cellspacing="0" width="311">
<tr>
<td bgcolor="#e6e6e6" valign="top" width="299">CExample::CExample (const CExample&#38; rv) {<br />
a=rv.a;  b=rv.b;  c=rv.c;<br />
}</td>
</tr>
</table>
<p>OKI, deklarasi objek berikut akan benar:</p>
<table border="2" cellpadding="4" cellspacing="0" width="531">
<tr>
<td bgcolor="#e6e6e6" valign="top" width="519">CExample ex (2,3);<br />
CExample ex2 (ex);   // copy constructor (data copied from ex)</td>
</tr>
</table>
<p><b>Pointers To Classes</b></p>
<p>ini secara sempurna sah untuk membuat pointer yang menunjuk kelas. Secara sederhana kita menyadari bahwa sekali dideklarasi, sebuah kelas menjadi bertipe valid, jadi kita bisa menggunakan nama kelas sebagai tipe dari pointer. Misalnya:</p>
<table border="2" cellpadding="4" cellspacing="0" width="195">
<tr>
<td valign="top" width="183">Crectangle * prect;</td>
</tr>
</table>
<p>Merupakan sebuah pointer pada objek kelas Crectangle/</p>
<p>Seperti terjadi pada struktur data, untuk menunjuk langsung anggota dari objek yang ditunjuk oleh pointer, kita bisa menggunakan operator pana(-&#62;). Ini merupakan contoh dengan beberapa kombinasi:</p>
<table border="2" cellpadding="4" cellspacing="0" width="100%">
<tr valign="top">
<td width="50%">// pointer to classes example<br />
#include &#60;iostream&#62;<br />
using namespace std;</p>
<p>class CRectangle {<br />
int width, height;<br />
public:<br />
void set_values (int, int);<br />
int area (void) {return (width * height);}<br />
};</p>
<p>void CRectangle::set_values (int a, int b) {<br />
width = a;<br />
height = b;<br />
}</p>
<p>int main () {<br />
CRectangle a, *b, *c;<br />
CRectangle * d = new CRectangle[2];<br />
b= new CRectangle;<br />
c= &#38;a;<br />
a.set_values (1,2);<br />
b-&#62;set_values (3,4);<br />
d-&#62;set_values (5,6);<br />
d[1].set_values (7,8);<br />
cout &#60;&#60; "a area: " &#60;&#60; a.area() &#60;&#60; endl;<br />
cout &#60;&#60; "*b area: " &#60;&#60; b-&#62;area() &#60;&#60; endl;<br />
cout &#60;&#60; "*c area: " &#60;&#60; c-&#62;area() &#60;&#60; endl;<br />
cout &#60;&#60; "d[0] area: " &#60;&#60; d[0].area() &#60;&#60; endl;<br />
cout &#60;&#60; "d[1] area: " &#60;&#60; d[1].area() &#60;&#60; endl;<br />
delete[] d;<br />
delete b;<br />
return 0;<br />
}</td>
<td width="50%">rect area: 12<br />
rectb area: 25</p>
<p>a area: 2<br />
*b area: 12<br />
*c area: 2<br />
d[0] area: 30<br />
d[1] area: 56</td>
</tr>
</table>
<p>Berikut, ringkasan bagaimana membaca beberapa pointer dah operator kelas yang muncul dalam contoh sebelumnya:</p>
<p>Pastikan bahwa Anda mengerti logika dalam ekspresi-ekspresi sebelumnya sebelum memulai bagian berikut. Jika Andar ragu, baca kembali baigan ini dan/atau konsultasi pada bagian sebelumnya soal pointer dan struktur data.</p>
<p><b>Classes defined with struct and Union</b></p>
<p>Kelas dapat didefinisi tidak hanya dengan kata kunci class tapi juga struct dan union.</p>
<p>Konsep kelas dan struktur data sama bahwa kedua kata kunci(struct dan class) bisa digunakand alan C++ untuk deklarasi kelas. Perbedaannya hanyalah anggota kelas dideklarasi dengan kata kuni struct memiliki hak akses public secara default, sedangkan pada kelas dideklarasi secara default dengan hak akses private. Untutuk persoalan lain, keduanya sama.</p>
<p>Konsep union berbeda dengan kelas dan struct, karena union hanya menyimpan satu data anggota pada waktunya, walaupun begitu mereka juga merupakan kelas, dan bisa jadi menangani anggota fungsi. Secara default hak akses dalam kelas union adalah public.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[c.m.m.d.c. de Romania]]></title>
<link>http://ciobanulbucur.wordpress.com/?p=11</link>
<pubDate>Fri, 14 Mar 2008 11:27:03 +0000</pubDate>
<dc:creator>ciobanulbucur</dc:creator>
<guid>http://ciobanulbucur.wordpress.com/?p=11</guid>
<description><![CDATA[Bucuresti, Romania – Vineri, 14 Martie 2008
Romania romanilor, rromi, tigani, lasa-ma sa te las, l]]></description>
<content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size:10pt;font-family:'Trebuchet MS';">Bucuresti, Romania – Vineri, 14 Martie 2008</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'Trebuchet MS';">Romania romanilor, rromi, tigani, lasa-ma sa te las, lasii, istorie, trend, bursa, cursa, frizer, betonier, constructor, bere, muncitor, popor, circ, afacerist, impozit, institutie, spaga, coruptie, ospitalitate, mizerie, pragmatism, juvenil, Desteapta-te Romane, dormi linistit FNI vegheaza, varza, politie, perchezitie, confisca, ura, gura, mancare, bani, motorina de la CFR, lemnul din padure, descurca-te, pesches, conductor, nas, cas, piatra de la drumuri, autostrada, lada, 1330, Q7, E330, benzoat de sodium, lapte, miere, diabet, anestezie, simpatie, birocratie, cuie, relatie, felatie, post, scaun, hartie igienica, succes, ape tulburi, navigatie, net, bar, avocat, rahat, vigilenta, KGB, Miron Cosma, ce e e ce nu e nu e asta e, pod de flori peste Prut, starea natiunii, Jucu are un singur cal, bordura, meserie, frate, revolutie, lovitura, box, fotbal, arbitru, atentie, Gigi, Miky, ai, dai, spaga, noroc, bafta, concurenta, SRI, loialitate, libertate, fum, carte, economie, piata Matache, da-i un leu, Ateneu, muzica, poezie, bairam, autostopiste, speculatie, BVB-isti, cash, contabilitate, carte, almanahe, care este, capra, pesti, gemeni, Urania, ghioc, Guru, echilibrare, stabilitate, noi sa fim sanatosi, licitatie, cunostinte, temeinicie, vise, criza, sistem, oligofren, noi suntem romani, de ce, constitutie, politica, pute, miros, sanatate, cariera, vila, securist, informator, binefacator, uninominal, Decebal, Tepes, Basescu, escu, Costel a declarat ca isi doreste sa ramana definitiv in Spania ca un semn de recunostiinta pentru tara care i-a oferit atat de mult, autorizatie, senzatie, morala, golanie, cuvânt, dat, cap, spart, onoare, savoare, rar, istet, ireal, tv, Esca, Diaconescu, Hrancu, manipulare, grandoare, snobism, fite, decadenta, ciob, oala, sparta, goala, olimpiada, sa ne avem ca fratii, Camataru, Isarescu, dobanda, comision, procent, gras, McDonalds te-asteapta mereu, E-uri, teapa, fitness, strip-tease, cash, Brancusi, imagine, muta-te, vest, casa, masa, servici, job, slujba, inmormantare, optimist, pesimist, pupincurist, viata e frumoasa, si realitatea e complexa, meandre, elucubratie</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Returning null from a class constructor?!]]></title>
<link>http://seattlesoftware.wordpress.com/?p=22</link>
<pubDate>Wed, 05 Mar 2008 23:03:23 +0000</pubDate>
<dc:creator>Chris O.</dc:creator>
<guid>http://seattlesoftware.wordpress.com/?p=22</guid>
<description><![CDATA[Just as an exercise, I thought I&#8217;d examine common creation patterns in C# and how operator ove]]></description>
<content:encoded><![CDATA[<p>Just as an exercise, I thought I'd examine common creation patterns in C# and how operator overloading can expand these.</p>
<p>Typically, if the parameters passed into a class constructor are not valid and thus cannot create an instance of itself, an Exception is thrown. ArgumentNullException is most common when a parameter is null and shouldn't be. Also common are ArgumentExceptions and FormatExceptions, especially when a constructor takes in a string that must abide by a syntax and doesn't.</p>
<p>[sourcecode language="csharp"]<br />
public class Expression<br />
{<br />
	public Expression(string pattern)<br />
	{<br />
		if (Expression.IsInvalidPattern(pattern))<br />
			throw new ArgumentException("pattern is invalid");<br />
		// Do something<br />
	}<br />
	public static bool IsInvalidPattern(string pattern)<br />
	{<br />
		// ...<br />
} // class Expression[/sourcecode]Then a try/catch block is used to catch Exceptions when instantiating the type:</p>
<p>[sourcecode language="csharp"]<br />
Expression expression;<br />
try<br />
{<br />
	expression = new Expression(pattern);<br />
}<br />
catch(ArgumentException)<br />
{<br />
	// Abort<br />
}[/sourcecode]An alternative would be to simply indicate that the instantiated class is in an invalid state:</p>
<p>[sourcecode language="csharp"]<br />
public class Expression<br />
{<br />
	public readonly bool IsInvalid = false;<br />
	public Expression(string pattern)<br />
	{<br />
		if (Expression.IsInvalidPattern(pattern))<br />
		{<br />
			this.IsInvalid = true;<br />
			return;<br />
		}<br />
		// Do something<br />
	}<br />
} // class Expression[/sourcecode]The invalid state is readonly so that it can only be set by the constructor, and is then checked for before performing any operations with the new Expression:</p>
<p>[sourcecode language="csharp"]<br />
Expression expression = new Expression(pattern);</p>
<p>if (expression.IsInvalid)<br />
	// Abort[/sourcecode]The Parse/TryParse pattern is also common. Instead of an Exception, readonly field, or get-only property, a static TryParse method is used that returns true or false, depending on whether the type can be created:</p>
<p>[sourcecode language="csharp"]<br />
public class Expression<br />
{<br />
	public static bool TryParse(string pattern,<br />
		out Expression expression)<br />
	{<br />
		if (Expression.IsInvalidPattern(pattern))<br />
		{<br />
			expression = null;<br />
			return false;<br />
		}<br />
		expression = new Expression(pattern);<br />
		return true;<br />
	}<br />
} // Class expression</p>
<p>[/sourcecode]TryParse() is then used as in this example:</p>
<p>[sourcecode language="csharp"]<br />
Expression expression;</p>
<p>if (!Expression.TryParse(pattern, out expression))<br />
	// Abort[/sourcecode]Another pattern which I haven't seen used allows an invalid object to emulate a null reference. There are better solutions than this, which is why it isn't used, but by using operator overloading, it can be accomplished nonetheless.</p>
<p>[sourcecode language="csharp"]<br />
public abstract class Errorable<br />
{<br />
	protected bool isError = false;</p>
<p>	public static bool operator ==(Errorable left, object right)<br />
	{<br />
		if (right == null)<br />
			return left.isError;<br />
		return (left.GetHashCode() == right.GetHashCode());<br />
	}</p>
<p>	public static bool operator !=(Errorable left, object right)<br />
	{<br />
		if (right == null)<br />
			return !left.isError;<br />
		return (left.GetHashCode() != right.GetHashCode());<br />
	}<br />
} // class Errorable</p>
<p>public class Expression : Errorable<br />
{<br />
	public Expression(string pattern)<br />
	{<br />
		if (Expression.IsInvalidPattern(pattern))<br />
		{<br />
			base.isError = true;<br />
			return;<br />
		}<br />
		// Do something<br />
    }<br />
} // class Expression[/sourcecode]An Expression can then be evaluated to test for null, although we know that "expression" really isn't a null referenced, which is one reason why this pattern is probably a bad idea.</p>
<p>[sourcecode language="csharp"]<br />
Expression expression = new Expression(pattern);</p>
<p>if (expression == null)<br />
	// Abort[/sourcecode]Lastly, overloading the ! operator allows us to evaluate an object as fasly, which other languages (e.g. JavaScript) do by default:</p>
<p>[sourcecode language="csharp"]<br />
public abstract class Errorable<br />
{<br />
	protected bool isError = false;</p>
<p>	public static bool operator !(Errorable errorable)<br />
	{<br />
		if (errorable == null &#124;&#124; errorable.isError);<br />
	}<br />
} // class Errorable</p>
<p>public class Expression : Errorable<br />
{<br />
	public Expression(string pattern)<br />
	{<br />
		if (Expression.IsInvalidPattern(pattern))<br />
		{<br />
			base.isError = true;<br />
			return;<br />
		}<br />
		// Do something<br />
    }<br />
} // class Expression[/sourcecode]To test an Expression as invalid, the ! operator is used:</p>
<p>[sourcecode language="csharp"]<br />
Expression expression = new Expression(pattern);</p>
<p>if (!expression)<br />
	// Abort[/sourcecode]The first two patterns are common, and probably why the last two aren't used. Generally, if there's already a good, well-established pattern, there's no reason to try something else. The alternative shown creation patterns were simply an exercise in operator overloading.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fseattlesoftware.wordpress.com%2f2008%2f03%2f05%2freturning-null-from-a-class-constructor%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fseattlesoftware.wordpress.com%2f2008%2f03%2f05%2freturning-null-from-a-class-constructor%2f" alt="kick it on DotNetKicks.com" border="0" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Os métodos Contructor e instanceof]]></title>
<link>http://wevertonn.wordpress.com/?p=100</link>
<pubDate>Wed, 27 Feb 2008 12:24:25 +0000</pubDate>
<dc:creator>Weverton Naves</dc:creator>
<guid>http://wevertonn.wordpress.com/?p=100</guid>
<description><![CDATA[Galera, serve muito para debug.. se você precisar saber se a sua variável possui um &#8220;constru]]></description>
<content:encoded><![CDATA[<p>Galera, serve muito para debug.. se você precisar saber se a sua variável possui um "construtor" ou foi criado a partir de uma classe, só utilizar o código abaixo:</p>
<address><font color="#3366ff">var my_str:String = new String("sven");<br />
trace(my_str.constructor == String); //exibe: true<br />
trace(my_str instanceof String); //exibe: true</font></address>
<p>No código acima, ele tem um constructor (:String) e é instancia da classe String ( new String()). Caso você não crie o valor a partir do new Classe, ele exibirá false na verificação instaceof, conforme abaixo:</p>
<address><font color="#3366ff">var my_str:String = "sven";<br />
trace(my_str.constructor == String); //exibe: true<br />
trace(my_str instanceof String); //exibe: false</font></address>
<p> Só pra conhecimento.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Introducação a Criptografia: One Time Pad]]></title>
<link>http://nunojob.wordpress.com/?p=253</link>
<pubDate>Tue, 19 Feb 2008 04:05:45 +0000</pubDate>
<dc:creator>nunojob</dc:creator>
<guid>http://nunojob.wordpress.com/?p=253</guid>
<description><![CDATA[Na criptografia clássica o One Time Pad é o mais famoso algoritmo de encriptação simétrica. O p]]></description>
<content:encoded><![CDATA[<p>Na criptografia clássica o <a href="http://en.wikipedia.org/wiki/One-time_pad" target="_blank">One Time Pad</a> é o mais famoso algoritmo de <a href="http://en.wikipedia.org/wiki/Symmetric_key" target="_blank">encriptação simétrica</a>. O principio é simples. Um simples <a href="http://en.wikipedia.org/wiki/XOR" target="_blank">XOR</a> entre a chave e o texto que quer deseja encriptar, sendo que a chave deve ser do mesmo tamanho que o texto e aleatória. Não compreenderam? Passo a explicar com uma história ilustrativa:</p>
<div style="text-align:center;"><img src="http://www.unix.org.ua/orelly/networking/puis/figs/puis_0604.gif" height="443" width="503" /></div>
<p>Imaginemos que a Alice convidou o Manel - o Bob foi fazer séries televisivas para crianças sobre construção civil - para sair mas assume que a Eva - provavelmente a ex-namorada - recebe todas as mensagens que são enviadas pelo Manel (mania da perseguição ou <a href="http://en.wikipedia.org/wiki/Kerckhoffs'_principle" target="_blank">principio de Kerckhoff </a>, eis a questão.). Então quando o convidou para sair disse ao Manel para usar como chave um simples '1' e para responder '0' caso não tivesse disponibilidade e '1' caso tivesse.</p>
<p>O Manel quer e responde sim e supõe-se que a Eva viu a mensagem resultante - 0. Como a chave foi gerada aleatoriamente pela Alice e é partilhada apenas pelos dois a Eva apenas sabe que existe a probabilidade de 50% de ele ter aceite, e outros 50% de ele ter recusado. Mas bem isto já ela sabia sem ter que recorrer a métodos de <a href="http://en.wikipedia.org/wiki/Cryptanalysis" target="_blank">cryptanalysis</a>.  E mesmo se as probabilidade forem diferentes a analise vai sempre mostrar apenas aquilo que já se sabia. A probabilidade de cada digito acontecer.</p>
<p>Esta conclusão é generalizável a um qualquer número de bits, como foi provado por <a href="http://en.wikipedia.org/wiki/Claude_Shannon" target="_blank">Claude Shannon</a>.</p>
<div style="text-align:center;"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/3/3d/Shannon.jpg/225px-Shannon.jpg" height="310" width="225" /></div>
<p>Parece perfeito mas é impraticavel. Como é obvio é preciso de uma chave do tamanho do texto que precisamos de enviar, todas as vezes. E essa chave tem que ser do conhecimento dos dois interlocutores. Se quiserem saber o que aconteceu depois para resolver o assunto vão ter que aprender muita criptografia pelo meio. Mas não é isto que me levou a escrever este artigo.</p>
<p>O que me levou a escrever este artigo foi uma pergunta - de um exame antigo de criptografia - na qual se perguntava como era possível que, num banco que conseguia usar este método (apesar de ser impossível, mas ok!), tivesse havido uma transacção na qual teria sido depositada 500 euros em vez de 100 que tinham sido ordenados pelo titular da conta. Teria forçosamente que existir um <a href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack" target="_blank">man-in-the-middle</a> mas como podia ele romper este algoritmo.</p>
<p>Apesar de não ter a certeza penso que a resposta seria: Ou o bandido tem a chave ou então ele sabe onde está o '1', fez XOR com um dos 256 dígitos disponíveis e teve a sorte do input ser aceite pela entidade bancária como 500 euros. Por outras palavras o OTP protege a confidencialidade mas não garante a preservação do seu conteúdo (acho que normalmente se refere a isto como integridade dos dados :&#124;).</p>
<p>Alguma ideia que não estas?</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[C++ Constructor Destructor]]></title>
<link>http://agraja.wordpress.com/?p=261</link>
<pubDate>Mon, 04 Feb 2008 06:14:01 +0000</pubDate>
<dc:creator>AG Raja</dc:creator>
<guid>http://agraja.wordpress.com/?p=261</guid>
<description><![CDATA[// constructor_destructor.cpp
// Author: A.G.Raja
// Website: agraja.wordpress.com
// Licence: GPL
#]]></description>
<content:encoded><![CDATA[<p>// constructor_destructor.cpp<br />
// Author: A.G.Raja<br />
// Website: agraja.wordpress.com<br />
// Licence: GPL</p>
<p>#include &#60;iostream&#62;<br />
using namespace std;<br />
class Employee{<br />
char *name;<br />
int age;<br />
double salary;<br />
public: Employee(); //Constructor<br />
void print();<br />
void setval(char *name, int age, double salary);<br />
char* getname() { return name; }<br />
int getage() { return age; }<br />
double getsalary() { return salary; }<br />
~Employee(); //Destructor<br />
};</p>
<p>Employee::Employee()<br />
{<br />
cout&#60;&#60;"Object Created"&#60;&#60;endl;<br />
name="fresher";<br />
age=23;<br />
salary=17500;<br />
}<br />
void Employee::print()<br />
{<br />
cout&#60;&#60; name&#60;&#60;"\t"&#60;&#60;age&#60;&#60;"\t"&#60;&#60;salary &#60;&#60;endl;<br />
}<br />
void Employee::setval(char *n, int a, double s)<br />
{<br />
name=n;<br />
age=a;<br />
salary=s;<br />
}</p>
<p>Employee::~Employee()<br />
{<br />
cout&#60;&#60;"Object Destroyed"&#60;&#60;endl;<br />
}</p>
<p>int main()<br />
{<br />
char *NAME;<br />
int AGE;<br />
double SALARY;<br />
//Employee E257 = {"raja",25,23519.78};<br />
Employee E257;<br />
cout&#60;&#60;"Print Default Values"&#60;&#60;endl;<br />
E257.print(); // Default Values<br />
E257.setval("raja",25,23768);<br />
cout&#60;&#60;"Print New Values"&#60;&#60;endl;<br />
E257.print(); // New values<br />
NAME=E257.getname();<br />
AGE=E257.getage();<br />
SALARY=E257.getsalary();<br />
cout&#60;&#60;NAME&#60;&#60;"\t"&#60;&#60;AGE&#60;&#60;"\t"&#60;&#60;SALARY&#60;&#60;endl;<br />
}<br />
// g++ constructor_destructor.cpp</p>
<p>Download here.</p>
<p><a href="http://agraja.wordpress.com/files/2008/02/constructor.doc" title="constructor.doc">constructor.doc</a></p>
<address> </address>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Pasos para Participar como Colaborador en Nuestro Blog de CasaComprar y su Audiencia]]></title>
<link>http://casacomprar.wordpress.com/2007/12/03/pasos-para-participar-como-colaborador-en-nuestro-blog-de-casacomprar-y-su-audiencia/</link>
<pubDate>Mon, 03 Dec 2007 02:31:26 +0000</pubDate>
<dc:creator>Alicia Yabeta</dc:creator>
<guid>http://casacomprar.wordpress.com/2007/12/03/pasos-para-participar-como-colaborador-en-nuestro-blog-de-casacomprar-y-su-audiencia/</guid>
<description><![CDATA[Ya había comentado anteriormente en el artículo Como Participar de la Audiencia de Nuestro Blog ]]></description>
<content:encoded><![CDATA[<p>Ya había comentado anteriormente en el artículo <a href="http://casacomprar.wordpress.com/2007/10/09/como-articipar-de-la-audiencia-de-nuestro-blog-de-casacomprar/">Como Participar de la Audiencia de Nuestro Blog de CasaComprar</a> que estube estructurando un grupo de colaboradores en distintos países para que suban artículos referentes al mercado de bienes raíces en sus respectivas áreas de trabajo y países en Latinoamérica, EEUU o cualquier país en el mundo y en ´´Español´´. Con esto tratamos de conformar una gran comunidad donde el fin es brindar la mayor información de posible de bienes raíces para aquellos que son de habla híspana, ya que la mayoría de la información que hay en internet es en ingles.</p>
<p>Pues como habrán notado ya tenemos participantes que empezarán a brindarles información desde aquí <a href="http://casacomprar.wordpress.com/">CasaComprar.Wordpress.com</a>, los mismos estan al lado derecho de esta página. Inicialmente ya partimos con el primer artículo sobre un poco del mercado en Chile!!! (<a href="http://casacomprar.wordpress.com/2007/11/30/marketing-inmobiliario-en-el-mercado-chileno/">Marketing Inmobiliario en el Mecado Chileno</a>) de la mano de nuestro amigo Marcos Burich, Gerente General de Casa Ideal en Santiago de Chile.</p>
<p>Para aquellos que estan en otros países y quieren participar, les dejo los pasos para estar en la lista y estar en contacto con la audiencia de este Blog.</p>
<p>1.- Enviar un correo a <a href="mailto:alicia@bienesraicesvideo.com">alicia@bienesraicesvideo.com</a> con los siguientes datos:<br />
        - Correo que usaras para participar del blog y recibir consultas o mails de los visitantes del mismo.<br />
        - Fotografía que usaras como colaborador<br />
        - Nombre completo, Nombre de tu empresa, Cargo que ocupas, Ciudad y País.<br />
           Si eres independiente informa esto.<br />
        - Sitio Web o Blog si es que lo tienes<br />
        - Agrega algun comentario pequeñito del porque quieres participar en el blog.</p>
<p>2.- Se te habilitara un usuario y recibiras un mail con una confirmación e invitación para que puedas accesar al Blog y subir tus artículos a una bandeja de aprobación.</p>
<p>3.- Todos los artículos deben estar dirigidos a un público que espera noticias, información, alternativas, tips sobre mercados de bienes raíces en cualquier parte del mundo y en español por supuesto.</p>
<p>4.- Pueden participar todos aquellos envueltos en el mundo inmobiliario o que brinda algun servicio afín, como abogados, agentes inmobiliarios, brokers, constructores, arquitectos, etc.</p>
<p>Como podrán observar son pasos sencillos y me gustarían que lo tomen en cuenta para hacer de este lugar un lugar de encuentro entre abastecedores informativos e inversores interesados en todo tipo de información de los mercados que estan en crecimiento y lo sque estan iniciandose.</p>
<p>Espero sus mails y sus datos!!!</p>
<p>Estaremos en contacto.</p>
<p>Alicia Yabeta<br />
Correo Electrónico: <a href="mailto:alicia@casacomprar.com">alicia@casacomprar.com</a><br />
<strong>Sitios Web:</strong><br />
<a href="http://www.casacomprar.com/">www.casacomprar.com</a><br />
<a href="http://www.bienesraicesvideo.com/">www.bienesraicesvideo.com</a><br />
<strong>Otros Blogs:<br />
</strong>Portugués: Imovei <a href="http://imovei.wordpress.com/">Imovei.Wordpress.com</a><br />
Ingles: ForSaleByLocals <a href="http://forsalebylocals.wordpress.com/">ForSaleByLocals.Wordpress.com</a><br />
<strong>Telefonos:<br />
</strong>  México y Centroamérica / (52) 5511-669265<br />
  Bolivia y Sudamérica / (591) 3 335-6534<br />
  Brasil / (55) 2138-230128<br />
  EEUU y Canadá / (1) 360-3621032</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Instatiation of immutable objects]]></title>
<link>http://javaantipatterns.wordpress.com/2007/11/22/instatiation-of-immutable-objects/</link>
<pubDate>Thu, 22 Nov 2007 15:14:42 +0000</pubDate>
<dc:creator>Alex</dc:creator>
<guid>http://javaantipatterns.wordpress.com/2007/11/22/instatiation-of-immutable-objects/</guid>
<description><![CDATA[Creating new instances of immutable primitive type wrappers (such as Number subclasses and Booleans)]]></description>
<content:encoded><![CDATA[<p>Creating new instances of immutable primitive type wrappers (such as <code>Number</code> subclasses and <code>Boolean</code>s) wastes the memory and time needed for allocating new objects. Static <code>valueOf()</code> method works much faster than a constructor and saves the memory, as it caches frequently used instances.</p>
<p>It is guaranteed that two <code>Boolean</code> instances and <code>Integer</code>s between -128 and 127 to be pre-cached, thus you definitely should not use the constructor to instantiate them.</p>
<p><!--more--></p>
<p><strong>Bad:</strong><br />
[sourcecode language='java']<br />
Integer i = new Integer(0);<br />
Boolean b = new Boolean(true);<br />
[/sourcecode]</p>
<p><strong>Good:</strong><br />
[sourcecode language='java']<br />
Integer i = Integer.valueOf(0);<br />
Boolean b = Boolean.valueOf(true); // or Boolean.TRUE<br />
[/sourcecode]</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Constructor ( With/Without ) Parameter &amp; Method]]></title>
<link>http://millad.wordpress.com/2007/11/06/constructor-withwithout-parameter-method/</link>
<pubDate>Tue, 06 Nov 2007 12:59:44 +0000</pubDate>
<dc:creator>Millad</dc:creator>
<guid>http://millad.wordpress.com/2007/11/06/constructor-withwithout-parameter-method/</guid>
<description><![CDATA[What is a method?
A Method provides information about, and access to, a single method on a class or ]]></description>
<content:encoded><![CDATA[<p>What is a method?</p>
<p>A Method provides information about, and access to, a single method on a class or interface. The reflected method may be a class method or an instance method (including an abstract method).</p>
<p>Method example :  getName();  // This will return the name value.so getName have to be getName() { return name; }<br />
They cannot be declared in a public static void main(String[] args)  ! but outside.<br />
You have to create them in a public class {   }  call them from another class or same:) </p>
<p>Constructors - They create new objects and give them values when created if it is with a parameter.</p>
<p>House myHouse = new House("Red", 03, "Millad")<br />
House color, house Number, house owner  - &#62; These will be taken when created and saves it to its object...</p>
<p>Without parameter:House myHouse = new House(); This will make a default value that you have to write before creating a "default" class.<br />
like HouseOwner = "Not Set";</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Nuts and bolts, concerts and vaults...]]></title>
<link>http://multesimus.wordpress.com/2007/10/29/nuts-and-bolts-concerts-and-vaults/</link>
<pubDate>Mon, 29 Oct 2007 09:11:02 +0000</pubDate>
<dc:creator>multesimus</dc:creator>
<guid>http://multesimus.wordpress.com/2007/10/29/nuts-and-bolts-concerts-and-vaults/</guid>
<description><![CDATA[Morning! It has been almost two days since I have posted here, so I thought it would be a nice time ]]></description>
<content:encoded><![CDATA[<p>Morning! It has been almost two days since I have posted here, so I thought it would be a nice time to update the world around me, especially all those surfers who accidentally stumble upon this blog, read two lines and start running away thinking OMG, what the... So especially for those people: the weekend! Or, as the title states, Nuts and bolts, concerts and vaults..., or faults/mistakes that is... The first being me going out still having somekind of hangover from the eve before. Instead of starting saturday with a beer, to flush away all the effects ADULT. had on me, I didn't. To make matters worse I drank a lot of strong hot coffee, which, as we all know, dehydrates the body, or, in my case, tries to dehydrate the body, since I felt I had no fluids left....</p>
<p><!--more--><br />
Coffee, especially strong coffee, makes you feel great instantly, you awake, start feeling things, thinking things, and when you try to do both at the same time you start feeling your head that's beginning to hurt from either the things you did the night before, or the hangover... Instead of taking a break I allowed myself to go out Saturdaynight as well. I had to, beause the theme at So What was Nuts and Bolts. You can guess what's meant by that, and since I'm still, *sigh, single, I just had to go. Immediatly after entering boys get a bolt and girls get a nut. They're all different sizes, so when you really want to participate you need to talk up to everyone, until you find your match, and get rewarded with a lovecocktail. (nice name, but it was just a sex on the beach cocktail...)</p>
<p>But I'm not even there yet, still stuck on saturdayafternoon, which I spent, mostly, playing some abondonware I found. Really got hooked on <a href="http://www.abandonia.com/games/369/download/Constructor.htm" target="_blank">constructor</a> <em>link goes to info and dl page</em> in the nineties, still have it on cd somewhere, and I was surprised to find out it was abandonware now. Even better, <a href="http://dosbox.sourceforge.net/download.php?main=1" target="_blank">dosbox</a> has finally been updated so sound works in most old games, even in <a href="http://www.bestoldgames.net/eng/old-games/syndicate.php" target="_blank">syndicate</a> :D So i spent the better part of the day playing constructor. Which still is quite a hard game to play, unlike syndicate, which turned out to be quite easy.</p>
<p>Anyway, after playing the game, a lot, both downstairs, but constructor managed to crash that one several times, and upstairs, working fine,  I decided I needed food, badly.  Prepared a quick dinner, consisting of two nice veggie burgers, some baked potatoes and some vegetables. Not quite a luxury meal, but it managed to fill my stomach and thus satisfy my needs. A quick sending and receiving of messages made my guest arrive at about 10pm. To drink and talk a little before going to the So What.</p>
<p>After walking there, about a five min walk when not under influence of anything, we arrived and got a nut or bolt. The party didn't really start untill near 12pm, so I decided to help a little at the b-food, the kitchen that is. Every saturday some 4/5 people are in there preparing food, a lot of it. At 00.30 the copunter opens and people can order sandwiches, burgers etc. It was good fun helping out there. Usually we sell a lot of baked ham cheese sandwiches, but this eve there was a special, burgers. So I tried my best to promote 'my' sandwiches, trying to sell me together with them, which worked :D I evens tarted to offer burger ham cheese sandwiches (bad idea...). After only 1.5hours of selling all was gone... And I, as most people there, was quite filled with the drinks that kept streaming in from the bar next to the kitchen.</p>
<p>After most people had left the kitchen, the bar was cleared as well,  leaving me and just a few people in the kitchen and two people in the bar (the door between the bar and entrance was closed, leaving everyone at the dancefloor, or at the entrance to chat). But not me and four others. We stayed at the kichen and started washing the dishes, well I did...... Afterwards, when it was just the two, and alter, three of us  we were talking a lot, about well, some real important things. Darn, did we talk a lot about things we were anly talking about because we had had too many beers, and/or martini's :P Before we knew it it was near 3.30am. And the first of us left, to a destination I wouldn't guess she would go to, or maybe I did, but didn't want to know. Long, private, story, so a nono for here ;-)</p>
<p>That left just me and someone else, so we talked some more,  and decided to leave the kitchen and move to the dancefloor when it was near 4.30am... People kept streaming out, within the hour we were with just a dozen or so people, with me and him getting beer, and more beer. Had a chat with the DJ, a long one apparently, because I left at about 5.30/5.45am, when there were still some five people. don't know anything about the way home, or the way upstairs to my bed. Only that the sound of my cellphone made me wake up. I had gotten a message from her at 9.30am *omg, well 10.30am, but due to daylight savings time, I needed to adjust all clocks in the house, including that one. She had quite a story to tell by sms, which left me feeling my head, a little too much, and texting back, before falling into my coma-induced sleep.</p>
<p>Eventually I did need to get up and ready, because I was about to be picked up at 2pm, to go to a concert of a friend of mine<br />
in Dodrecht, at the Kunstmin. So I did get up at about 10.30am, off to a slow start, some coffee and sandwiches, and of course a shower, a long one, a long hot shower! After thinking over all things that had happened the night befiore, and, unfortunately, the things that didn't. It was nearing 1pm. So I got ready, checked my mail and messengerprogs for new messages, too much, but most of it being spam.... and soon the doorbell rang, the car was there.</p>
<p>What was supposed to be a quick drive to Dordrecht turned out to be a little longer. Due to construciton work we couldn't get onto the highway and had to take a road parallel to the highway, resulting in a 15min delay. But, even worse we couldn't find the darn thing. It was listed on the map, but it wasn't there.... With about 15mins to go before the concert we dumped the car at a carpark and started walking, asking everyone where the heck the Kunstmin was. After getting directions we started speedwalking, to arrive just in time, and to notice we could have taken a much shorter route......</p>
<p>The concert itself was great, <a href="http://www.timbresdivers.nl/" target="_blank">Timbres Divers</a> was celebrating it's 25th annivesary and some 600 people had turned out to enjoy their film and musicalmusic. After a good performance I left, with someone else, at 7pm and arrived back here at 7.30 or so. To go upstairs to my room, drink some tea, and make a quick dinner, again. After watching some television, and having a quick chat which turned out to be a waiting game, I decided to go to bed early. At 10pm, I was vast asleep, to awake at 7.30am this morning. And now, well, now I've finished most things I wanted to do, so I have a lot of time today for a)picking up some pics, when they're ready, of Silje Nergaard and Feist b)clean my room a little c)start learning for my exam, this wednesday d)(optional) try fixing this sore feeling in my throat that has been present since friday... ow and e)contact a customer/company, to make a appointment for creating a good big network out of nothing!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[llinars del valles , Habitatges d'obra nova]]></title>
<link>http://llinars.wordpress.com/2007/10/08/llinars-del-valles-habitatges-dobra-nova/</link>
<pubDate>Mon, 08 Oct 2007 17:08:54 +0000</pubDate>
<dc:creator>llinars</dc:creator>
<guid>http://llinars.wordpress.com/2007/10/08/llinars-del-valles-habitatges-dobra-nova/</guid>
<description><![CDATA[Habitatges directe Constructor-Promotor 
Eduard I Robert Constructors.sl Tel 629 53 89 53





Totes]]></description>
<content:encoded><![CDATA[<p><strong>Habitatges directe Constructor-Promotor </strong><br />
<strong>Eduard I Robert Constructors.sl Tel 629 53 89 53</strong></p>
<p><img src="http://www.llinars.com/imatges/PanoDavant600.jpg" /><br />
<img src="http://www.llinars.com/imatges/PanoDarrera600.jpg" /><br />
<img src="http://www.llinars.com/Panoramicas/PanoramicaCuina800.jpg" /><br />
<img src="http://www.llinars.com/Panoramicas/PanoramicaManjador04_800.jpg" /><br />
<img src="http://www.llinars.com/Panoramicas/PanoramicaRebador03_800.jpg" /></p>
<p><strong>Totes les ventatges de viure en el Vallès i tant sols a 45 Km de Barcelona .amb tots els serveïs i bones comunicacions per carretera </strong></p>
<p><strong>Adresa: Informacio a la mateixa obra Tel 629 53 89 53 </strong><br />
<strong>Direcció: Carrer Josep Pla, 48-50 . SECTOR C Llinars del valles, Barcelona<br />
</strong><br />
<strong>Horari: De dimarts a disabte de 10 a 13h. i de 16 a 18h. diumenges de 10 a 13h. Festius cal consultar</strong></p>
<p><u>PLANTA BAIXA </u><br />
<img src="http://www.llinars.com/imatges/pb.jpg" /><br />
<strong>Planta baixa , cuina ofice de S= 18m2 , lavabo de 4 m2 , rebador - distribuidor de 11,5m2 amb armari empotrat de cirerer, i Saló menjador "amb persiana Motoritzada" de 36 m2., amb sortida a terrassa i a Jardí privat</strong></p>
<p><u>PLANTA PIS</u><br />
<img src="http://www.llinars.com/imatges/ptp-g.jpg" /><br />
<strong>Planta pis 3 habitacions i un bany familiar , mes un altre habitació tipus suite amb bany .</strong></p>
<p><u>PLANTA GARATGE </u><br />
<img src="http://www.llinars.com/imatges/pg.jpg" /><br />
<strong>Planta Garatge , Per 3 Plaçes de cotxe S=40,60 m2,petita bodega o Magatzem mes safareig. </strong></p>
<p><strong>situacio llinars del valles , valles oriental , Barcelona , Tel 629 53 89 53 </strong><br />
<img src="http://www.llinars.com/imatges/planol-1.gif" /></p>
<p><a href="http://www.llinars.com">llinars del valles habitatges d’obra Nova</a><br />
<a href="http://www.llinars.es">llinars del valles Habitatges directe Constructor </a></p>
]]></content:encoded>
</item>

</channel>
</rss>
