<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4283114781214264259</id><updated>2026-10-17T23:03:59.371-07:00</updated><category term="C++ Programming Projects"/><category term="AS3"/><category term="HTML/CSS Tips"/><category term="Unity Projects"/><category term="WCF"/><title type='text'>Coding Monday</title><subtitle type='html'>Coding tips and tricks for everyday programming!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>FuntitudeApps</name><uri>http://www.blogger.com/profile/02506728276136629308</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-2087097515583279100</id><published>2015-04-01T03:39:00.003-07:00</published><updated>2016-08-24T19:19:07.736-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>&#39;Memory gates checking failed because the free memory WCF&#39; FIX: InsufficientMemoryException</title><content type='html'>You&#39;re getting ready to run your WCF service application and you see this error: &quot;Memory gates checking failed because the free memory&quot; populate in your browser.&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;Memory gates checking failed because the free memory (9338880 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;section&gt;
This exception is simply caused by insufficient memory allocated to the WCF service at the current moment, thus, the application throws an &quot;InsufficientMemoryException.&quot; Thankfully, the exception is descriptive enough to provide additional information on solving the issue.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Stack Trace Exception:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;[InsufficientMemoryException: Memory gates checking failed because the free memory (9338880 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.]
&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;FIX: &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In your web.config look under configuration / system.serviceModel / serviceHostingEnvironment element. Add a minFreeMemoryPercentageToActivateService attribute and set it to zero (0).&amp;nbsp;&lt;/section&gt;&lt;section&gt;&lt;br /&gt;


&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWLYSiBijNgTl3tJY_idVxD1234xhEoFsfHe6dqvbGTekTLNJSAMqMEYP6PDydFChVwXE42oQEF6uVL5NpgLp-HGPJ5QJAQk5mRL9qbxDwia47K-Lr5hqpXc8qXN7Tsw4v3vtMf43hYw84/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;configuration&amp;gt;  
  &amp;lt;system.serviceModel&amp;gt;  
   &amp;lt;serviceHostingEnvironment minFreeMemoryPercentageToActivateService=&quot;0&quot; /&amp;gt;  
  &amp;lt;/system.serviceModel&amp;gt;  
 &amp;lt;/configuration&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;section&gt;&lt;br /&gt;&lt;/section&gt;&lt;section&gt;PS: If the serviceHostingEnvironment already exist, simply append/add the &quot;minFreeMemoryPercentageToActivateService&quot; attribute and set it to zero (0).&amp;nbsp;&lt;/section&gt;&lt;/section&gt;&lt;section&gt;&lt;br /&gt;&lt;/section&gt;&lt;section&gt;Join the discussion on &lt;a href=&quot;http://stackoverflow.com/questions/2880383/strange-error-occurring-when-using-wcf-to-run-query-against-sql-server/11531518#11531518&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;StackOverflow&lt;/a&gt;.&amp;nbsp;&lt;/section&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/2087097515583279100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2015/04/memory-gates-checking-failed-because.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/2087097515583279100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/2087097515583279100'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2015/04/memory-gates-checking-failed-because.html' title='&#39;Memory gates checking failed because the free memory WCF&#39; FIX: InsufficientMemoryException'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-371712014825682328</id><published>2012-12-12T09:40:00.000-08:00</published><updated>2012-12-12T10:46:35.315-08:00</updated><title type='text'>Day and Night Effect Using jQuery</title><content type='html'>Day and night effect on any html page can easily mean switching&amp;nbsp;between two different stylesheets to enhance user experience. This tutorial will demonstrate how to switch between two stylesheets&amp;nbsp;efficiently&amp;nbsp;using jQuery.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;End Result:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;150&quot; src=&quot;http://dl.dropbox.com/u/90407440/index.html&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;THINGS YOU MIGHT NEED:&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.w3schools.com/jquery/jquery_install.asp&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;jQuery basic knowledge&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;HTML file&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;External CSS files&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;External &quot;day.css&quot; file:&lt;br /&gt;
&lt;pre style=&quot;background: #233; color: #d1d1d1; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;body&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
     
      &lt;span style=&quot;color: #904050;&quot;&gt;color&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; black&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color: #904050;&quot;&gt;background-color&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; yellow&lt;span style=&quot;color: #b060b0;&quot;&gt;;  &lt;/span&gt;&lt;span style=&quot;color: #b060b0; font-size: 16px;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-size: 20px;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
External &quot;night.css&quot; file:&lt;br /&gt;
&lt;pre style=&quot;background: #233; color: #d1d1d1; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;body&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
     
      &lt;span style=&quot;color: #904050;&quot;&gt;color&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; white&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color: #904050;&quot;&gt;background-color&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; black&lt;span style=&quot;color: #b060b0;&quot;&gt;; }&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
HTML file:&lt;br /&gt;
&lt;pre style=&quot;background: #233; color: #d1d1d1; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;h1&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt;Day and Night Effect&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;h2&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt;

   &lt;span style=&quot;color: #223333;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;button&lt;/span&gt; data-file&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;day&quot;&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt; Day &lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;button&lt;/span&gt; data-file&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;night&quot;&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt; Night &lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;button&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #ff8906;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
jQuery Script:&lt;br /&gt;
&lt;pre style=&quot;background: #233; color: #d1d1d1; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;gt;&lt;/span&gt;
 
  &lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
   
    &lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;link&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt; $&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;link&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;
    $&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;button&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;on&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
        
            &lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;var&lt;/span&gt; $&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;this&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt; $&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;
            stylesheet &lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt; $&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;data&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;file&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;

            &lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;attr&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;href&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt; stylesheet &lt;span style=&quot;color: #d2cd86;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;.css&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;

            $&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;this&lt;/span&gt;
                &lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;siblings&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;button&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;
                  &lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;removeAttr&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;disabled&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;
                  &lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;end&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;
                  &lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;attr&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;disabled&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;disabled&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;      

          &lt;span style=&quot;color: #b060b0;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;

     &lt;span style=&quot;color: #b060b0;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #b060b0;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;script&lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Code Dive:
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CSS:&lt;/b&gt;&lt;br /&gt;
External &quot;day.css&quot; and &quot;night.css&quot; can hold your custom CSS styles respectively.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;jQuery:&lt;/b&gt;&lt;br /&gt;
We first start by calling a self involking&amp;nbsp;anonymous&amp;nbsp;function that listens to button clicks and executes immediately. That is:
&lt;br /&gt;
&lt;pre style=&quot;background: #f6f8ff; color: #000020; font-size: 14px;&quot;&gt;&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #406080;&quot;&gt;{&lt;/span&gt;

&lt;span style=&quot;color: #406080;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;;&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
The rest of the code are commented to customize your own methods.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f6f8ff; color: #000020; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;link&lt;/span&gt; &lt;span style=&quot;color: #308080;&quot;&gt;=&lt;/span&gt; $&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;link&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;; // dives into html retrieve and assign css &#39;link&#39; attribute&lt;/span&gt;
    $&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;button&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;on&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #406080;&quot;&gt;{ // on mouse click even. reference jQuery d                                         //docs for other event helpers.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background: #f6f8ff; color: #000020;&quot;&gt;            &lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;var&lt;/span&gt; $&lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;this&lt;/span&gt; &lt;span style=&quot;color: #308080;&quot;&gt;=&lt;/span&gt; $&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;,&lt;/span&gt;
            stylesheet &lt;span style=&quot;color: #308080;&quot;&gt;=&lt;/span&gt; $&lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;data&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;file&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;; // retrieve button data file attr &lt;/span&gt;

            &lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;attr&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;href&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;,&lt;/span&gt; stylesheet &lt;span style=&quot;color: #308080;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;.css&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;; // alter the attr respectively&lt;/span&gt;

            $&lt;span style=&quot;color: #200080; font-weight: bold;&quot;&gt;this                         &lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;// get the button that was clicked&lt;/span&gt;
                &lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;siblings&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;button&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)       &lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;// change selection to a sibling button&lt;/span&gt;
                  &lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;removeAttr&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;disabled&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;// remove its attributes &lt;/span&gt;
                  &lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;end&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)                  &lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;// end or return&lt;/span&gt;
                  &lt;span style=&quot;color: #308080;&quot;&gt;.&lt;/span&gt;attr&lt;span style=&quot;color: #308080;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;disabled&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #1060b6;&quot;&gt;&#39;disabled&#39;&lt;/span&gt;&lt;span style=&quot;color: #308080;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;;  &lt;/span&gt;&lt;span style=&quot;color: #406080;&quot;&gt;// and disable the button itself.&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Happy Coding! &lt;br /&gt;
verse316</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/371712014825682328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2012/12/day-and-night-effect-using-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/371712014825682328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/371712014825682328'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2012/12/day-and-night-effect-using-jquery.html' title='Day and Night Effect Using jQuery'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-5100529412757736613</id><published>2012-11-24T16:48:00.001-08:00</published><updated>2012-12-12T09:08:55.849-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AS3"/><title type='text'>Getting the window title in AS3</title><content type='html'>In AS3, you can easily access the name of the HTML page that the .swf is embedded in. To do this, you can use ExternalInterface. First, import the ExternalInterface library.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #fbfbfb; border: 1px solid rgb(206, 206, 206); min-height: 40px; overflow: auto; padding: 5px; width: 500px;&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; font-family: consolas,&amp;quot;Courier New&amp;quot;,courier,monospace; font-size: 12px; margin: 0em; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt; &lt;b&gt;flash.external.ExternalInterface;&lt;/b&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;br /&gt;
Next, call the window location from JavaScript using the call function of ExternalInterface.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #fbfbfb; border: 1px solid rgb(206, 206, 206); min-height: 40px; overflow: auto; padding: 5px; width: 500px;&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; font-family: consolas,&amp;quot;Courier New&amp;quot;,courier,monospace; font-size: 12px; margin: 0em; width: 100%;&quot;&gt;&lt;b&gt;flash.external.ExternalInterface.call&lt;/b&gt;(&quot;&lt;span style=&quot;color: darkred;&quot;&gt;window.location.href.toString&lt;/span&gt;&quot;);&lt;/pre&gt;
&lt;/pre&gt;
&lt;br /&gt;
This should work for most browsers; however, there have been reported problems using this method. If you experience difficulties with your browser, try wrapping the call in a JavaScript function.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #fbfbfb; border: 1px solid rgb(206, 206, 206); min-height: 40px; overflow: auto; padding: 5px; width: 500px;&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; font-family: consolas,&amp;quot;Courier New&amp;quot;,courier,monospace; font-size: 12px; margin: 0em; width: 100%;&quot;&gt;&lt;b&gt;flash.external.ExternalInterface.call&lt;/b&gt;(&quot;&lt;span style=&quot;color: darkred;&quot;&gt;function(){ return window.location.href.toString();}&lt;/span&gt;&quot;)&lt;/pre&gt;
&lt;/pre&gt;
&lt;br /&gt;
In addition, you may want to find the path of the .swf file. Using the following code will get the path of the .swf:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #fbfbfb; border: 1px solid rgb(206, 206, 206); min-height: 40px; overflow: auto; padding: 5px; width: 500px;&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; font-family: consolas,&amp;quot;Courier New&amp;quot;,courier,monospace; font-size: 12px; margin: 0em; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; &lt;b&gt;swfLocation&lt;/b&gt; = &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: blue;&quot;&gt;location&lt;/span&gt;&lt;b&gt;.href&lt;/b&gt;;&lt;/pre&gt;
&lt;/pre&gt;
&lt;br /&gt;
One final note, the ExternalInterface calls only work when JavaScript is enabled on the page, so if it does not work, this may be the issue.&lt;br /&gt;
&lt;br /&gt;
Happy Coding,&lt;br /&gt;
kieblera5</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/5100529412757736613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2012/11/getting-window-title-in-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/5100529412757736613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/5100529412757736613'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2012/11/getting-window-title-in-as3.html' title='Getting the window title in AS3'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-8251519684232261811</id><published>2012-11-08T21:08:00.001-08:00</published><updated>2012-12-17T22:34:23.815-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML/CSS Tips"/><title type='text'>How to Center a Page in CSS</title><content type='html'>Conflicting margins can be frustrating and confusing when&amp;nbsp;constructing&amp;nbsp;a stylesheet for your website.&amp;nbsp;However, centering your website is a common practice to avoid margin conflicts. Centering your website also helps with readability and works pretty well with dynamic display of content.&lt;br /&gt;
&lt;br /&gt;
The following tutorials will show you how to center your website using an ID selector in CSS.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;THINGS YOU MIGHT NEED:&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.w3schools.com/css/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;CSS basic knowledge&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;HTML file&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;External CSS file&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot; language-markup&quot; rel=&quot;HTML&quot; style=&quot;-webkit-hyphens: none; background-color: #1d1f21; box-sizing: border-box; font-family: Menlo, Monaco, monospace; font-size: 16.363636016845703px; line-height: 20px; margin-bottom: 20px; overflow: auto; padding: 33px 0px 0px; position: relative; tab-size: 2; word-break: normal;&quot;&gt;&lt;code class=&quot; language-markup&quot; style=&quot;background-image: none; box-sizing: border-box; display: block; font-family: Menlo, Monaco, monospace; overflow: auto; padding: 15px;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; font-size: 16.363636016845703px;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;color: #777777;&quot;&gt;HTML File:

&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; font-size: 16.363636016845703px;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #ab875d;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ab875d;&quot;&gt;body&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: white; font-size: 16.363636016845703px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; font-size: 16.363636016845703px;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #ab875d;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt;&lt;span style=&quot;color: #ab875d;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token attr-name&quot; style=&quot;box-sizing: border-box; color: #ab875d;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot; style=&quot;box-sizing: border-box; color: #8f9c6c;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #ab875d;&quot;&gt;=&lt;/span&gt;&quot;page-wrap&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;color: #ab875d;&quot;&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: white; font-size: 16.363636016845703px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; font-size: 16.363636016845703px;&quot;&gt;&lt;span style=&quot;color: #777777;&quot;&gt; all websites HTML here 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: white; font-size: 16.363636016845703px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #ab875d; font-size: 16.363636016845703px;&quot;&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot; style=&quot;box-sizing: border-box; color: #ab875d; font-size: 16.363636016845703px;&quot;&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: #ab875d; font-size: 16.363636016845703px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot; language-css&quot; rel=&quot;CSS&quot; style=&quot;-webkit-hyphens: none; background-color: #1d1f21; box-sizing: border-box; color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16.363636016845703px; line-height: 20px; margin-bottom: 20px; overflow: auto; padding: 33px 0px 0px; position: relative; tab-size: 2; word-break: normal;&quot;&gt;&lt;code class=&quot; language-css&quot; style=&quot;background-image: none; box-sizing: border-box; display: block; font-family: Menlo, Monaco, monospace; overflow: auto; padding: 15px;&quot;&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-size: 16.363636016845703px;&quot;&gt;&lt;span style=&quot;color: #777777; font-size: 16.363636016845703px;&quot;&gt;External CSS File:
&lt;/span&gt;
#page-wrap &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-size: 16.363636016845703px;&quot;&gt;{&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot; language-css&quot; style=&quot;background-image: none; box-sizing: border-box; display: block; font-family: Menlo, Monaco, monospace; overflow: auto; padding: 15px;&quot;&gt;     &lt;span class=&quot;token property&quot; style=&quot;box-sizing: border-box; color: #9b869c;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white;&quot;&gt;:&lt;/span&gt; 800px&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white;&quot;&gt;;&lt;/span&gt;
     &lt;span class=&quot;token property&quot; style=&quot;box-sizing: border-box; color: #9b869c;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white;&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
In other to avoid margin conflicts when resizing your window, it is very important to set the width of the selector to a giving pixel ( e.g 800px ) and also set the margin&#39;s initial value to 0 and auto to&amp;nbsp;horizontally center the page. &lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2 id=&quot;Examples&quot;&gt;
Examples:&lt;/h2&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;font-size: 15px;&quot;&gt;margin: 5%;                /* all sides 5% margin */

margin: 10px;              /* all sides 10px margin */

margin: 1.6em 20px;        /* top and bottom 1.6em, left and right 20px margin */

margin: 10px 3% 1em;       /* top 10px, left and right 3%, bottom 1em margin */

margin: 10px 3px 30px 5px; /* top 10px, right 3px, bottom 30px, left 5px margin */

margin: 1em auto;          /* 1em margin on top and bottom, box is horizontally centered */

margin: auto;              /* box is horizontally centered, 0 margin on top and bottom */
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;background: gold; margin: auto; width: 66%;&quot;&gt;margin:     auto;
background: gold;
width:      66%;&lt;/pre&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;background: gold; margin: auto; width: 66%;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;background: gold; margin: auto; width: 66%;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;background: gold; margin: auto; width: 66%;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;background: gold; margin: auto; width: 66%;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot; auto-links: false;&quot; style=&quot;background-color: plum; background-position: initial initial; background-repeat: initial initial; margin-bottom: 100px; margin-left: -40px; margin-top: -1em; width: 20em;&quot;&gt;margin:     -1em 0 100px -40px;
background: plum;
width:      20em;&lt;/pre&gt;
&lt;/div&gt;
~* By Verse316 *~
</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/8251519684232261811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2012/11/centering-website-without-margin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/8251519684232261811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/8251519684232261811'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2012/11/centering-website-without-margin.html' title='How to Center a Page in CSS'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-177719988628265566</id><published>2010-03-01T18:08:00.000-08:00</published><updated>2010-03-01T18:17:21.568-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++ Programming Projects"/><title type='text'>Dictionary Shortener</title><content type='html'>Recently, I had to write a program that shortened the dictionary. What I mean by this is that using a full dictionary (over 237,000 words), I needed to weed out the words that were longer than eight letters and shorter than three letters. I needed a list of letters between three and eight letters for an upcoming game that happens to need a dictionary to check against.&lt;br /&gt;&lt;br /&gt;Why do I bring this up? Well, my program takes advantage of fstream, a coder&#39;s good friend or enemy, depending on your understanding of it. &lt;br /&gt;&lt;br /&gt;In my next posting, I will show you the finer points of using fstream, but for now, here is the code for the dictionary shortening program:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border: solid 1px silver; cursor: text; margin: 20px 0px 10px 0px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%; direction: ltr; text-align: left;&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; direction: ltr; text-align: left;&quot;&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;&lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &amp;lt;iostream&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;&lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &amp;lt;fstream&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;&lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &amp;lt;string&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;namespace&lt;/span&gt; std;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;int&lt;/span&gt; main()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    string word;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    ifstream infile;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    ofstream outfile;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;int&lt;/span&gt; count=0;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    infile.open(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;fulldictionary.txt&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt;(infile.fail())&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;        cout&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080;&quot;&gt;&quot;File could not be opened\n&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;        system(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;PAUSE&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    outfile.open(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;dictionary_short.txt&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt;(outfile.fail())&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;        cout&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080;&quot;&gt;&quot;File could not be opened\n&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;        system(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;PAUSE&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #0000ff;&quot;&gt;int&lt;/span&gt; i=0;!infile.fail();i++)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;        getline(infile,word);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt;(word.length()&amp;gt;=3&amp;amp;&amp;amp;word.length()&amp;lt;=8)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;        {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;            count+=1;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;            cout&amp;lt;&amp;lt;count&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080;&quot;&gt;&quot;: &quot;&lt;/span&gt;&amp;lt;&amp;lt;word&amp;lt;&amp;lt;endl;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;            outfile&amp;lt;&amp;lt;word&amp;lt;&amp;lt;endl;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;        }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    infile.close();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    outfile.close();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    cout&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080;&quot;&gt;&quot;There were &quot;&lt;/span&gt;&amp;lt;&amp;lt;count&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080;&quot;&gt;&quot; words saved in dictionary_short.txt\n&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;    system(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;PAUSE&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; 0;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The above code assumes that you have a file called &quot;fulldictionary.txt&quot; in the project folder and will automatically create the output file. There&#39;s no need to make that one.</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/177719988628265566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2010/03/dictionary-shortener.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/177719988628265566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/177719988628265566'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2010/03/dictionary-shortener.html' title='Dictionary Shortener'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-2271046747205461094</id><published>2010-02-26T10:34:00.001-08:00</published><updated>2010-02-28T08:48:43.462-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unity Projects"/><title type='text'>Creating Road In Unity Game Engine</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Unity game engine is a great engine for developing game on PC, MAC, iPhone, and other platforms. However, I noticed that Unity does not have a road editor compared to Torque (game engine). One can use primitives to resolve this issue, but I prefer to use a 3d modeling tool. Thus, in this tutorial I will show you how to create roads using 3ds Max.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #990000;&quot;&gt;THINGS YOU MIGHT NEED:&lt;/div&gt;&lt;div style=&quot;color: #990000;&quot;&gt;a) A 3D modeling tool&lt;/div&gt;&lt;div style=&quot;color: #990000;&quot;&gt;b) Road Design/Map&lt;/div&gt;&lt;div style=&quot;color: #990000;&quot;&gt;c) Road Textures&lt;/div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;
1) Open 3ds Max, click CREATE and select SHAPES. &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3iJHYW6MiLCaRR4rx2D9rY6IhmfDalGiUDzStP5DHOqJAXklyR6WL62d_oy-O8Fda4qguCsPCeHBkMJGvILhDp9Ze_lpZmpznOZaJlCQMSil0J70-cj4cV_xGjerZvVuMUBHfkKr11uYo/s1600-h/lineSelectionFullScreen.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;21&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3iJHYW6MiLCaRR4rx2D9rY6IhmfDalGiUDzStP5DHOqJAXklyR6WL62d_oy-O8Fda4qguCsPCeHBkMJGvILhDp9Ze_lpZmpznOZaJlCQMSil0J70-cj4cV_xGjerZvVuMUBHfkKr11uYo/s640/lineSelectionFullScreen.png&quot; width=&quot;147&quot; /&gt;&lt;/a&gt;&lt;/div&gt;(click the picture to view in X-Large)&lt;br /&gt;
&lt;br /&gt;
1b) Enter/Select all the necessary values and settings as desired. (Use the same values and setting to achieve similar results as this tutorial)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Create the desired road using the top view.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj99n9ae2pPGBkUdFotb2rOKPn2meXblelM8twIrjNbHYw7UA8t9SMo7e65_gpL3oeaxomfc6p__g0kiUOTK99PEaHsrBe5YlWDaGZJRo4AkxzlKh5Sozouyq-7wfLUUDSVw-yrnGAKv-3-/s1600-h/fullScreenTopViewofRoad2.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;22&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj99n9ae2pPGBkUdFotb2rOKPn2meXblelM8twIrjNbHYw7UA8t9SMo7e65_gpL3oeaxomfc6p__g0kiUOTK99PEaHsrBe5YlWDaGZJRo4AkxzlKh5Sozouyq-7wfLUUDSVw-yrnGAKv-3-/s400/fullScreenTopViewofRoad2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
3) Select the Map Editor. (Shortcut: hit M on the keyboard to pop up the Map Editor)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvKJqfw41dgHNpIvhF78WVVcvAKMkxtuSLUWJYsx1_1Rl8mwx7xb5PbhWmjGO_BpMOYMoLTN-pwGd-ai2P2_bgi9w7N9yiGsHJxsfOju3hjdsVug9HUI7FYyE-40pjGlGUteoG5sD7SecS/s1600-h/materailEditorFullScreen.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;23&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvKJqfw41dgHNpIvhF78WVVcvAKMkxtuSLUWJYsx1_1Rl8mwx7xb5PbhWmjGO_BpMOYMoLTN-pwGd-ai2P2_bgi9w7N9yiGsHJxsfOju3hjdsVug9HUI7FYyE-40pjGlGUteoG5sD7SecS/s400/materailEditorFullScreen.png&quot; width=&quot;241&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;3b) Click on the none button next to Diffuse. Double Click on Bitmap and select your &lt;a href=&quot;http://www.filterforge.com/filters/830.jpg&quot; linkindex=&quot;24&quot; target=&quot;_blank&quot;&gt;road texture.&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiEqoKZzatYK3Mcd0MeMG4U8As5nKCCXdaCOkZN-YIWheUVMFCrZQxoNw7A2MrQHRBuhSCJ3XWTXrfvbeKEXEOaCJmgtrxAdhcYhTtN7Q2vvUvBYTzAeK9fDwCTuxh0l9yVolEpIjOGbUX/s1600-h/bitmapSelection.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;25&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiEqoKZzatYK3Mcd0MeMG4U8As5nKCCXdaCOkZN-YIWheUVMFCrZQxoNw7A2MrQHRBuhSCJ3XWTXrfvbeKEXEOaCJmgtrxAdhcYhTtN7Q2vvUvBYTzAeK9fDwCTuxh0l9yVolEpIjOGbUX/s320/bitmapSelection.png&quot; width=&quot;190&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUskxVdWb3qhsvYjGdEhnSfZyNrJ1JM035sv5AVmtxYNuuvYKKeA9CZvXyrZipVympDFDjI4opD3LZAvchs6nil0fEf8b-udVNPuUsEMAxO0uIv6FaUNPN8dmDiIIbY7xnCL6Tqx9Xg4nT/s1600-h/roadSelection.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;26&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;249&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUskxVdWb3qhsvYjGdEhnSfZyNrJ1JM035sv5AVmtxYNuuvYKKeA9CZvXyrZipVympDFDjI4opD3LZAvchs6nil0fEf8b-udVNPuUsEMAxO0uIv6FaUNPN8dmDiIIbY7xnCL6Tqx9Xg4nT/s320/roadSelection.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&amp;nbsp;4)&amp;nbsp; Make sure the desired material is selected. &lt;br /&gt;
4a) Select the &quot;Assign Material to Selection&quot; button in the Material editor to assign material&lt;br /&gt;
4b) Select the &quot;Show Standard map in Viewport&quot; to show material layout in your Viewport.&lt;br /&gt;
4c) Play Around with the Tiling Values to get the desired tiling.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQXGuw9AbkO9LAKFnMzK5KXEGK15QWqyK5gg-pEMYtsj9tc51BucR8Wk04fKmwrZkP9dpGA2VGvfIihHMLclq-jdhnF86hkNs27wXl7BadUzEiMznqtR9JSWH0Tj3XotYlrXUpGV7p-loQ/s1600-h/finalScene.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;27&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQXGuw9AbkO9LAKFnMzK5KXEGK15QWqyK5gg-pEMYtsj9tc51BucR8Wk04fKmwrZkP9dpGA2VGvfIihHMLclq-jdhnF86hkNs27wXl7BadUzEiMznqtR9JSWH0Tj3XotYlrXUpGV7p-loQ/s400/finalScene.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
5) Export as .FBX to Unity Game Engine.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoI47Vo9vGmN6lHRoRcNHUOfROiWji4So7BS2NSnH84n8db3DJqZ4YYvWB-TJjJEzRgk5aWemniZNBnn-GdXeWaGLIARUZ6653im7ayGtAvm5BB0gbe9wGv-ERZb1J4oc638UVMmQ2Oshe/s1600-h/secondIsland.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;28&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoI47Vo9vGmN6lHRoRcNHUOfROiWji4So7BS2NSnH84n8db3DJqZ4YYvWB-TJjJEzRgk5aWemniZNBnn-GdXeWaGLIARUZ6653im7ayGtAvm5BB0gbe9wGv-ERZb1J4oc638UVMmQ2Oshe/s400/secondIsland.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
~* By: Verse316 *~</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/2271046747205461094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2010/02/blog-post.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/2271046747205461094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/2271046747205461094'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2010/02/blog-post.html' title='Creating Road In Unity Game Engine'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3iJHYW6MiLCaRR4rx2D9rY6IhmfDalGiUDzStP5DHOqJAXklyR6WL62d_oy-O8Fda4qguCsPCeHBkMJGvILhDp9Ze_lpZmpznOZaJlCQMSil0J70-cj4cV_xGjerZvVuMUBHfkKr11uYo/s72-c/lineSelectionFullScreen.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-6391712827418739674</id><published>2010-01-05T04:36:00.000-08:00</published><updated>2012-11-24T16:52:51.550-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++ Programming Projects"/><title type='text'>Simple Console Program &amp; Code Snippet Embeding.</title><content type='html'>Happy New Year! There will lots of code altering and editing on this blog this year. Thus, displaying code in code snippets will be very effective. How do you display or embed code snippets on your blog? There are several ways you can embed scripts or code on your blog. One of the easiest ways is to use &lt;a href=&quot;http://windowslivewriter.spaces.live.com/&quot; target=&quot;_blank&quot;&gt;Microsoft Live Writer&lt;/a&gt;. Once you have that installed you may need a &lt;a href=&quot;http://plugins.live.com/writer/detail/code-snippet-plugin-for-windows-live-writer&quot; target=&quot;_blank&quot;&gt;plug-in&lt;/a&gt; that helps with formatting and highlighting.  &lt;br /&gt;
&lt;br /&gt;
Here is an example with a simple Console Program I made:&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &amp;lt;iostream&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &amp;lt;iomanip&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &amp;lt;string&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; std;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; main()&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;//** Declarations **    &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; hourpay, twoweeks, month, year;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; ans, weeksWorked;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;     string name;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;bool&lt;/span&gt; flag = false; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060;&quot;&gt;  15:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Welcome to the Budget Console&quot;&lt;/span&gt; &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum16&quot; style=&quot;color: #606060;&quot;&gt;  16:&lt;/span&gt;     cout &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum17&quot; style=&quot;color: #606060;&quot;&gt;  17:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Please enter your name: &quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum18&quot; style=&quot;color: #606060;&quot;&gt;  18:&lt;/span&gt;     getline(cin, name);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum19&quot; style=&quot;color: #606060;&quot;&gt;  19:&lt;/span&gt;     system(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;cls&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum20&quot; style=&quot;color: #606060;&quot;&gt;  20:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum21&quot; style=&quot;color: #606060;&quot;&gt;  21:&lt;/span&gt;     cout &amp;lt;&amp;lt; name &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;, How much do you earn per hour: &quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum22&quot; style=&quot;color: #606060;&quot;&gt;  22:&lt;/span&gt;     cin &amp;gt;&amp;gt; hourpay;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum23&quot; style=&quot;color: #606060;&quot;&gt;  23:&lt;/span&gt;     cout &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum24&quot; style=&quot;color: #606060;&quot;&gt;  24:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;How much do you work in a week: &quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum25&quot; style=&quot;color: #606060;&quot;&gt;  25:&lt;/span&gt;     cin &amp;gt;&amp;gt; weeksWorked;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum26&quot; style=&quot;color: #606060;&quot;&gt;  26:&lt;/span&gt;     cout &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum27&quot; style=&quot;color: #606060;&quot;&gt;  27:&lt;/span&gt;     system(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;cls&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum28&quot; style=&quot;color: #606060;&quot;&gt;  28:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum29&quot; style=&quot;color: #606060;&quot;&gt;  29:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;//** Menu **&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum30&quot; style=&quot;color: #606060;&quot;&gt;  30:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;while&lt;/span&gt; (!flag)&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum31&quot; style=&quot;color: #606060;&quot;&gt;  31:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum32&quot; style=&quot;color: #606060;&quot;&gt;  32:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;\t Menu&quot;&lt;/span&gt; &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum33&quot; style=&quot;color: #606060;&quot;&gt;  33:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;1) Calculate how much I earn in 2 weeks.&quot;&lt;/span&gt;&amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum34&quot; style=&quot;color: #606060;&quot;&gt;  34:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;2) Calculate how much I earn in a month.&quot;&lt;/span&gt;&amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum35&quot; style=&quot;color: #606060;&quot;&gt;  35:&lt;/span&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;3) Calculate how much I earn in a year: &quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum36&quot; style=&quot;color: #606060;&quot;&gt;  36:&lt;/span&gt;     cin &amp;gt;&amp;gt; ans;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum37&quot; style=&quot;color: #606060;&quot;&gt;  37:&lt;/span&gt;     cout &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum38&quot; style=&quot;color: #606060;&quot;&gt;  38:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum39&quot; style=&quot;color: #606060;&quot;&gt;  39:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;//** Calculation **&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum40&quot; style=&quot;color: #606060;&quot;&gt;  40:&lt;/span&gt;      twoweeks = hourpay * weeksWorked;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum41&quot; style=&quot;color: #606060;&quot;&gt;  41:&lt;/span&gt;      month = twoweeks * 2;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum42&quot; style=&quot;color: #606060;&quot;&gt;  42:&lt;/span&gt;      year = (twoweeks * 2) * 12;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum43&quot; style=&quot;color: #606060;&quot;&gt;  43:&lt;/span&gt; &amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum44&quot; style=&quot;color: #606060;&quot;&gt;  44:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;//** Outputs **&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum45&quot; style=&quot;color: #606060;&quot;&gt;  45:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ans == 1) {         &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum46&quot; style=&quot;color: #606060;&quot;&gt;  46:&lt;/span&gt;           cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Your Two Weeks Pay: $&quot;&lt;/span&gt; &amp;lt;&amp;lt; twoweeks &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;.00 &quot;&lt;/span&gt; &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum47&quot; style=&quot;color: #606060;&quot;&gt;  47:&lt;/span&gt;           flag = true;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum48&quot; style=&quot;color: #606060;&quot;&gt;  48:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum49&quot; style=&quot;color: #606060;&quot;&gt;  49:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ans == 2) {        &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum50&quot; style=&quot;color: #606060;&quot;&gt;  50:&lt;/span&gt;         cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Your a month Pay: $&quot;&lt;/span&gt; &amp;lt;&amp;lt; month &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;.00 &quot;&lt;/span&gt; &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum51&quot; style=&quot;color: #606060;&quot;&gt;  51:&lt;/span&gt;         flag = true;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum52&quot; style=&quot;color: #606060;&quot;&gt;  52:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum53&quot; style=&quot;color: #606060;&quot;&gt;  53:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ans == 3) {        &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum54&quot; style=&quot;color: #606060;&quot;&gt;  54:&lt;/span&gt;         cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Your a month Pay: $&quot;&lt;/span&gt; &amp;lt;&amp;lt; year &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;.00 &quot;&lt;/span&gt; &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum55&quot; style=&quot;color: #606060;&quot;&gt;  55:&lt;/span&gt;         flag = true;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum56&quot; style=&quot;color: #606060;&quot;&gt;  56:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum57&quot; style=&quot;color: #606060;&quot;&gt;  57:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum58&quot; style=&quot;color: #606060;&quot;&gt;  58:&lt;/span&gt;       cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Invalid Selection&quot;&lt;/span&gt; &amp;lt;&amp;lt; endl;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum59&quot; style=&quot;color: #606060;&quot;&gt;  59:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum60&quot; style=&quot;color: #606060;&quot;&gt;  60:&lt;/span&gt;       }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum61&quot; style=&quot;color: #606060;&quot;&gt;  61:&lt;/span&gt;     system(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;pause&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum62&quot; style=&quot;color: #606060;&quot;&gt;  62:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; 0;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, Courier, Monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum63&quot; style=&quot;color: #606060;&quot;&gt;  63:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/6391712827418739674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2010/01/simple-console-program-code-snippet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/6391712827418739674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/6391712827418739674'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2010/01/simple-console-program-code-snippet.html' title='Simple Console Program &amp; Code Snippet Embeding.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-6175596386898836654</id><published>2009-12-22T16:00:00.000-08:00</published><updated>2010-02-25T06:40:50.775-08:00</updated><title type='text'>Colored Output in C++ Console</title><content type='html'>Greetings!&lt;br /&gt;&lt;br /&gt;I know I&#39;m a day late, but there was a family emergency yesterday.&lt;br /&gt;&lt;br /&gt;Our next topic is colored output in C++.&lt;br /&gt;Have you ever wanted to get away from the boring white text on black background in console output? Well, I have an easy solution for you ;)&lt;br /&gt;&lt;br /&gt;There is a wonderful function called SetConsoleTextAttribute. This function can set the output handle and the colors of the output (background and foreground).&lt;br /&gt;&lt;br /&gt;It is a very easy function to use. Here is an example of the function: &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border: solid 1px silver; cursor: text; margin: 20px 0px 10px 0px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%; direction: ltr; text-align: left;&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; direction: ltr; text-align: left;&quot;&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; direction: ltr; text-align: left;&quot;&gt;BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;First, the function keeps the output to the standard output (cout), then come the colors. There are three options for color in both foreground and background.&lt;br /&gt;&lt;br /&gt;BACKGROUND_RED&lt;/p&gt;&lt;p&gt;BACKGROUND_GREEN&lt;/p&gt;&lt;p&gt;BACKGROUND_BLUE&lt;/p&gt;&lt;p&gt;FOREGROUND_RED&lt;/p&gt;&lt;p&gt;FOREGROUND_GREEN&lt;/p&gt;&lt;p&gt;FOREGROUND_BLUE &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Use these as flags in the second part of the function&#39;s parameters, seperated by vertical lines (Shift+\).&lt;br /&gt;&lt;br /&gt;If you are changing the background or foreground colors, you must also put:&lt;br /&gt;&lt;br /&gt;FOREGROUND_INTENSITY&lt;br /&gt;or&lt;br /&gt;BACKGROUND_INTENSITY&lt;br /&gt;&lt;br /&gt;depending on which color you are changing. The example function above changes the output to a white background (using all colors), with the &quot;default&quot; foreground (black). The color defaults to black when you do not choose it, if you use this function.&lt;br /&gt;&lt;br /&gt;I used this function plenty to make a simulation program that included quizzes. I changed the colors of the incorrect or correct answers to visually stimulate the user.&lt;br /&gt;&lt;br /&gt;One more thing: You need to include the windows.h header for this code to work. Use the following line in your code:&lt;br /&gt;&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border: solid 1px silver; cursor: text; margin: 20px 0px 10px 0px; max-height: 200px; overflow: auto; padding: 4px; width: 97.5%; direction: ltr; text-align: left;&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; direction: ltr; text-align: left;&quot;&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 8pt; line-height: 12pt; border-style: none; color: black; overflow: visible; padding: 0px; width: 100%; margin: 0em; background-color: white; direction: ltr; text-align: left;&quot;&gt;&lt;span style=&quot;color: #cc6633;&quot;&gt;#include&lt;/span&gt; &lt;span style=&quot;color: #006080;&quot;&gt;&quot;windows.h&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I will upload test code when I can and link it to this post.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Until then,&lt;br /&gt;Happy Coding!&lt;br /&gt;kieblera5&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/6175596386898836654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2009/12/colored-output-in-c-console.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/6175596386898836654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/6175596386898836654'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2009/12/colored-output-in-c-console.html' title='Colored Output in C++ Console'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-388623864712902861</id><published>2009-12-14T22:57:00.000-08:00</published><updated>2012-11-25T12:44:25.742-08:00</updated><title type='text'>Intro to HTML with notepad</title><content type='html'>It&#39;s very interesting how a notepad utility can serve as an editor for your website or blog.&lt;br /&gt;
Kiebler5 did a great job by describing the various uses of &quot;namespace&quot; in c++; However, this intro to HTML is intended to give beginners a feel of what programming looks like. (ps. HTML is not a programming laguage, it is a markup language)&lt;br /&gt;
&lt;br /&gt;
HTML is a language for describing web pages.&lt;br /&gt;
&lt;br /&gt;
* HTML stands for Hyper Text Markup Language&lt;br /&gt;
* A markup language is a set of markup tags&lt;br /&gt;
* HTML uses markup tags to describe web pages&lt;br /&gt;
&lt;br /&gt;
I will show you how to create and run a simple html page. [click on images to enlarge]&lt;br /&gt;
Step. 1) Open  notepad.&lt;br /&gt;
(Quick way to open notepad - hit Ctrl + R - and type &quot;notepad&quot; in the dialog box and hit &quot;OK&quot;.)&lt;br /&gt;
Snapshot 1:&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcZ8EIZLzTaAVqbHVCgHWW2NXF6EIO8ihzYuCdrZqi5LN6lCp9fqi2ED_CmzX_ggQIg56QrSP4Iwjqe5YmZfkty5elr3l3QeRb1Xl8i-n1QpBsiKIqJuwd6bMFpeQi6RoTQuuhRxzo-lW/s1600-h/runNotepad.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5415366613070050578&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcZ8EIZLzTaAVqbHVCgHWW2NXF6EIO8ihzYuCdrZqi5LN6lCp9fqi2ED_CmzX_ggQIg56QrSP4Iwjqe5YmZfkty5elr3l3QeRb1Xl8i-n1QpBsiKIqJuwd6bMFpeQi6RoTQuuhRxzo-lW/s400/runNotepad.png&quot; style=&quot;cursor: pointer; display: block; height: 236px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Step. 2) Type your own HTML code or copy this code into your notepad.&lt;br /&gt;
Screenshot 2:&lt;br /&gt;
&lt;a href=&quot;http://farm5.static.flickr.com/4009/4186524843_9b0a7434c2_o.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://farm5.static.flickr.com/4009/4186524843_9b0a7434c2_o.png&quot; style=&quot;cursor: pointer; display: block; height: 236px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;/a&gt;Step. 3) Save the txt file as a .html format. This step is very important. This is because without the HTML extension your  operating system may detect the file as a txt file.&lt;br /&gt;
In snapshot 3, I saved my html code as &quot;simplePage.html&quot;.&lt;br /&gt;
Screenshot 3:&lt;br /&gt;
&lt;a href=&quot;http://farm3.static.flickr.com/2514/4187286464_835bdcb049_o.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://farm3.static.flickr.com/2514/4187286464_835bdcb049_o.png&quot; style=&quot;cursor: pointer; display: block; height: 236px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;/a&gt;Step. 4) Locate your and run your  html file.&lt;br /&gt;
Screenshot 4:&lt;br /&gt;
&lt;a href=&quot;http://farm3.static.flickr.com/2487/4186524859_760c55cc17_o.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://farm3.static.flickr.com/2487/4186524859_760c55cc17_o.png&quot; style=&quot;cursor: pointer; display: block; height: 236px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;/a&gt;Next, Intro to CSS.&lt;br /&gt;
Until then,&lt;br /&gt;
Happy Coding&lt;br /&gt;
Verse316</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/388623864712902861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2009/12/intro-to-hmtl-with-notepad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/388623864712902861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/388623864712902861'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2009/12/intro-to-hmtl-with-notepad.html' title='Intro to HTML with notepad'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcZ8EIZLzTaAVqbHVCgHWW2NXF6EIO8ihzYuCdrZqi5LN6lCp9fqi2ED_CmzX_ggQIg56QrSP4Iwjqe5YmZfkty5elr3l3QeRb1Xl8i-n1QpBsiKIqJuwd6bMFpeQi6RoTQuuhRxzo-lW/s72-c/runNotepad.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-6099148125016856713</id><published>2009-12-14T19:03:00.000-08:00</published><updated>2010-02-24T09:27:09.230-08:00</updated><title type='text'>Namespaces in C++</title><content type='html'>&lt;p&gt;So... The first topic that I would like to discuss the topic of namespaces in C++. What is a namespace? Well, it&#39;s a way to group classes, objects and functions all under one name.&lt;br&gt;&lt;br&gt;For instance:&lt;/p&gt; &lt;div class=&quot;csharpcode-wrapper&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div class=&quot;csharpcode&quot; id=&quot;codeSnippet&quot;&gt; &lt;div class=&quot;csharpcode-wrapper&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;namespace&lt;/span&gt; myNamespace&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; x;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;csharpcode&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre class=&quot;alteven&quot;&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class=&quot;alteven&quot;&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;To access the variable inside the namespace, we can use the code &lt;em&gt;namespace_name::variable_name&lt;/em&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;myNamespace::x&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;So, now that you know somewhat about namespaces, let&#39;s get to the reason that I brought this up. Certain C++ programmers, when using a cout statement, like to use:&lt;/p&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;std::cout&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080&quot;&gt;&quot;Hello World!\n&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;They put the namespace tag of std in front of the cout. A better way to do this is to say at the beginning of the code:&lt;/p&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;namespace&lt;/span&gt; std;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;//more code here&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;cout&amp;lt;&amp;lt;&lt;span style=&quot;color: #006080&quot;&gt;&quot;Hello World!\n&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;This way, you don&#39;t need the std tag. You could see how many extra strokes it would take to put std:: in front of every cin and cout? So, why do people do it? Well, the only real reason is that when you say &quot;using namespace std;&quot;, you are including EVERYTHING in the std namespace. Maybe you don&#39;t want everything to be included. You could always say:&lt;/p&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; std::cout;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;This would replace putting the std:: tag in front of every cout; however, you wouldn&#39;t be using the entire namespace and then you wouldn&#39;t have to worry about possible class name-clashing in the future. See if there is something already named, you can&#39;t make a class with the same name yourself. For instance, if you try to make a Time class, it might not work depending on your include statements. I had this problem once and had to rename the class.&lt;br&gt;&lt;br&gt;Other good things from namespaces to include: There are a lot of different things in the std namespace that can all be found at this link: &lt;a href=&quot;http://www.cplusplus.com/reference/&quot;&gt;http://www.cplusplus.com/reference/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Every one of those items is included when you use the std namespace. The best things, in my opinion, are the functions in cctype. If you include cctype with the following code:&lt;/p&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none&quot;&gt;&lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;#include&lt;/span&gt; &amp;lt;cctype&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;,then you can have access to functions like toupper, tolower, isalpha, isdigit, etc. These functions can tell you about characters and return if the character is a number, letter, space, uppercase, lowercase, etc. and can also change a character from a lower to an upper and vice-versa.&lt;br&gt;&lt;br&gt;Well, there you have it. That&#39;s the low-down on namespaces. Remember, you can create your own namespaces! Just follow the code outlined near the beginning. And if you are one of those people that use std:: before every cout and cin, start using &quot;using std::cout&quot; and &quot;using std::cin&quot; at the beginning of your code after the includes.&lt;br&gt;&lt;br&gt;Next update from me? Changing colors in standard C++ console output :)&lt;br&gt;&lt;br&gt;Until then,&lt;br&gt;Happy Coding,&lt;br&gt;kieblera5&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/6099148125016856713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2009/12/namespaces-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/6099148125016856713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/6099148125016856713'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2009/12/namespaces-in-c.html' title='Namespaces in C++'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4283114781214264259.post-2165932612319477933</id><published>2009-12-14T16:45:00.000-08:00</published><updated>2015-04-01T03:01:28.782-07:00</updated><title type='text'>Welcome!</title><content type='html'>&lt;h3&gt;
#include &quot;Blogger.h&quot;&lt;br /&gt;&lt;br /&gt;using quickIntro lol; &lt;br /&gt;&lt;br /&gt;int codingMonday()&lt;br /&gt;{&lt;br /&gt;cout &amp;lt;&amp;lt; &quot;Welcome to codingMonday!!!&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;cout &amp;lt;&amp;lt; &quot;Brief History: CodingMonday is a day created by two bored college students that happen to like programming\n&quot;;&lt;br /&gt;cout &amp;lt;&amp;lt; &quot;Each Monday, we will discuss a random, yet useful, topic on C++, C#, or any other language or technology&quot;&amp;lt;&amp;lt; endl;&lt;br /&gt;cout &amp;lt;&amp;lt; &quot;These topics will be accompanied with explanations and source code files for you, the reader, so that you can see the actual code instead of just talk and theory.\n&quot;;&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Enjoy,&lt;br /&gt;&lt;br /&gt;Verse316 and kieblera5&lt;br /&gt;&lt;/h3&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingmonday.blogspot.com/feeds/2165932612319477933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingmonday.blogspot.com/2009/12/welcome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/2165932612319477933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4283114781214264259/posts/default/2165932612319477933'/><link rel='alternate' type='text/html' href='http://codingmonday.blogspot.com/2009/12/welcome.html' title='Welcome!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>