<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>British Columbia &#8211; Henry Poon&#039;s Blog</title>
	<atom:link href="https://blog.henrypoon.com/blog/tag/british-columbia/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.henrypoon.com</link>
	<description></description>
	<lastBuildDate>Sun, 20 Apr 2025 04:13:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">83044199</site>	<item>
		<title>Scenic Flight to Powell River</title>
		<link>https://blog.henrypoon.com/blog/2013/12/20/scenic-flight-to-powell-river/</link>
					<comments>https://blog.henrypoon.com/blog/2013/12/20/scenic-flight-to-powell-river/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Fri, 20 Dec 2013 22:47:08 +0000</pubDate>
				<category><![CDATA[north america]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[British Columbia]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Dia]]></category>
		<category><![CDATA[Digital single-lens reflex camera]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Euro]]></category>
		<category><![CDATA[Europe]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Light]]></category>
		<category><![CDATA[Matt]]></category>
		<category><![CDATA[Nap]]></category>
		<category><![CDATA[Over]]></category>
		<category><![CDATA[Pho]]></category>
		<category><![CDATA[Pilot]]></category>
		<category><![CDATA[Plan]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Powell River]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[Simon Fraser University]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Struct]]></category>
		<category><![CDATA[Sunday]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Vancouver]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Wikipedia]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">http://henrypoon.mooo.com/blog/scenic-flight-to-powell-river</guid>

					<description><![CDATA[Six months ago, I had the chance to fly with my friend, Matt, around Vancouver for a little bit. &#160;We flew again, but this time, he took us to Powell River, a small city on the Sunshine Coast in BC, which is about 4 hours north west of Vancouver by car. &#160;As usual, the flight [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Six months ago, I had the chance to fly with my friend, Matt, around Vancouver for a little bit. &nbsp;We flew again, but this time, he took us to Powell River, a small city on the Sunshine Coast in BC, which is about 4 hours north west of Vancouver by car. &nbsp;As usual, the flight was very scenic and this time I attempted to take most of the pictures with my friend&#8217;s DSLR (my first time actually taking scenery shots with one). &nbsp;The &#8220;victim&#8221;, as Matt calls it, was the <a href="http://en.wikipedia.org/wiki/Diamond_DA40" target="_blank" rel="noopener noreferrer">Diamond DA40</a>, a small four-seater airplane.</p>



<p class="wp-block-paragraph">As we lifted off, I got a good aerial shot of Boundary Bay Airport</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950407273681793394" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh4.googleusercontent.com/-T4Iki0tPCEE/UpQX44i0MXI/AAAAAAAATCA/-aq44gOxLmA/s1280/IMG_9661.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">We happened to fly over SFU just because air traffic control instructed Matt to fly this way. Doesn&#8217;t quite look like the prison that everyone seems to think.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950407865881386146" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh6.googleusercontent.com/-aAHTxmmShRo/UpQYbWqM3KI/AAAAAAAATB4/LWZrQLc4zJQ/s1280/IMG_9677.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">Then we flew over the Burrard Inlet toward North Vancouver.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950407895176648978" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh4.googleusercontent.com/-jHE811sm14o/UpQYdDyvGRI/AAAAAAAATCU/41WuInfIclk/s1280/IMG_9678.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">We flew over the water for the next little while and got a view of the Coast Mountains.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950408026297373490" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh5.googleusercontent.com/-aq-N8tyj5io/UpQYksQWkzI/AAAAAAAATCc/HK6RP9NOoWk/s1280/IMG_9686.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">And it turns out, Powell River is not a large city at all. According to Wikipedia, the city has a population of 13,165 (2011).</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950408256906398370" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh6.googleusercontent.com/-CsOQI7ze-E4/UpQYyHV1CqI/AAAAAAAATCk/CYI5Xy6DKwk/s1280/IMG_9693.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">Since we arrived there on Sunday, there was almost nobody on the streets and nothing was open. We couldn&#8217;t go to the tourist info center because of it. It made the small town even smaller. I thought cities completely shutting down on Sundays was a European thing, but apparently not.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950408785219704242" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh6.googleusercontent.com/-L3lUDbUbgDM/UpQZQ3diVbI/AAAAAAAASx8/yvbT3n8IrUU/s1152/IMG_9707.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">It looked like people were still working at the nearby lumber mill though.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950408618636099138" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh3.googleusercontent.com/-P6W5bP3UnO4/UpQZHK46PkI/AAAAAAAASx8/knyxAsXGSxU/s1152/IMG_9703.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">We walked around the time randomly for a bit in the freezing cold, and then flew back as the sun set. I managed to capture a picture of rays of light coming through the clouds. If I knew how to work the DSLR better, I might have been able to capture an even better picture.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950409283921748642" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh3.googleusercontent.com/-3xopWDjNFFc/UpQZt5RXoqI/AAAAAAAATC0/7DWuYUjF3-c/s1280/IMG_9736.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">On the coast of Vancouver Island, I managed to snap a picture of some low lying clouds in the distance over some small islands.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950409318005303394" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh5.googleusercontent.com/-N8SJ-miyc9Q/UpQZv4PhaGI/AAAAAAAASx8/1BwDGco-xyM/s1152/IMG_9737.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">Another shot of the sunset on our way back.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/PowellRiver#5950409412783193810" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh3.googleusercontent.com/-6BB_7urnDyg/UpQZ1ZUVPtI/AAAAAAAATDE/h6hLvnkOn9g/s1280/IMG_9744.JPG?w=1280&#038;ssl=1" alt=""/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">On the way back, Matt even let me take control of the stick for a bit. This time I was a lot more comfortable using the joystick unlike last time. I managed to maintain the desired altitude without the plane screaming at me and I even stayed on the correct heading! This is why Matt&#8217;s the pilot and not me.</p>



<p class="wp-block-paragraph">More photos <a href="https://photos.google.com/share/AF1QipPvS0i2pdxQvMw2ZmZlIaQhOjc_qOtGM6iqXFWwM-6hN-IEDnXUXOKVa-g19WiQNw?key=QzJTMDUzVmZwUmR5NUxwZi11T1hRSWRrem9ZaU9B" target="_blank" rel="noreferrer noopener">here</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2013/12/20/scenic-flight-to-powell-river/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1780</post-id>	</item>
		<item>
		<title>RoboCup Small Size League North American Open 2012</title>
		<link>https://blog.henrypoon.com/blog/2012/06/27/robocup-small-size-league-north-american-open-2012/</link>
					<comments>https://blog.henrypoon.com/blog/2012/06/27/robocup-small-size-league-north-american-open-2012/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Wed, 27 Jun 2012 21:57:07 +0000</pubDate>
				<category><![CDATA[engineering]]></category>
		<category><![CDATA[9]]></category>
		<category><![CDATA[British Columbia]]></category>
		<category><![CDATA[Canada]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[China]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Competition]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Drive]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Erlangen]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Final]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[Firmware]]></category>
		<category><![CDATA[Flag]]></category>
		<category><![CDATA[Force]]></category>
		<category><![CDATA[friedrich alexander universität]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[German]]></category>
		<category><![CDATA[Germany]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[Hex]]></category>
		<category><![CDATA[Hole]]></category>
		<category><![CDATA[Human behavior]]></category>
		<category><![CDATA[Humanoid Robots Evolution]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[ise]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Lag]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Light]]></category>
		<category><![CDATA[Literature]]></category>
		<category><![CDATA[London]]></category>
		<category><![CDATA[Lost]]></category>
		<category><![CDATA[Mech]]></category>
		<category><![CDATA[Mecha]]></category>
		<category><![CDATA[Mexico]]></category>
		<category><![CDATA[Mexico City]]></category>
		<category><![CDATA[Over]]></category>
		<category><![CDATA[Pho]]></category>
		<category><![CDATA[Plan]]></category>
		<category><![CDATA[Project management]]></category>
		<category><![CDATA[puffin]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[RoboCup]]></category>
		<category><![CDATA[robocup competition]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[Science in popular culture]]></category>
		<category><![CDATA[Scope]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Stairs]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Struct]]></category>
		<category><![CDATA[Student]]></category>
		<category><![CDATA[Sunday]]></category>
		<category><![CDATA[Team]]></category>
		<category><![CDATA[The Battery]]></category>
		<category><![CDATA[The Organ]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[thunder]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[tuna]]></category>
		<category><![CDATA[universität erlangen nürnberg]]></category>
		<category><![CDATA[University of British Columbia]]></category>
		<category><![CDATA[Vancouver]]></category>
		<category><![CDATA[Vol]]></category>
		<category><![CDATA[Voltage]]></category>
		<category><![CDATA[Week]]></category>
		<category><![CDATA[Woke]]></category>
		<category><![CDATA[Z]]></category>
		<category><![CDATA[Zhejiang]]></category>
		<category><![CDATA[Zhejiang University]]></category>
		<guid isPermaLink="false">http://henrypoon.mooo.com/blog/robocup-small-size-league-north-american-open-2012</guid>

					<description><![CDATA[From 9 to 16 June, the RoboCup Small Size League North American Open 2012 was held in Vancouver, Canada at the University of British Columbia. &#160;There were three participating teams: Thunderbots (University of BC, Vancouver, Canada), ER-Force (Friedrich-Alexander-Universität Erlangen-Nürnberg,&#160;Erlangen, Germany), and ZJUNLict (Zhejiang University, Zhejiang, China). &#160;This was the chance for these three teams to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">From 9 to 16 June, the <a class="zem_slink" title="RoboCup" href="http://en.wikipedia.org/wiki/RoboCup" target="_blank" rel="wikipedia noopener noreferrer">RoboCup</a> Small Size League North American Open 2012 was held in Vancouver, Canada at the University of British Columbia. &nbsp;There were three participating teams: Thunderbots (<a class="zem_slink" title="University of British Columbia" href="http://maps.google.com/maps?ll=49.2669222222,-123.247466667&amp;spn=0.01,0.01&amp;q=49.2669222222,-123.247466667 (University%20of%20British%20Columbia)&amp;t=h" target="_blank" rel="geolocation noopener noreferrer">University of BC</a>, Vancouver, Canada), ER-Force (<a class="zem_slink" title="University of Erlangen-Nuremberg" href="http://maps.google.com/maps?ll=49.597,11.007&amp;spn=1.0,1.0&amp;q=49.597,11.007 (University%20of%20Erlangen-Nuremberg)&amp;t=h" target="_blank" rel="geolocation noopener noreferrer">Friedrich-Alexander-Universität Erlangen-Nürnberg</a>,&nbsp;Erlangen, Germany), and ZJUNLict (<a class="zem_slink" title="Zhejiang University" href="http://maps.google.com/maps?ll=30.2636111111,120.120833333&amp;spn=0.01,0.01&amp;q=30.2636111111,120.120833333 (Zhejiang%20University)&amp;t=h" target="_blank" rel="geolocation noopener noreferrer">Zhejiang University</a>, Zhejiang, China). &nbsp;This was the chance for these three teams to pit their robots against each other in preparation for the even bigger RoboCup competition in Mexico City.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/design.engineering.ubc.ca/files/2011/10/EDC-cropped-small.jpg?w=1280&#038;ssl=1" alt=""/></figure>



<h1 class="wp-block-heading">Beginning of the Competition</h1>



<p class="wp-block-paragraph">On the first day of the competition, there was a work day for all the teams to use to get their robots ready again after a long flight to Canada. &nbsp;As the current mechanical team lead for the Thunderbots, I too had to get our own robots ready to play. &nbsp;The mechanical systems had already been completed some weeks ago, but unfortunately, even now, the electrical board testing and firmware coding still had not been completed yet and some parts that we needed were still not in. &nbsp;For the next day and a half, the team was scrambling to get everything finished in preparation for the first game on Sunday. &nbsp;Because, the only critical tasks remaining were the electrical testing and coding, only the electrical team had the know-how to tackle those tasks. &nbsp;The mechanical and software teams could only wait for results. &nbsp;As the electrical team worked, everybody else on the team became more and more stressed. &nbsp;We all kept wondering whether the team would have working robots for the first game. &nbsp;We were all helpless in this situation. &nbsp;The electrical team worked throughout the day and night trying to finish. &nbsp;Some of the other team members stayed in anticipation while others went home to rest hoping for results in the morning.</p>



<p class="wp-block-paragraph">Throughout this work day, the Chinese team continued testing their robots on the field. &nbsp;They seemed like the most ready team. &nbsp;The German team however, had lots of work to do as well. &nbsp;Their flight to London from Germany was delayed and as a result, they missed their flight from London to Vancouver. &nbsp;They arrived in Vancouver on Saturday night. &nbsp;They &nbsp;had even less time than we did to get their robots working. &nbsp;When each team set up their work space, they each made sure to put up their mascots. &nbsp;For the Chinese team, they had a panda plush of about 1.5 ft tall and the Germans had a full size German flag.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409322088030514" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh4.googleusercontent.com/-OBIdp4ameUE/T-n6xOJa4TI/AAAAAAAAGVA/diAZMRHAeds/s720/2012-06-10%252020.57.49.jpg?w=1280&#038;ssl=1" alt="" title="ZJUNLict's mascot"/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<h1 class="wp-block-heading">Game Days</h1>



<p class="wp-block-paragraph">On the game day, I woke at up 5:30 AM and arrived bright and early on campus at 8 AM. &nbsp;When I arrived, the electrical team was still at it and seemingly not even close to finishing. &nbsp;This led to a change in the team&#8217;s strategy to the competition. &nbsp;We would try to repair the electrical boards from last year&#8217;s robots. &nbsp;These old boards had a different size than the new ones and had different mounting holes, but luckily, somebody on the team had the great idea of including mounting holes for these old boards for this year&#8217;s robots. &nbsp;Otherwise, we would have had a really hard time hacking that together. &nbsp;Given only the few hours we had to hack this set up together, the mech team and I worked as fast as we could to finish. &nbsp;We each probably ran up and down the stairs at the UBC Engineering Design Center about 20 times that day looking for tools and delivering robots.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409159532132882" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh5.googleusercontent.com/-JBZL1uGRMq4/T-n6nwlEuhI/AAAAAAAAGUU/1GTz2IKrVLI/s1024/2012-06-10%252015.59.43.jpg?w=1280&#038;ssl=1" alt="" title="Three robots working so far..."/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">The first game was supposed to be at 9:30 AM, but my team certainly was not ready. &nbsp;It seemed like the other teams weren&#8217;t completely ready either, so the game was postponed until the afternoon. &nbsp;The Thunderbots was supposed to play the first game, but due to our lack of readiness, China and Germany played each other instead. &nbsp;When it became our turn we play, we managed to get three robots out of six on the field. &nbsp;None of these robots had a working break beam sensor (the sensor on the robot that is designed to detect ball possession). &nbsp;Without break beams, the robots did not know they could kick the ball, since it would never know if it had ball possession. &nbsp;The robots did not have a controller that worked well either (the controller determines how much voltage to apply to each of the motors such that the robot can move smoothly from A to B). &nbsp;A controller that didn&#8217;t work well meant the robots drove about on the field seemingly confused. &nbsp;&#8220;Derp&#8221; is probably the best word to describe it. &nbsp;Despite the shortcomings of these three robots, they played their best against ZJUNLIct from China and the Thunderbots were defeated 10-0.</p>



<p class="wp-block-paragraph">On the following few days, the mech team tried to help the electrical team the best they could with tasks such as building extra connectors. &nbsp;We also tried to get the old break beam sensors working again. &nbsp;It was something that had to be on the robot if it were to ever kick the ball properly. &nbsp;After toiling for a few hours, we managed to get two out of three of them working. &nbsp;We probably could have gotten more if we knew more about the electrical design. &nbsp;There was little to go on in terms of the wiring schematic and spare parts. &nbsp;It was also hard to troubleshoot since ambient lighting largely affected the sensor. &nbsp;If it worked upstairs in our work space, it wouldn&#8217;t work downstairs on the playing field. &nbsp;It took us a while to figure that out.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409410428513954" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh6.googleusercontent.com/-cl0rDbWpRmQ/T-n62XPbrqI/AAAAAAAAGVg/OnQtBcCgvKM/s1024/IMG_6469.JPG?w=1280&#038;ssl=1" alt="" title="Break beam sensor mount"/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<p class="wp-block-paragraph">In our second game, we played against ER-Force from Deutschland. &nbsp;For this game, we still only had three robots, but this time they were a little bit better equipped. &nbsp;Even then, the robots still had trouble kicking because the lights being used on the field emitted too much infrared light, which obstructed the break beam sensors. &nbsp;It was very frustrating to see the robots not knowing when to kick even though they were handling the ball perfectly. But somehow, we still managed to score a goal. &nbsp;In the end we lost the game 6 to 1.</p>



<p class="wp-block-paragraph">In the final game between China&#8217;s ZJUNLict and Germany&#8217;s ER-Force, the Chinese team was victorious. &nbsp;Both teams had a full fleet of robots to play six on six. &nbsp;A modest crowd of spectators also watched the whole game being played and in general people were quite impressed at this engineering feat.</p>


<div class="wp-block-image">
<figure class="aligncenter is-resized"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409494133610066" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh4.googleusercontent.com/-ml3EBYiXDLs/T-n67PESFlI/AAAAAAAAGV4/vqoVgQ3YP0s/s1024/2012-06-12%252017.11.20.jpg?w=1280&#038;ssl=1" alt="" style="width:840px;height:630px" title="ZJUNLict VS ER-Force"/></a></figure>
</div>


<p class="has-text-align-center wp-block-paragraph"></p>



<h1 class="wp-block-heading">Team Social</h1>



<p class="wp-block-paragraph">To allow the teams to better know one another, there was a social event planned by the organizers of the North American Open. &nbsp;There, I met a lot of the members of the German and Chinese teams. &nbsp;It was nice that that I could talk to each team in their native languages. &nbsp;Although my German wasn&#8217;t that good to keep up a conversation for a long time, it was enough to get the Germans wondering how I knew it at all. &nbsp;The last thing they&#8217;d expect is for a Chinese guy to start speaking German to them. &nbsp;My Mandarin was at a level that I could talk to people in it, but there were still some occasions where I didn&#8217;t understand what they said. &nbsp;It was probably because of me not having a lot of practice with Mandarin (I speak Cantonese normally) and them having an accent from their region that I didn&#8217;t recognize.</p>



<h1 class="wp-block-heading">Press Conference</h1>



<p class="wp-block-paragraph">The organizers made sure to invite as much of the press as they could. &nbsp;More publicity meant that the team could potentially get more money in sponsorship. &nbsp;More money means better robots. &nbsp;The administrative members of the team were in the spotlight and talked to most of the people from the press, while the technical members of the team continued to do their work. &nbsp;The team leads from mech, software and electrical also had a brief interview with the 24 Hours Vancouver newspaper. &nbsp;The team was also featured in the Ubbyssey <a rel="noopener noreferrer" href="http://www.youtube.com/watch?v=EtJr4VRkEbY&amp;feature=youtu.be" target="_blank">here</a>&nbsp;and on MacLean&#8217;s magazine <a href="https://www.macleans.ca/society/science/video-the-robot-version-of-euro-2012/" target="_blank" rel="noreferrer noopener">here</a>.</p>



<p class="wp-block-paragraph">The Chinese team also put on a show for the press by putting all 12 of their robots on the field so they could they play against themselves six on six. &nbsp;The performance went quite smoothly as there were not random break downs and the press were very impressed.</p>



<h1 class="wp-block-heading">Engineering Failures</h1>



<p class="wp-block-paragraph">As with these student projects, an accident was bound to happen. &nbsp;This one was with a battery. &nbsp;There was have been a defective battery that the Chinese team unknowingly brought and when they charged it, the battery started puffing up &#8211; not a good sign for a battery. &nbsp;One of our team members was quick to notice and instantly dunked it in soap water and disposed of it.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409233257529122" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh6.googleusercontent.com/-dqZIo6vvNJw/T-n6sDOk_yI/AAAAAAAAGUo/xOEm5RTzTtk/s720/2012-06-10%252018.14.26.jpg?w=1280&#038;ssl=1" alt="" title="LiPo battery in soap water"/></a></figure>
</div>


<p class="wp-block-paragraph">For our team, we had problems where the solenoid kicker would get stuck after being used repetitively. &nbsp;Heat from the power dissipation in the solenoid windings would heat up the whole assembly and cause the solenoid housing to permanently deform. &nbsp;The solenoid was produced out of stacked layers of&nbsp;poly-carbonate&nbsp;sheets. &nbsp;This stacking of layers allowed each layer to deform individually. &nbsp;To fix this problem, we printed out new housings made of ABS plastic. &nbsp;By having one solid solenoid housing, it was more difficult for it to deform.</p>



<figure class="wp-block-image"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409620210048882" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh3.googleusercontent.com/-tJi9w9vsdH8/T-n7CkvP33I/AAAAAAAAGWg/X3yEDaDSwD4/s1024/2012-06-15%252010.52.31.jpg?w=1280&#038;ssl=1" alt="" title="Solenoid warping"/></a></figure>



<figure class="wp-block-image"><a href="https://picasaweb.google.com/117972094293741244551/RoboCupNorthAmericanOpen#5758409664266399922" target="_blank" rel="noreferrer noopener"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/lh4.googleusercontent.com/-Sa6aEXretIU/T-n7FI3GcLI/AAAAAAAAGWo/mv8nKIm2dGw/s1024/2012-06-15%252010.52.37.jpg?w=1280&#038;ssl=1" alt="" title="3D printed winding"/></a></figure>



<p class="has-text-align-center wp-block-paragraph"></p>



<p class="has-text-align-left wp-block-paragraph">The German team had some problems with the turf getting dug out of the carpet and getting everywhere inside the problem and also with their robot shells not staying on properly. &nbsp;The turf inside the robot meant that gears could get stuck intermittently and could also get in the way of other mechanical components. &nbsp;Their solution solution for now was to clean it all out every game. &nbsp;During games, the shells of the robot would pop out randomly whenever there was an intense impact with a ball or another robot.</p>



<h1 class="wp-block-heading">Getting Ready for Mexico</h1>



<p class="wp-block-paragraph">On the Friday before all three teams left for Mexico City, everybody had to pack up all of their things. &nbsp;The German and Chinese teams could pack everything easily since they had packed everything once before when they had to fly to Vancouver. &nbsp;For us, our tools were scattered all over the place. &nbsp;It took us about 4 hours to find all tools to pack into the the luggage containers. &nbsp;The approach to packing was that we would pack any tool that was ours and was already lying out on the table. &nbsp;This is because if we took it out of the tool closet, it meant that the team used it for something. &nbsp;Naturally all of the hex keys, screw drivers and the like were packed. &nbsp;All spare parts were packed. &nbsp;Every tool that we had sitting around was packed. &nbsp;Even electrical equipment like a power supply and an oscilloscope was packed. &nbsp;We had everything we needed for RoboCup 2012 in Mexico City. &nbsp;Even though not everything was done in time for this competition, everybody was confident that things would be better in the competition in Mexico.</p>



<p class="wp-block-paragraph">More photos <a href="https://photos.google.com/share/AF1QipO8nu-4pMZ9jFTHgrzQfAFiAfAYkRitCki3r6wat0nEHgnez-lfz2SNwdjLEUHETw?key=UjBWUXYtRmZBRlFtY3VWeGdTZDRRejJEOEx6Vm5B" target="_blank" rel="noreferrer noopener">here</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2012/06/27/robocup-small-size-league-north-american-open-2012/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1467</post-id>	</item>
		<item>
		<title>Description of C++ Keywords</title>
		<link>https://blog.henrypoon.com/blog/2010/01/18/description-of-c-keywords/</link>
					<comments>https://blog.henrypoon.com/blog/2010/01/18/description-of-c-keywords/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Tue, 19 Jan 2010 04:44:44 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[9]]></category>
		<category><![CDATA[Assembly language]]></category>
		<category><![CDATA[British Columbia]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[C++ classes]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Compilers]]></category>
		<category><![CDATA[Computer languages]]></category>
		<category><![CDATA[Const]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Data types]]></category>
		<category><![CDATA[Dia]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[ise]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Lie]]></category>
		<category><![CDATA[Monday]]></category>
		<category><![CDATA[Nature]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Outside]]></category>
		<category><![CDATA[Over]]></category>
		<category><![CDATA[Parameter]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Programming languages]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Scope]]></category>
		<category><![CDATA[Sizeof]]></category>
		<category><![CDATA[Speed]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Struct]]></category>
		<category><![CDATA[Sunday]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Typedef]]></category>
		<category><![CDATA[Typename]]></category>
		<category><![CDATA[UNC]]></category>
		<category><![CDATA[University of British Columbia]]></category>
		<category><![CDATA[Variable]]></category>
		<category><![CDATA[Virtual function]]></category>
		<category><![CDATA[Vol]]></category>
		<category><![CDATA[Week]]></category>
		<category><![CDATA[Words]]></category>
		<category><![CDATA[ypres]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">http://henrypoon.mooo.com/blog/description-of-c-keywords</guid>

					<description><![CDATA[Source: The University of British Columbia asm (seldom used) Used to insert assembly language commands directly into the code. This function is very tricky to use even for professional programmers and can cause portability issues. asm(&#8220;instruction&#8221;); auto Used to declare local variables but is purely optional. auto int i = 5; The previous declaration thus [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Source: The University of British Columbia</p>
<p><strong><code>asm</code></strong> (seldom used)</p>
<ul>
<li>Used to insert assembly language commands directly into the code. This function      is very tricky to use even for professional programmers and can cause portability      issues.<br />
<blockquote><p>asm(&#8220;instruction&#8221;);</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="auto"></a>auto</code></strong></p>
<ul>
<li>Used to declare local variables but is purely optional.<br />
<blockquote><p>auto int i = 5;</p></blockquote>
<p>The previous declaration thus has identical meaning to the following declaration.</p>
<blockquote><p>int i = 5;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="bool"></a>bool</code></strong> (C++ only)</p>
<ul>
<li>Used to declare a Boolean logic variable; a variable that can have the value      true or false. This variable type      is normally 8 bits (1 byte) long.<br />
<blockquote><p>bool t = true;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="break"></a>break</code></strong></p>
<ul>
<li>Used to break out of a loop independant of the loop condition. Also, used      to finish a switch statement, keeping the program from      &#8220;falling through&#8221; to the next case in the code.<br />
<blockquote>
<pre>while(x &lt; 100)
{
    if(x &lt; 0)
         break;
    cout &lt;&lt; x &lt;&lt; endl;
    x++;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="case"></a>case</code></strong></p>
<ul>
<li>Used as a label to declare a single test in a switch statement.<br />
<blockquote>
<pre>case 1: command1;
        command2;
        break;
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="catch"></a>catch</code></strong> (C++ only)</p>
<ul>
<li>Used to handle exceptions generated by a throw statement.<br />
<blockquote>
<pre>catch(const char* e)
{
    //handle exception
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="char"></a>char</code></strong></p>
<ul>
<li>Used to declare character variables. This variable type is normally 8 bits      (1 byte) long.<br />
<blockquote><p>char c = &#8216;h&#8217;;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="class"></a>class</code></strong> (C++ only)</p>
<ul>
<li>Used to define a new class. Members of the class are private by default unless listed under the protected or public labels.<br />
<blockquote>
<pre>class class-name : inheritance-list
{
    public:
        public-members-list;
    protected:
        protected-members-list;
    private:
        private-members-list;
} object-list;
</pre>
</blockquote>
<ul>
<li>class-name is the name of the class that is being created.</li>
<li>inheritance-list is the optional list of classes inherited by the new          class.</li>
<li>public-members-list is the list of public members          of the class.</li>
<li>protected-members-list is the list of protected members of the class.</li>
<li>private-members-list is the list of private members          of the class.</li>
<li>object-list is an optional list used to immediately instantiate 1 or          more instances of the class.</li>
</ul>
<blockquote>
<pre>class Date
{
public:
    void display();

private:
    int day;
    int month;
    int year;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="const"></a>const</code></strong> (C++ only)</p>
<ul>
<li>Used to tell the compiler that a certain object should not be modified once      it has been initialized.<br />
<blockquote><p>const int i = 5;</p></blockquote>
</li>
<li>Used to declare a pointer so that the value of the pointer (the memory     location to which it points)     <span style="text-decoration:underline;">can</span> be modified, but the data in the memory location <span style="text-decoration:underline;">cannot</span> be changed.<br />
<blockquote><p>const int* j = new int(3);</p></blockquote>
</li>
<li>Used to declare a pointer so the that value of the pointer (the memory     location to which it points)     <span style="text-decoration:underline;">cannot</span> be modified, but the data in that memory location <span style="text-decoration:underline;">can</span> be changed.<br />
<blockquote><p>int* const j = new int(3);</p></blockquote>
</li>
<li>Used to declare a member function that does not modify the object&#8217;s state,      meaning that it should be used for methods like print so that data in the     object cannot      be changed accidentally. If and attempt is made     to modify the object in any way, a compilation error will be triggered.<br />
<blockquote><p>void print(bool verbose) const;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="const_cast"></a>const_cast</code></strong> (C++ only, seldom used)</p>
<ul>
<li>Used to remove the const protection on a variable as      long as the original variable was not declared as a const.      The target type must be the same as the original type.<br />
<blockquote><p>const_cast&lt;target_type&gt; (object);</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="continue"></a>continue</code></strong></p>
<ul>
<li>Used to jump to the next iteration of a loop. The following example will      print out all of the numbers from 1 to 20 except for 10.<br />
<blockquote>
<pre>for(int i = 0; i &lt; 21; i++)
{
    if(i == 10)
        continue;
    cout &lt;&lt; i &lt;&lt; endl;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="default"></a>default</code></strong></p>
<ul>
<li>Used as a label to declare the default case of a switch statement.<br />
<blockquote>
<pre>case 1:  command1;
         command2;
         break;

default: command1;
         command2;
         break;
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="delete"></a>delete</code></strong> (C++ only)</p>
<ul>
<li>Used to free memory allocated for a pointer back to the heap. The argument      should have been allocated through a call to new. To delete      an array, use the following form of delete: delete[]<br />
<blockquote>
<pre>delete p;
delete[] pArray;</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="do"></a>do</code></strong></p>
<ul>
<li>Used to create a loop that is executed at least once. The terminating condition      is tested at the end of the loop.<br />
<blockquote>
<pre>do
{
    cout &lt;&lt; "hello worldn";
    i++;
} while(i &lt; 5)
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="double"></a>double</code></strong></p>
<ul>
<li>Used to declare a double-precision floating-point type variable. This variable      type is normally 64 bits (8 bytes) long.<br />
<blockquote><p>double d = 12.55;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="dynamic_cast"></a>dynamic_cast</code></strong> (C++ only, seldom used)</p>
<ul>
<li>Used to cast from one type to another with a check performed at runtime.      If the cast types are incompatible, NULL is returned.<br />
<blockquote><p>dynamic_cast&lt;target_type&gt; (object);</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="else"></a>else</code></strong></p>
<ul>
<li>Used for an alternative condition in an if statement.<br />
<blockquote>
<pre>if(i == 1)
{
    // do something
}
else
{
    // do something else
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="enum"></a>enum</code></strong></p>
<ul>
<li>Used to define an enumerated type. Each of the names in the name-list are      given a distinct value. This should be used in place of defining variables      using &#8220;magic numbers&#8221; (eg. int Monday = 0, int Tuesday = 1, etc).<br />
<blockquote>
<pre>enum name {name-list};</pre>
</blockquote>
<ul>
<li>name is the name of the enumerated type that was created</li>
<li>name-list is the list of names of the elements</li>
</ul>
<blockquote>
<pre>enum weekdays {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday};</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="explicit"></a>explicit</code></strong> (C++ only)</p>
<ul>
<li>Used to make sure that a constructoor is only used for the creation of new      values and not used for the implicit conversion between two different types.      It will only be be used if the initialization exactly matches the call to      that constructor. This keyword is only needed with one-argument constructors.<br />
<blockquote>
<pre>class vector
{
    ...
    explicit vector(int v);
    ...
}
</pre>
</blockquote>
<p>Using this keyword, some mysterious errors can be caught by the compiler like      the following:</p>
<blockquote>
<pre>vector&lt;int&gt; v(10);
v = 5; // error, meant to write v[0] = 5
</pre>
</blockquote>
<p>The problem in this code if the explicit keyword was not specified is that      the v = 5 statement would invoke the constructor, creating a new vector of      size 5 and destroying the old one.</li>
</ul>
<hr>
<p><strong><code><a name="export"></a>export</code></strong> (C++ only, seldom used)</p>
<ul>
<li>Used to export a template to other modules. Most compilers require template      definitions to be explicitly specified in the header file since the Comeau      C++ compiler seems to be the only compiler that supports this keyword.<br />
<blockquote>
<pre>// In MyTemplateFunction.h
template
void myTemplateFunction(const T &amp;t1);

// In MyTemplateFunction.cpp
export template
void myTemplateFunction(const T &amp;t1)
{
    ...
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="extern"></a>extern</code></strong></p>
<ul>
<li>Used to inform the compiler of variables and functions that are defined      outside of the current scope or module. Variables defined as extern will not      have space allocated for them since they are defined elsewhere.<br />
<blockquote><p>extern char* message;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="false"></a>false</code></strong> (C++ only)</p>
<ul>
<li>Used to represent the Boolean value false.<br />
<blockquote><p>bool b = false;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="float"></a>float</code></strong></p>
<ul>
<li>Used to declare a single-precision floating-point type variable. This variable&lt;br&gt;      type is normally 32 bits (4 bytes) long.<br />
<blockquote><p>float f = 3.5;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="for"></a>for</code></strong></p>
<ul>
<li>Used to create a loop that is meant to initialize, test and update a variable.<br />
<blockquote>
<pre>for(int i = 0; i &lt; 10; i++)
{
    cout &lt;&lt; "i is " &lt;&lt; i &lt;&lt; endl;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="friend"></a>friend</code></strong> (C++ only)</p>
<ul>
<li>Used to allow another class or function to have access      to the private features of that class.<br />
<blockquote>
<pre>friend void print(bool verbose);
friend class Vector;</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="goto"></a>goto</code></strong> (seldom used)</p>
<ul>
<li>Used to jump to another location in a function specified by a label. This      is generally considered harmful and should not be used unless necessary.<br />
<blockquote>
<pre>goto labelA;
...
labelA:</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="if"></a>if</code></strong></p>
<ul>
<li>Used to create a conditional branch statement so that different code can      be executed under different conditions. The conditions are evaluated in the      order that they appear in the code.<br />
<blockquote>
<pre>if (i &lt; 0)
{
    cout &lt;&lt; "i is negative";
}
else if(i == 0)
{
    cout &lt;&lt; "i is 0n";
}
else
{
    cout &lt;&lt; "i is posativen";
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="inline"></a>inline</code></strong> (C++ only)</p>
<ul>
<li>Used to tell the compiler that the function an its body are inserted into      the calling code meaning that it has to expand the function in-place instead      of just insert a call to the function. Functions that have static data, loops, switches or recursive calls cannot be inlined.<br />
<blockquote>
<pre>inline int test(int A)
{
    ...
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="int"></a>int</code></strong></p>
<ul>
<li>Used to declare an integer type variable. This variable type is normally        32 bits (4 bytes) long.<br />
<blockquote><p>int i = 3;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="long"></a>long</code></strong></p>
<ul>
<li>Used as a data type modifier for the int and double types to indicate that      they may have more bytes then the type has available. This variable type is      normally 32 or 64 bits (4 or 8 bytes) long.<br />
<blockquote><p>long int i = 100000;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="mutable"></a>mutable</code></strong> (C++ only)</p>
<ul>
<li>Used to specify that it is a data field that can be modified even if another      part of the data is declared const.</li>
</ul>
<hr>
<p><strong><code><a name="namespace"></a>namespace</code></strong> (C++ only)</p>
<ul>
<li>Used to create a new scope. Once created, the namespace must be refered      to either directly or with the using keyword.<br />
<blockquote>
<pre>   namespace CartoonNameSpace
    {
        int HomersAge;

        void incrementHomersAge()
        {
            HomersAge++;
        }
    }
    int main() {
        ...
        CartoonNameSpace::HomersAge = 39;
        CartoonNameSpace::incrementHomersAge();
        cout &lt;&lt; CartoonNameSpace::HomersAge &lt;&lt; endl;
        ...
    }
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="new"></a>new</code></strong> (C++ only)</p>
<ul>
<li>Used to allocate a new block of memory for the given type from the heap,      and return a pointer to that block of memory. Allocating arrays can be done      by providing the size of the array in square brackets.<br />
<blockquote>
<pre>pointer = new type;
pointer = new type( initializer );
pointer = new type[size];</pre>
</blockquote>
<ul>
<li>pointer is a pointer to the type that you want to allocate the memory          for</li>
<li>type is the type of the item that is to be stored in the memory that          is allocated</li>
<li>initializer is the optional information for the constructor</li>
<li>size is the size of the array to create</li>
</ul>
</li>
</ul>
<hr>
<p><strong><code><a name="operator"></a>operator</code></strong> (C++ only)</p>
<ul>
<li>Used to specify that you are overloading an operator.<br />
<blockquote>
<pre>   return-type class-name::operator#(parameter-list)
    {
        ...
    }
</pre>
</blockquote>
<ul>
<li>return-type is the return type for the function</li>
<li>class-name is the name of the class that the operator is a part of.          If it is not part of a class, this can be left out along with the &#8216;<strong>::</strong>&#8216;<strong>.</strong></li>
<li># is the operator that is to be overloaded, such as &#8216;++&#8217;. You cannot          overload the #, ##, ., :, .*, or ? tokens.</li>
<li>parameter-list is the list of parameters that the operator will take.          For unary operators, parameter-list should be empty, and for binary operators,          parameter-list should contain the operand on the right side of the operator          (the operand on the left side is passed as this).</li>
</ul>
</li>
<li>There are special conventions for some operators, such as the unary       ++ and &#8212; operators.
<ul>
<li> The unary ++ operator has both prefix (<code>++object</code> and postfix (<code>object++</code>) versions.</li>
<li>
<blockquote>
<pre>   return-type class-name::operator++()
    {
        ...
    }
</pre>
</blockquote>
<p>overloads the prefix version (the value returned is the        value of the object <span style="text-decoration:underline;">after</span> it is incremented, so this        is also known as the pre-increment version because the        increment takes place <span style="text-decoration:underline;">before</span> the value is returned). There is        no parameter specified because ++ is a unary operator.</li>
<li>
<blockquote>
<pre>   return-type class-name::operator++( int )
    {
        ...
    }
</pre>
</blockquote>
<p>overloads the postfix version (the value returned is the        value of the object <span style="text-decoration:underline;">before</span> it is incremented, so this        is also known as the post-increment version because the        increment takes place <span style="text-decoration:underline;">after</span> the value is returned). The parameter        <code>int</code> is not really a parameter (++ is still a unary        operator) but is there soley to differentiate the prefix and        postfix versions.</li>
</ul>
</li>
</ul>
<hr>
<p><strong><code><a name="private"></a>private</code></strong> (C++ only)</p>
<ul>
<li>Used within a class declaration to specify features of that class that can      only be accessed by itself and its friends.<br />
<blockquote>
<pre>class Date
{
public:
    void display();

private:
    int day;
    int month;
    int year;
}</pre>
</blockquote>
</li>
<li>Used to inherit a base class privately, which causes all public and protected members of the base class to become      private members of the derived class.<br />
<blockquote>
<pre>class AlarmClock : private Clock
{
public:
    void display();

}</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="protected"></a>protected</code></strong> (C++ only)</p>
<ul>
<li>Used within a class declaration to specify features of that class that are      private to its own class, but can be inherited by a      derived class.<br />
<blockquote>
<pre>class Date
{
public:
    void display();
protected:
    int day;
    int month;
    int year;
}</pre>
</blockquote>
</li>
<li>Used to inherit a base class, which causes all public and protected members of the base class to become      protected members of the derived class.<br />
<blockquote>
<pre>class AlarmClock : protected Clock
{
public:
    void display()
}</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="public"></a>public</code></strong> (C++ only)</p>
<ul>
<li>Used within a class declaration to specify features of that class that are      accessable to everyone.<br />
<blockquote>
<pre>class Date
{
public:
    void display();
protected:
    int day;
    int month;
    int year;
}</pre>
</blockquote>
</li>
<li>Used to inherit a base class publically, which causes all public and protected members of the base class to become public and protected members of the derived class.<br />
<blockquote>
<pre>class AlarmClock : public Clock
{
public:
    void display()
}</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="register"></a>register</code></strong></p>
<ul>
<li>Used to reccommend that a varibale be placed into a processor register so      that it is optimized for speed but the compiler is not obliged to do so. This      keyword is rarely used anymore since compilers have become better than programmers      at optimizing code.</li>
</ul>
<hr>
<p><strong><code><a name="reinterpret_cast"></a>reinterpret_cast</code></strong> (C++ only), seldom used</p>
<ul>
<li>Used to change one data type in a non-portable way. It is normally used      to cast between incompatible pointer types.<br />
<blockquote><p>reinterpret_cast&lt;target_type&gt; (object);</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="return"></a>return</code></strong></p>
<ul>
<li>Used to cause the execution to jump from the current function back to the      one that called it. An optional value can be returned but the function must      specify the type that it will return.<br />
<blockquote>
<pre>return;
return 5;</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="short"></a>short</code></strong></p>
<ul>
<li>Used as a data type modifier for the int type to indicate that there may      be less bytes then the type has available. This variable type is normally      16or 32bits (2 or 4bytes) long.<br />
<blockquote><p>short int i = 5;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="signed"></a>signed</code></strong></p>
<ul>
<li>Used to specify that the number type provided could potentially be negative,      so it must be stored in a different format. This is the default representation      that is chosen by most compilers if either signed or unsigned is not specified.<br />
<blockquote><p>signed int i = -12;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="sizeof"></a>sizeof</code></strong></p>
<ul>
<li>Used to return the size of the object (in bytes) that is passed to it.<br />
<blockquote>
<pre>int i = 5;
int size = sizeof( i );</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="static"></a>static</code></strong></p>
<ul>
<li>Used outside any function or class as a qualifier to a variable declaration      makes the scope of the variable the file in which the variable is declared,      and the extent is permanent (i.e., it is in the static segment).<br />
<blockquote><p>static int i;</p></blockquote>
</li>
<li>Used inside a function as a qualifier to a variable declaration makes the        scope of the variable the function in which the variable is declared, and        the extent is permanent (i.e., it is in the static segment).<br />
<blockquote>
<pre>void foo()
{
    static int i;
}</pre>
</blockquote>
</li>
<li>Used inside a class as a qualifier to a variable declaration makes the        scope of the variable the class in which the variable is declared, and the        extent is permanent (i.e., it is in the static segment).<br />
<blockquote>
<pre>class bar
{
    static int i;
}</pre>
</blockquote>
</li>
<li>Used outside any class as a qualifier to a function declaration makes the        scope of the function the file in which the function is declared. As with        all functions, the instructions for the function are in the code segment.<br />
<blockquote>
<pre>static void foo()
{
}</pre>
</blockquote>
</li>
<li>Used inside a class as a qualifier to a function (method) declaration makes        the scope of the function the class in which the function is declared (as        with all methods), and the instructions for the method are in the code       segment (as for all functions). What is different is that a static method       is invoked without requiring an object, using the qualifier syntax       <code>class::staticMethod( <em>parameters</em> )</code>, although it can       also be invoked on an object in the class in the usual way. Because no       object is associated with a static method, only static member variables       and other static member functions can be invoked by a static method.<br />
<blockquote>
<pre>class bar
{
    static void foo();
}</pre>
</blockquote>
<p><strong>Note:</strong> A method in a class cannot be both &#8220;static&#8221;        and &#8220;virtual&#8221;. The reason for this is       that virtual functions have to know the object to which they apply       (because of polymorphism) but static methods are not applied to an       object.</li>
</ul>
<hr>
<p><strong><code><a name="static_cast"></a>static_cast</code></strong> (C++ only, seldom used)</p>
<ul>
<li>Used for a normal conversion between types. No runtime checking is performed.<br />
<blockquote><p>static_cast&lt;target_type&gt; (object);</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="struct"></a>struct</code></strong></p>
<ul>
<li>Used to create a structure like a class, but the members      are public by default instead of private.      In C, structs can only contain data, cannot have inheritance and cannot have      data with different visibilities.<br />
<blockquote>
<pre>struct struct-name : inheritance-list
{
        public-members-list;
    protected:
        protected-members-list;
    private:
        private-members-list;
} object-list;</pre>
</blockquote>
<ul>
<li>struct-name is the name of the struct that is being created.</li>
<li>inheritance-list is the optional list of structs inherited by the new          struct.</li>
<li>public-members-list is the list of public members          of the struct.</li>
<li>protected-members-list is the list of protected members of the struct.</li>
<li>private-members-list is the list of private members          of the struct.</li>
<li>object-list is an optional list used to immediately instantiate 1 or          more instances of the struct.</li>
</ul>
<blockquote>
<pre>struct Date
{
    int day;
    int month;
    int year;
}</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="switch"></a>switch</code></strong></p>
<ul>
<li>Used to test an expression of an integer value against many constant integer      values and is commonly used to replace large if()&#8230;else if()&#8230; statements.      Break statements are required between each case statement, otherwise execution will &#8220;fall-through&#8221; to the next case statement. The default case is optional. If provided,      it will match any case not explicitly covered by the preceding cases in the      switch statement.<br />
<blockquote>
<pre>char keystroke = getch();
switch( keystroke )
{
    case 'a':
    case 'b':
    case 'c':
    case 'd':
        KeyABCDPressed();
        break;
    case 'e':
        KeyEPressed();
        break;
    default:
        UnknownKeyPressed();
        break;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="template"></a>template</code></strong> (C++ only)</p>
<ul>
<li> Used to create generic functions and can operate on data without knowing      the nature of that data. They accomplish this by using a placeholder data-type      for which many other data types can be substituted.<br />
<blockquote>
<pre>template void genericSwap( X &amp;a, X &amp;b )
{
    X tmp;

    tmp = a;
    a = b;
    b = tmp;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="this"></a>this</code></strong> (C++ only)</p>
<ul>
<li>Used as a pointer to the current object. All member functions of a class have this pointer.<br />
<blockquote><p>this.print();</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="throw"></a>throw</code></strong> (C++ only)</p>
<ul>
<li>Used together with try and catch statements to create an exception handling system. Throw is used to generate      an exception.<br />
<blockquote>
<pre>try
{
    cout &lt;&lt; "Before throwing exception"&lt;&lt; endl;
    throw 42;
    cout &lt;&lt; "Shouldn't ever see this"&lt;&lt; endl;
}
catch( int error )
{
    cout &lt;&lt; "Error: caught exception " &lt;&lt; error &lt;&lt; endl;
}
</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="true"></a>true</code></strong> (C++ only)</p>
<ul>
<li>Used to represent the Boolean value true.<br />
<blockquote><p>bool b = true;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="try"></a>try</code></strong> (C++ only)</p>
<ul>
<li>Used to attempt to execute exception-generating code.<br />
<blockquote>
<pre>try
{
    cout &lt;&lt; "Before throwing exception" &lt;&lt; endl;
    throw 42;
    cout &lt;&lt; "Shouldn't ever see this" &lt;&lt; endl;
}
catch( int error )
{
    cout &lt;&lt; "Error: caught exception " &lt;&lt; error &lt;&lt; endl;
}</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="typedef"></a>typedef</code></strong></p>
<ul>
<li>Used to create a new type from an existing type.<br />
<blockquote><p>typedef int seconds;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="typeid"></a>typeid</code></strong> (C++ only, seldom used)</p>
<ul>
<li>Used to get a reference to a type_info object that describes the object      it was passed.<br />
<blockquote><p>typeid(object);</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="typename"></a>typename</code></strong> (C++ only)</p>
<ul>
<li>Used to describe an undefined type or in place of the class keyword in a      template declaration.</li>
</ul>
<hr>
<p><strong><code><a name="union"></a>union</code></strong></p>
<p>Used to create multiple data fields that will occupy the same memory location.</p>
<blockquote>
<pre>union Data
{
    int i;
    char c;
};
</pre>
</blockquote>
<hr>
<p><strong><code><a name="unsigned"></a>unsigned</code></strong></p>
<ul>
<li>Used to specify that the int or char provided can only be posative and can      therefore contain a larger number since there is no need to worry about representation      of negative numbers.<br />
<blockquote><p>signed int i = -12;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="using"></a>using</code></strong> (C++ only)</p>
<ul>
<li>Used to import a namespace into the current scope.<br />
<blockquote><p>using namespace std;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="virtual"></a>virtual</code></strong> (C++ only)</p>
<ul>
<li>Used to create virtual functions that can be overridden by derived functions.
<ul>
<li>A virtual function indicates that a function can be overridden in a          subclass, and that the overridden function will actually be used.</li>
<li>When a base object pointer points to a derived object that contains          a virual function, the decision about which version of that function to          call is based on the type of object pointed to by the pointer, and this          process happens at runtime.</li>
<li>A base object can point to different derived objects and have different          versions of the virual function run.</li>
</ul>
<blockquote><p>virtual void print();</p></blockquote>
</li>
<li>Used to create a <span style="text-decoration:underline;">pure virtual function</span> which is a virtual function that      <em> <strong>must</strong></em> be overriden by some derived class.<br />
<blockquote><p>virtual void print() = 0;</p></blockquote>
</li>
<li><strong>Note:</strong> A method in a class cannot be both &#8220;virtual&#8221;        and &#8220;static&#8221;.</li>
</ul>
<hr>
<p><strong><code><a name="void"></a>void</code></strong></p>
<ul>
<li>Used to denote functions that return no value.<br />
<blockquote>
<pre>void print()
{
    cout &lt;&lt; "printn";
}
</pre>
</blockquote>
</li>
<li> Used to create generic variables which can point to any type of data.<br />
<blockquote>
<pre>void *p = 5;
</pre>
</blockquote>
</li>
<li>Used to declare an empty parameter list.<br />
<blockquote>
<pre>void print( void )
{
    cout &lt;&lt; "printn";
}</pre>
</blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="volatile"></a>volatile</code></strong></p>
<ul>
<li>Used to inform the compiler that the variables value can change in unexpected      ways (i.e. through an interrupt), which could conflict with optimizations      that the compiler might perform, so therefore the compiler will not optimize      these variables.<br />
<blockquote><p>volatile Date d;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="wchar_t"></a>wchar_t</code></strong></p>
<ul>
<li>Used to declare a wide character variable. This variable type is normally      16 bits (2 bytes) long.<br />
<blockquote><p>wchar_t c = &#8216;c&#8217;;</p></blockquote>
</li>
</ul>
<hr>
<p><strong><code><a name="while"></a>while</code></strong></p>
<ul>
<li> Used as a looping construct that will evaluate a list of statements as      long as the condition is true. Note: if the condition      starts off as false, the list of statements will never      be executed. (You can use a do loop to guarantee that the      list of statements will be executed at least once.)<br />
<blockquote>
<pre>bool done = false;
while( !done )
{
    ProcessData();
    if( StopLooping() )
    {
        done = true;
    }
}</pre>
</blockquote>
</li>
</ul>
<hr>
<p>Copyright (C) 2000-2005, The University of British Columbia</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2010/01/18/description-of-c-keywords/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">201</post-id>	</item>
		<item>
		<title>Caught A Cold</title>
		<link>https://blog.henrypoon.com/blog/2009/11/21/caught-a-cold/</link>
					<comments>https://blog.henrypoon.com/blog/2009/11/21/caught-a-cold/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sat, 21 Nov 2009 06:52:00 +0000</pubDate>
				<category><![CDATA[gaming]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[British Columbia]]></category>
		<category><![CDATA[Classes of computers]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Dota]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Final]]></category>
		<category><![CDATA[Gary]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[God]]></category>
		<category><![CDATA[Goddamn]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Laptop]]></category>
		<category><![CDATA[Nap]]></category>
		<category><![CDATA[Plug]]></category>
		<category><![CDATA[Simon Fraser University]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tylenol]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">http://henrypoon.mooo.com/blog/caught-a-cold</guid>

					<description><![CDATA[Been feeling something coming down on me for the past couple days.&#160; Yesterday it finally manifested itself.&#160; I&#8217;ve apparently caught a cold.&#160; Took some tylenol, and been sneezing all day.&#160; Being sleepy didn&#8217;t help either.&#160; I had the worst nap on the West Coast Express too.&#160; I felt pretty sick throughout the day, so I [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Been feeling something coming down on me for the past couple days.&nbsp; Yesterday it finally manifested itself.&nbsp; I&#8217;ve apparently caught a cold.&nbsp; Took some tylenol, and been sneezing all day.&nbsp; Being sleepy didn&#8217;t help either.&nbsp; I had the worst nap on the West Coast Express too.&nbsp; I felt pretty sick throughout the day, so I left early.&nbsp; I then went to SFU to visit Gary.&nbsp; SFU does indeed look very depressing.&nbsp; I know I shouldn&#8217;t be doing that since I was sick, but getting up and walking around made me feel a little bit better.&nbsp; Played DotA there until my computer ran out of batteries.&nbsp; I would have plugged in my laptop if I had found a plug.&nbsp; It was a goddamn computer lab, and there was not a single plug in sight.&nbsp; The ones that the computers were using were kept confined behind and under the desk.&nbsp; I could not get to it.&nbsp; We left at about 4:45 and got to Coquitlam Station at around 5:15 to get a ride back home.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2009/11/21/caught-a-cold/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">25</post-id>	</item>
	</channel>
</rss>
