<?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: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-4623244905769687779</id><updated>2011-11-27T20:27:35.438-05:00</updated><category term='Themes'/><category term='Music'/><category term='OOP344'/><title type='text'>Blog?</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://victran.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-8630164648895298322</id><published>2009-12-08T06:26:00.003-05:00</published><updated>2009-12-08T06:30:22.305-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>Pre-production and planning your program</title><content type='html'>&lt;p&gt;In a perfect world, time is not equal money, and you could have all the time in the world to finish your programs or projects.&lt;span style=""&gt;  &lt;/span&gt;Sadly that’s not the case.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;Its interesting looking at the ways we are able to create our programs, but which way is more efficient?&lt;span style=""&gt;  &lt;/span&gt;There are two common styles that I’ve run into, one called iterative design, and the waterfall process.&lt;span style=""&gt;  &lt;/span&gt;I’m not gonna lie I had to Google waterfall process, because I couldn’t remember what the process was called with pre-production and planning actually required.&lt;span style=""&gt;  &lt;/span&gt;I prefer the waterfall process because it seems far more organized, and I’ll explain why.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;I think as students, we’ve all experienced iterative design, so I’ll get to that later.&lt;span style=""&gt;  &lt;/span&gt;The proper waterfall process would include analyzing your problem, designing your solution, creating your solution, to testing, implementing, and maintenance.&lt;span style=""&gt;  &lt;/span&gt;I believe I’m also missing a step in between there somewhere.&lt;span style=""&gt;  &lt;/span&gt;What I like about following these steps is that you can try and eliminate every possibility, every solution for every problem, just by analyzing and planning.&lt;span style=""&gt;  &lt;/span&gt;By the time you get to create your program, you should know roughly what you need to cover before you run into another problem.&lt;span style=""&gt;  &lt;/span&gt;This is not to say that if you plan, everything will go smoothly, as I am probably the biggest walking example of &lt;a href="http://en.wikipedia.org/wiki/Murphy%27s_law"&gt;Murphy’s Law&lt;/a&gt; (“Anything that can go wrong will go wrong”).&lt;span style=""&gt;  &lt;/span&gt;The goal is to cover as much of the base as you can.&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;We can relate this all to the &lt;a href="https://cs.senecac.on.ca/%7Esys366/"&gt;SYS366&lt;/a&gt; class we have, where we learn about business use cases, systems use cases, and so forth.&lt;span style=""&gt;  &lt;/span&gt;We are pushed to try and understand the “bigger picture” when it comes to our programs and such affecting the rest of the business.&lt;span style=""&gt;  &lt;/span&gt;The most useful thing to extract from this is the use case specifications we make in order to define what a system has control over.&lt;span style=""&gt;  &lt;/span&gt;We plan out what it does, what it has control over, who uses it, and what kind of data is used.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;Not only do we need to understand what we’re doing, we should also have a timeline, because as stated before, time is money.&lt;span style=""&gt;  &lt;/span&gt;Organizing “milestones” allow you to gauge the progress of your project come production time.&lt;span style=""&gt;  &lt;/span&gt;Obviously you want to build up to a milestone, so you can set smaller deadlines that affect the completion of a major aspect.&lt;span style=""&gt;  &lt;/span&gt;From there you can set bigger goals, like Alpha, Beta, Final, and Gold stages.&lt;span style=""&gt;  &lt;/span&gt;Without good time management and risk management at this step, you increase the chances of your program/project to blow up in your face.&lt;span style=""&gt;  &lt;/span&gt;Trust me; I’ve witnessed it more than once before already!&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;And while you’re at it, you should be documenting E V E R Y T H I N G!&lt;span style=""&gt;  &lt;/span&gt;The analysis, the design, the scheduling… everything!&lt;span style=""&gt;  &lt;/span&gt;Another important point is that the documents should be readily available to any team member at any time.&lt;span style=""&gt;  &lt;/span&gt;It’s easy to lose yourself while you’re coding or working on some aspect of the project, and the documentation allows you to go back and look at your specifications and other information.&lt;span style=""&gt;  &lt;/span&gt;In a previous &lt;a href="http://victran.blogspot.com/2009/11/long-time-no-blog.html"&gt;post&lt;/a&gt; I mentioned a Technical Design Document(TDD).&lt;span style=""&gt;  &lt;/span&gt;In game design, not only is there a TDD, there’s also a Game Design Document(GDD) amongst a lot of other different documents.&lt;span style=""&gt;  &lt;/span&gt;The GDD essentially holds everything together, and defines every aspect of the game, from programming, to art direction, audio guidelines… everything.&lt;span style=""&gt;  &lt;/span&gt;The TDD is also included here, and it should describe programming conventions, any equations needed, all classes and functions needed… and so forth.&lt;span style=""&gt;  &lt;/span&gt;The one that I “created” for our &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OOP344"&gt;OOP344 &lt;/a&gt;project only had some programming conventions we wanted to implement.&lt;span style=""&gt;  &lt;/span&gt;Even though we didn’t really use it very much, it’s good practice to keep tract of things like that.&lt;span style=""&gt;  &lt;/span&gt;We don’t use the document, but I transferred it to our wiki page for easier access.&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;(On a side, I just made a sandwich consisting of 3 pork sausages, 1 fried egg, a leaf of lettuce, mayonnaise, ketchup, and relish. De-li-cious.)&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNoSpacing"&gt;I guess to conclude, I wanted to point out that the advantage of using the waterfall process is the ability to organize and delegate tasks much easier.&lt;span style=""&gt;  &lt;/span&gt;It allows team members access to resources and documentation, and also allows them to be focused more on implementing rather than worry about the details in the background.&lt;span style=""&gt;  &lt;/span&gt;As mentioned earlier, it gives the entire project a more evenly flow and direction.&lt;span style=""&gt;  &lt;/span&gt;On the other hand, without great risk and time management, running into problems could create a disaster and create huge setbacks.&lt;span style=""&gt;  &lt;/span&gt;With the sort of planning going into a project, there isn’t too much room for change.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-8630164648895298322?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/8630164648895298322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/12/pre-production-and-planning-your.html#comment-form' title='47 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/8630164648895298322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/8630164648895298322'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/12/pre-production-and-planning-your.html' title='Pre-production and planning your program'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>47</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-5062510446413377487</id><published>2009-11-25T15:59:00.002-05:00</published><updated>2009-11-25T16:02:58.736-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>Template Classes and Errors Galore</title><content type='html'>So I've been trying to create a template classed linked list in order to help with the IO_TextEdit class.  What I didn't realize was how much I don't fully understand when it comes to templates.  Either way, I've been working through most of the smaller issues with my code, and I hit a wall.  I ran into an LNK2019: Unresolved External Symbol.  After a lot of research, I read that if you split your template into a .h (header) file and a .cpp file, you need to include the header file AND the .cpp file!  I originally had it all in one header file, but realized how hard it was to read and understand the code, so I split it once again.  &lt;br /&gt;&lt;br /&gt;Now onto the rest of the errors...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-5062510446413377487?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/5062510446413377487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/11/template-classes-and-errors-galore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/5062510446413377487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/5062510446413377487'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/11/template-classes-and-errors-galore.html' title='Template Classes and Errors Galore'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-5728505529574730862</id><published>2009-11-14T13:38:00.003-05:00</published><updated>2009-11-14T13:50:44.364-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>Long Time no Blog</title><content type='html'>Honestly, this blogging thing is hard.  I can't keep up with it, and I never know what to write.  Anyways the other day I decided to do up a document with all of my groups programming standards.  We tried to define these in the very first meeting.  Through a bit of arguing and what not, we decided on a couple base rules like the ANSI standard and what not.  We also personalized it a bit, although I'm sure it can't be that different from other standards.  Anyways, I called the document a Technical Design Document(TDD), because in my IADT days, that's what we made.  Usually, a TDD would consist of the a short description of the project, the team members involved and their contact information, a detailed look at the standards, and practically everything else described, like classes, functions... the list goes on.  It's supposed to be gigantic, and in good practice this document should be done in pre-production, before even the first line of code is written.  It's a guideline essentially.&lt;br /&gt;&lt;br /&gt;I put the TDD I made on our SVN, and I ported it all onto our&lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OOP344_ASOS"&gt; wiki page&lt;/a&gt;.  I noticed that you can't just copy and paste the darn thing from a word document, or it'll royally screw up the wiki.  It adds this odd line above everything, and some of the regular tags for wiki don't work.  BUT if you just save it, and then go back into edit, you can just delete the weird line at the top and go back to editing a wiki like you normally would.&lt;br /&gt;&lt;br /&gt;A couple things I learned while writing the wiki:&lt;br /&gt;&lt;br /&gt;= blah = - Heading 1&lt;br /&gt;== blah == - Heading 2&lt;br /&gt;=== blah === - Heading 3&lt;br /&gt;[mailto: victor.vy.tran@gmail.com Email] - Adds an email link called Email that links to my email&lt;br /&gt;&amp;lt;pre&amp;gt; &amp;lt;/pre&amp;gt; - makes a block for code (Courier New, grey highlighting, extra spacing)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-5728505529574730862?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/5728505529574730862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/11/long-time-no-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/5728505529574730862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/5728505529574730862'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/11/long-time-no-blog.html' title='Long Time no Blog'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-5502012441417351740</id><published>2009-10-22T23:56:00.003-04:00</published><updated>2009-10-23T00:07:38.312-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Music'/><title type='text'>Colour Me Impressed</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/RZzaHi-5lk0&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/RZzaHi-5lk0&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;It's been a couple weeks now and I've been kinda creeping this kid.  I don't remember how I got to his videos but I'm glad I did.  His name is &lt;a href="http://sunghajung.com/xe/"&gt;Sungha Jung&lt;/a&gt;, and he's amazing playing the guitar.  He's 12, and he started playing when he was 9 by choice.  Now people around the world know of him because of his &lt;a href="http://www.youtube.com/user/jwcfree"&gt;Youtube videos&lt;/a&gt;.  By browsing his website, I found out that he's started to compose his own songs, not formally (on paper), but just through feel. &lt;br /&gt;&lt;br /&gt;It's just impressive because he's young, he's great at what he does, and he's totally into it.  By watching the videos you know he's in the zone when he's playing.  I'm used to seeing kids that are forced by their parents to learn an instrument and they end up hating it, then regretting later on that they didn't continue with it *coughcoughmecough*.  I think the biggest difference with Jung is that he chose to.  Which is great for someone so young. &lt;br /&gt;&lt;br /&gt;I just found out he has two-hundred-and-eleven videos posted on Youtube, all of him playing.  And he's sponsored now.  W o w.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-5502012441417351740?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/5502012441417351740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/10/colour-me-impressed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/5502012441417351740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/5502012441417351740'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/10/colour-me-impressed.html' title='Colour Me Impressed'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-519076815413881794</id><published>2009-10-15T12:39:00.004-04:00</published><updated>2009-10-15T12:52:06.039-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>Assignment 1 ... Done!</title><content type='html'>Cooooool...  So I couldn't figure out why my laptop (Running Windows 7 RC1) wouldn't allow me to use the bcc32 command in the prompt.  I thought it was a Windows 7 problem.  Then I looked closer to what I put into the Environment Variables under path.  I had a SPACE between ; and C:\Borland...!&lt;br /&gt;&lt;br /&gt;Anyways, I didn't think that I could actually change anything in the as1tester file, but I found out in class that I could fix it.  Borland likes it when ever function that doesn't take in paramaters to have (void) in it.  VCC doesn't care about that.  If you fix all of those in your ciol.c and your as1tester.c, you still get warnings, but not enough to create an error.  Just run as1tester.exe afterwards and you're good to go!&lt;br /&gt;&lt;br /&gt;So, in Tester...&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;int Yes(void);&lt;br /&gt;&lt;br /&gt;int welcome(void);&lt;br /&gt;int test1(void);&lt;br /&gt;int test2(void);&lt;br /&gt;int test3(void);&lt;br /&gt;int test4(void);&lt;br /&gt;int test5(void);&lt;br /&gt;int test6(void);&lt;br /&gt;int test7(void);&lt;br /&gt;int test8(void);&lt;br /&gt;int test9(void);&lt;br /&gt;int test10(void);&lt;br /&gt;&lt;br /&gt;int main(void);&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;and in ciol.c:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;void io_init(void)&lt;br /&gt;void io_end(void)&lt;br /&gt;void io_flush(void)&lt;br /&gt;int io_getch(void)&lt;br /&gt;int io_rows(void)&lt;br /&gt;int io_cols(void)&lt;br /&gt;void io_clrscr(void)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I didn't just change the prototypes, I changed it where the functions were defined as well, just to be sure.  And there you have it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-519076815413881794?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/519076815413881794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/10/assignment-1-done.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/519076815413881794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/519076815413881794'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/10/assignment-1-done.html' title='Assignment 1 ... Done!'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-3627709874603639922</id><published>2009-10-15T02:57:00.012-04:00</published><updated>2009-10-15T04:27:20.040-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>Assignment 1 is AMAZING!</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_niarGM4ATK8/StbIcji16LI/AAAAAAAAAAU/3uR4I3dt_KI/s1600-h/as1_bcc_errors.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 194px;" src="http://4.bp.blogspot.com/_niarGM4ATK8/StbIcji16LI/AAAAAAAAAAU/3uR4I3dt_KI/s400/as1_bcc_errors.PNG" alt="" id="BLOGGER_PHOTO_ID_5392717996726020274" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;This post is far too long.  No one's gonna read it and I know it!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;A-mazing.   Just look at the beauty of it.  It's as if Picasso graced his paintbrush on this magnificent program!  -Oh wait, it doesn't work?  Shucks!&lt;br /&gt;&lt;br /&gt;Finally I've been able to completely pass all the tests for Assignment 1 on Visual Studio.  Just now I compiled on Linux or Matrix as well.  Works fine.  I had to make some dirty fixes here and there, but I'll try and clean it up tomorrow - Oh wait, it IS tomorrow...&lt;br /&gt;&lt;br /&gt;I've been worrying incessantly about Co-op placements, my resume/cover letter, and interviews (the one I was most excited about was the one with &lt;a href="http://www.rim.com/"&gt;RIM&lt;/a&gt;...), it's been feeling a bit cramped.  Since I haven't really been active in posting on my blog (I'm still not used to it, but I should think of it like writing a much more detailed log sheet), I'm gonna run through a bunch of things I ran into since I started this assignment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The code below is something I started off with in the io_edit function.  It was being used to do editing when hitting characters, with insert mode on.  Picture the text editor that you use or the email application you use to send out an email.  By default on a Windows machine, typing would actually insert letters.  To me this is natural, but it's something you have to think about when you're making a text editor from scratch like this.&lt;br /&gt;Here's an example:&lt;br /&gt;&lt;br /&gt;ABCD| EFGH.&lt;br /&gt;&lt;br /&gt;If you hit a couple letters when your cursor(|) is after the D, you'd get:&lt;br /&gt;&lt;br /&gt;ABCDKJL| EFGH.&lt;br /&gt;&lt;br /&gt;To do that in a program, you'd have to break it down.  The line you have with the text is stored in a string.  If you tried to just insert something into a string, it wouldn't work.  Later on we'd probably use a stack or queue structure but it's not available to us at this point.  My first thought was to make a for loop that stored each element of the string into a backup string called "stored" (clever hunh?).  Then later on I'd put it all back with another for loop, after inserting the character needed.  Like so:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;for (i = 0; i &amp;lt; fieldlen; i++){&lt;br /&gt;stored[i] = str[*offset + *curpos + i];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;str[*offset + *curpos] = key;&lt;br /&gt;&lt;br /&gt;for (j = 0; j &amp;lt; fieldlen; j++){&lt;br /&gt;str[*offset + *curpos + j] = stored[j];&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;After writing it, I realized that there's probably a more efficient way of doing this, but I couldn't think of it.  &lt;a href="http://ctran13.blogspot.com/"&gt;Chi&lt;/a&gt; figured out a way.  He decided to go &lt;span style="font-style: italic;"&gt;backwards&lt;/span&gt;.  Hunh.  I totally didn't think of that.  Basically what he did was shift each element one over, one by one, backwards, through a for loop.  Cool stuff.  It's more efficient because it eliminates an extra for loop!&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;for (i = maxdatalen; i &amp;lt; ((*curpos) + (*offset)); i--){&lt;br /&gt;str[i] = str[i - 1];&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;I noticed a lot of people were having trouble with the pointers we were using like *offset and *curpos.  I can't remember which sections of code people were using them for (I think it was the flags and whatnot), but they weren't using the little "*" so their values never updated.  Some tried having some variables with and some without "*", and that threw the compiler off and gave a bunch of errors.&lt;br /&gt;&lt;br /&gt;There was also something that was bothering me last week.  A line in the &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OOP344_Assignment_One"&gt;Assignment 1&lt;/a&gt; specifications for &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OOP344_Assignment_One#Line_and_Selection_Editor"&gt;io_edit&lt;/a&gt; had a little line in italics that read:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;If any of insertmode, curpos or offset is NULL then a local integer variable will be used instead. If local variables are used for any of insertmode, curpos, or offset, the default values will be 1, 0, and 0 respectively.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nifty little line here.  I remember trying to figure out how to do this, and I was ... actually it's almost 4AM and I really don't remember anything at this time of the day ... but yeah, I couldn't figure it out!  I do remember struggling with it however.  I knew that I needed local variables.  So I set them: int i_mode, int c, int o (Yes, creative.  I know.)  But how do I actually get them to update??  A question for &lt;a href="http://seneblog.fardad.com/"&gt;Fardad&lt;/a&gt; for sure.  Good thing I asked.  He pointed me into the direction of pointer use and how pointers point to the information stored(No pun intended - Oh who am I kidding?).  If you use an "&amp;amp;", the pointer would then point to that variable's address!  After a bit of tinkering to fully understand it, I came up with:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;offset = &amp;o;&lt;br /&gt;curpos = &amp;c;&lt;br /&gt;insertmode = &amp;amp;i_mode;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Works perfectly!&lt;br /&gt;&lt;br /&gt;Now, for the tests that we had to run, I realized that a lot of things weren't too clear.  Especially with things like the ESCAPE key.  The Escape key, if IsTextEditor is 1, should just set done = 1.  If IsTextEditor is 1 however, your program needs to &lt;span style="font-style: italic;"&gt;revert to the original state&lt;/span&gt;.  Meaning everything you changed when you entered io_edit needs to be reset!  I had to get someone from irc to help me out with that one.  There were others but my tired eyes can't stay open and my brain isn't functioning either.&lt;br /&gt;&lt;br /&gt;I also noticed on &lt;a href="http://istessema.wordpress.com/"&gt;Istessema's blog&lt;/a&gt; as I was writing this has a peculiar error that I also ran into:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;/tmp/ccbFpdaq.o&lt;/span&gt;:&lt;span style="color: rgb(51, 102, 255);"&gt; In function&lt;/span&gt; `&lt;span style="color: rgb(0, 204, 255);"&gt;io_display&lt;/span&gt;‘:&lt;br /&gt;ciol.c:(.text+0×16b): undefined reference to `putch’&lt;br /&gt;collect2: ld returned 1 exit status&lt;br /&gt;&lt;br /&gt;The solution for this is to change the putch to io_putch.  Simple as that.  io_putch calls putch!&lt;br /&gt;&lt;br /&gt;Anyways, right now I have to figure out Borland.  It doesn't work at all.  I remember someone saying that we had to change something with the includes (windows.h and conio.h)... but I couldn't remember what it was.  I wish I logged stuff on irc.  Also, I looked through the green book and I didn't find anything in there either.  What I did find was on &lt;a href="http://dennyp.wordpress.com/"&gt;Denny's blog&lt;/a&gt; he pointed out that any function that didn't have any parameters had to have (void) in it.  Else it would give more warnings.  So I've cut all of those out of my ciol.c.  And there's still more!  So many more that my console window will not show it all despite me setting the buffer to 100 lines!!  Here are the errors I caught(Best of all they're mostly in testmain which is provided to us!):&lt;br /&gt;&lt;br /&gt;Warning W8065 testmain.c 122: Call to function 'test7' with no prototype in function main&lt;br /&gt;Warning W8065 testmain.c 126: Call to function 'test8' with no prototype in function main&lt;br /&gt;Warning W8065 testmain.c 129: Call to function 'test9' with no prototype in function main&lt;br /&gt;Warning W8065 testmain.c 133: Call to function 'test10' with no prototype in function main&lt;br /&gt;Warning W8065 testmain.c 140: Call to function 'io_clrscr' with no prototype in function main&lt;br /&gt;Warning W8065 testmain.c 152: Call to function 'io_getch' with no prototype in function main&lt;br /&gt;Warning W8065 testmain.c 153: Call to function 'io_end' with no prototype in function main&lt;br /&gt;Warning W8004 testmain.c 72: 'ok' is assigned a value that is never used in function main&lt;br /&gt;Warning W8065 testmain.c 171: Call to function 'io_clrscr' with no prototype in function test10&lt;br /&gt;Warning W8065 testmain.c 182: Call to function 'io_getch' with no prototype in function test10&lt;br /&gt;Warning W8065 testmain.c 184: Call to function 'io_clrscr' with no prototype in function test10&lt;br /&gt;Warning W8065 testmain.c 186: Call to function 'Yes' with no prototype in function test10&lt;br /&gt;Warning W8060 testmain.c 205: Possibly incorrect assignment in function resetStr&lt;br /&gt;Warning W8065 testmain.c 290: Call to function 'io_getch' with no prototype in function pause&lt;br /&gt;Warning W8065 testmain.c 301: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 314: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 328: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 343: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 357: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 371: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 385: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 399: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 413: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 427: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 442: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 450: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 457: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 465: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 472: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 480: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 487: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 495: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 502: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 510: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 517: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 525: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 527: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 529: Call to function 'io_getch' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 536: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 551: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 565: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8065 testmain.c 580: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 588: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 595: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 603: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 610: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 618: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 625: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 633: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 640: Call to function 'io_clrscr' with no prototype in function test9&lt;br /&gt;Warning W8004 testmain.c 648: 'jump' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8004 testmain.c 299: 'ok' is assigned a value that is never used in function test9&lt;br /&gt;Warning W8065 testmain.c 661: Call to function 'io_clrscr' with no prototype in function test8&lt;br /&gt;Warning W8065 testmain.c 701: Call to function 'Yes' with no prototype in function test8&lt;br /&gt;Warning W8065 testmain.c 709: Call to function 'io_clrscr' with no prototype in function test7&lt;br /&gt;Warning W8065 testmain.c 749: Call to function 'Yes' with no prototype in function test7&lt;br /&gt;Warning W8065 testmain.c 758: Call to function 'io_clrscr' with no prototype in function test6&lt;br /&gt;Warning W8065 testmain.c 795: Call to function 'Yes' with no prototype in function test6&lt;br /&gt;Warning W8065 testmain.c 799: Call to function 'io_clrscr' with no prototype in function test5&lt;br /&gt;Warning W8065 testmain.c 808: Call to function 'io_rows' with no prototype in function test5&lt;br /&gt;Warning W8065 testmain.c 811: Call to function 'Yes' with no prototype in function test5&lt;br /&gt;Warning W8065 testmain.c 815: Call to function 'io_clrscr' with no prototype in function test4&lt;br /&gt;Warning W8065 testmain.c 824: Call to function 'io_rows' with no prototype in function test4&lt;br /&gt;Warning W8065 testmain.c 827: Call to function 'Yes' with no prototype in function test4&lt;br /&gt;Warning W8065 testmain.c 832: Call to function 'io_clrscr' with no prototype in function test3&lt;br /&gt;Warning W8065 testmain.c 869: Call to function 'io_rows' with no prototype in function test3&lt;br /&gt;Warning W8065 testmain.c 870: Call to function 'Yes' with no prototype in function test3&lt;br /&gt;Warning W8065 testmain.c 880: Call to function 'io_clrscr' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 884: Call to function 'io_getch' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 885: Call to function 'io_clrscr' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 889: Call to function 'io_getch' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 894: Call to function 'io_rows' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 894: Call to function 'io_cols' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 909: Call to function 'io_cols' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 909: Call to function 'io_rows' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 933: Call to function 'io_clrscr' with no prototype in function test2&lt;br /&gt;Warning W8065 testmain.c 937: Call to function 'Yes' with no prototype in function test2&lt;br /&gt;Warning W8004 testmain.c 884: 'key' is assigned a value that is never used in function test2&lt;br /&gt;Warning W8065 testmain.c 942: Call to function 'io_clrscr' with no prototype in function test1&lt;br /&gt;Warning W8065 testmain.c 949: Call to function 'io_rows' with no prototype in function test1&lt;br /&gt;Warning W8065 testmain.c 951: Call to function 'io_cols' with no prototype in function test1&lt;br /&gt;Warning W8065 testmain.c 953: Call to function 'io_rows' with no prototype in function test1&lt;br /&gt;Warning W8065 testmain.c 953: Call to function 'io_cols' with no prototype in function test1&lt;br /&gt;Warning W8065 testmain.c 955: Call to function 'Yes' with no prototype in function test1&lt;br /&gt;Warning W8065 testmain.c 961: Call to function 'io_clrscr' with no prototype in function welcome&lt;br /&gt;Warning W8065 testmain.c 971: Call to function 'Yes' with no prototype in function welcome&lt;br /&gt;Warning W8065 testmain.c 977: Call to function 'io_getch' with no prototype in function Yes&lt;br /&gt;Warning W8065 testmain.c 982: Call to function 'io_getch' with no prototype in function Escape&lt;br /&gt;Error E2228 testmain.c 982: Too many error or warning messages in function Escape&lt;br /&gt;*** 1 errors in Compile ***&lt;br /&gt;ciol.c:&lt;br /&gt;Warning W8065 ciol.c 177: Call to function 'io_clrscr' with no prototype in function io_end&lt;br /&gt;Warning W8019 ciol.c 352: Code has no effect in function io_edit&lt;br /&gt;Warning W8004 ciol.c 290: 'len' is assigned a value that is never used in function io_edit&lt;br /&gt;Warning W8004 ciol.c 286: 'i' is assigned a value that is never used in function io_edit&lt;br /&gt;Warning W8004 ciol.c 604: 'i' is assigned a value that is never used in function io_displayMenuItem&lt;br /&gt;Warning W8057 ciol.c 666: Parameter 'format' is never used in function io_menuItem&lt;br /&gt;Warning W8057 ciol.c 666: Parameter 'len' is never used in function io_menuItem&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-3627709874603639922?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/3627709874603639922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/10/assignment-1-is-amazing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/3627709874603639922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/3627709874603639922'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/10/assignment-1-is-amazing.html' title='Assignment 1 is AMAZING!'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_niarGM4ATK8/StbIcji16LI/AAAAAAAAAAU/3uR4I3dt_KI/s72-c/as1_bcc_errors.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-8632507179858532151</id><published>2009-09-26T14:28:00.002-04:00</published><updated>2009-09-26T16:09:50.789-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>io_display Challenge</title><content type='html'>So the new challenge posted &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OOP344#To_Do"&gt;here&lt;/a&gt; asks us to try and cut the io_display function down to a single line.  I've been staring at the original code for a while now, and I don't quite see a logical way to shrink it.  Sure I could use "?" to replace the if statements and what not, but what is the benefit of doing such a thing?  It makes the code much harder to read and understand, and as &lt;a href="http://seneblog.fardad.com/"&gt;Fardad&lt;/a&gt; explained in class, using "?" and such doesn't optimize the code, it just makes it shorter. &lt;br /&gt;&lt;br /&gt;So then I started thinking pointers, and the pointing to pointers thing we just learned about in Thursday's class.  I took a look at the str pointer, and two functions used in io_display(io_putstr and io_putch).  I thought of eliminating the use of io_putstr and replacing it with something like **str = *str, but totally forgot that the function passes in a const char* and cannot be modified for the sole purpose that I'm trying to display, not change the actual variable.  Then I thought, "What's the point of doing this?"  I'm not shortening the code in this approach at all.  The io_putstr and io_putch call up their respective functions to make it work, so there's no real point in eliminating the use of a function!&lt;br /&gt;&lt;br /&gt;I also thought about declaring the int i in the for loop used, but I remembered this must be in C, not C++, and I also realized that there were two for loops dependent on the same value of i.&lt;br /&gt;&lt;br /&gt;What I DID notice, however, was that I could eliminate the second for loop by including just using an if (?) while figuring out whether you want a character to be printed to the screen or a space.   Other than that, here's my code.  I tried making the if...else statement using "?" but it wouldn't let me put the for loop and the int i portion in it.  Oh well, here's my code, and no, I didn't put it all on one line to make it ridiculously hard to read!&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;void io_display(const char *str, int row, int col, int len){&lt;br /&gt;&amp;nbsp;  io_move(row, col);&lt;br /&gt;&amp;nbsp;  if(len &amp;lt;= 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;    io_putstr(str);&lt;br /&gt;&amp;nbsp;  else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;    int i;&lt;br /&gt;&amp;nbsp;&amp;nbsp;    for(i=0;i&amp;lt;len;i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   io_putch(str[i] ? str[i] : ' ');&lt;br /&gt;&amp;nbsp;&amp;nbsp;  }&lt;br /&gt;&amp;nbsp;  }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-8632507179858532151?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/8632507179858532151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/09/iodisplay-challenge.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/8632507179858532151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/8632507179858532151'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/09/iodisplay-challenge.html' title='io_display Challenge'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-6718158105540706864</id><published>2009-09-21T00:20:00.003-04:00</published><updated>2009-09-21T00:24:45.062-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>Challenge #1</title><content type='html'>***Originally posted on the 19th***&lt;br /&gt;&lt;br /&gt;Challenge: write this function without using any library functions; void GetInt(char *strint, int val); this function gets an integer value and converts it to a string ("strint")&lt;br /&gt;&lt;br /&gt;Here is my solution to the challenge posted &lt;a href="http://zenit.senecac.on.ca/wiki/index.php/OOP344#To_Do"&gt;here&lt;/a&gt;.  I've solved it for when the integer is a single digit.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;void GetInt(char *strint, int val);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int main(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   char c;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   int val = 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   GetInt(&amp;amp;c, val);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   printf("%c %d\n", c, val);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void GetInt(char *strint, int val){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   *strint = val + '0';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To explain, we learned in OOP244 that to convert a string to an integer for the ISBN to be validated, we needed to subtract a zero character ('0'), from the string.  I haven't looked at anyone's code yet, but I think this is the shortest way to do this.&lt;br /&gt;&lt;br /&gt;Edit:&lt;br /&gt;&lt;br /&gt;I'm trying to go with the simplest route here.  The current strategy is to break down the number from the ten thousands place to the ones place, and put it back into the c-style string.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;void GetInt(char *strint, int val){&lt;br /&gt;strint[0] = val / 10000 + '0';&lt;br /&gt;strint[1] = (val % 10000) / 1000 + '0';&lt;br /&gt;strint[2] = (val % 1000) / 100 + '0';&lt;br /&gt;strint[3] = (val % 100) / 10 + '0';&lt;br /&gt;strint[4] = (val % 10) + '0';&lt;br /&gt;printf("%c%c%c%c%c", strint[0], strint[1], strint[2], strint[3],   strint[4]);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I'm building this in VC++, and currently I'm getting an error: Run-time Check Error #2: Stack around the variable 'c' was corrupted.  You can see my main() above.  I couldn't quite figure it out.  Now, if I were to take out the strint[4] line, the code seems to work.  There's also probably a cleaner solution out there, and I'll check it out after I get back from work tonight.&lt;br /&gt;&lt;br /&gt;Edit 2:&lt;br /&gt;&lt;br /&gt;This is my current code, I've sort of given up on changing a number with more that 4 digits.  &lt;a href="http://ctran13.blogspot.com/2009/09/oop344-challenge.html"&gt;Chi&lt;/a&gt; mentions here that I suggested typecasting.  I tried it out, and it seems like it only works for single digits, like my first solution.  It's literallly one line, &lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;*strint = (char)val;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Anyways, my solution is below.  Probably not the best way to do it.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;void GetInt(char *strint, int val){&lt;br /&gt;strint[0] = (val % 10000) / 1000 + '0';&lt;br /&gt;strint[1] = (val % 1000) / 100 + '0';&lt;br /&gt;strint[2] = (val % 100) / 10 + '0';&lt;br /&gt;strint[3] = (val % 10) + '0';&lt;br /&gt;printf("%c%c%c%c%c", strint[0], strint[1], strint[2], strint[3]);&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Edit 3:&lt;br /&gt;&lt;br /&gt;Ok, so I figured out my problem.  When I initialized c, I didn't make it an array to store everything, therefore creating my stack error.  Here's the full solution for up to a 5-digit integer, because maximum for an int by default is 5 digits.&lt;br /&gt;&lt;div style="background-color: rgb(204, 204, 255);"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;int main(){&lt;br /&gt;    char* c[5];&lt;br /&gt;    int val = 17288;&lt;br /&gt;    GetInt(&amp;amp;c, val);&lt;br /&gt;    printf("%s", c);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void GetInt(char *strint, int val){&lt;br /&gt;    strint[0] = val / 10000 + '0';&lt;br /&gt;    strint[1] = (val % 10000) / 1000 + '0';&lt;br /&gt;    strint[2] = (val % 1000) / 100 + '0';&lt;br /&gt;    strint[3] = (val % 100) / 10 + '0';&lt;br /&gt;    strint[4] = (val % 10) + '0';&lt;br /&gt;    strint[5] = '\0';&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-6718158105540706864?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/6718158105540706864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/09/challenge-1_21.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/6718158105540706864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/6718158105540706864'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/09/challenge-1_21.html' title='Challenge #1'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-6656437006157729868</id><published>2009-09-08T23:14:00.005-04:00</published><updated>2009-09-17T00:07:22.439-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Themes'/><title type='text'>PS3 Braid Theme by Non-Other-Than-Myself</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://victortran.net/preview_1.png"&gt;&lt;img style="cursor: pointer; width: 480px; height: 270px;" src="http://victortran.net/preview_1.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Download this theme &lt;a href="http://victortran.net/Braid.p3t"&gt;here&lt;/a&gt;. (On the PS3 Browser, press triangle on the link and go down to File&gt;Save Target As)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;So much for doing nothing!  Here's a release of the Braid theme I've been working on.  It took me about 5 days of thinking and doing.  It wasn't as hard as I thought it'd be to be honest.  This theme includes:&lt;br /&gt;&lt;br /&gt;- Backgrounds from Worlds 2, 4, 5, 6 and the title screen (3 was bright yellow and I cut it out because it made reading text a tad on the uncomfortable side)&lt;br /&gt;- Sound effects from the in game menu in Braid&lt;br /&gt;- Icons from the Braid world, most of which I edited to fit the theme.  Most of the icons beneath the main ones are not from the game, but are from the basic PS3 theme made to fit.&lt;br /&gt;&lt;br /&gt;Overall I'm pretty happy with this.  My still-new PS3 Slim is donning this Braid theme with pride.  Here's to Braid coming to the PS3.&lt;br /&gt;&lt;br /&gt;Oh, below is a video walkthrough of the theme in action.  Mind you I took this video with my Pentax S60, which is 6.0MP and it doesn't do the theme justice, but what can you do?  That's right! &lt;span style="text-decoration: line-through;"&gt;Give me a new one&lt;/span&gt; Absolutely nothing!&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="viddler_thevapourrub_1" width="437" height="370"&gt;&lt;param name="movie" value="http://www.viddler.com/player/3676adb4/"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.viddler.com/player/3676adb4/" wmode="transparent" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" name="viddler_thevapourrub_1" width="437" height="370"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-6656437006157729868?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/6656437006157729868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/09/ps3-braid-theme-by-non-other-than.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/6656437006157729868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/6656437006157729868'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/09/ps3-braid-theme-by-non-other-than.html' title='PS3 Braid Theme by Non-Other-Than-Myself'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4623244905769687779.post-1349415348253297864</id><published>2009-09-08T22:49:00.002-04:00</published><updated>2009-09-08T22:52:11.033-04:00</updated><title type='text'>Blog is Up!</title><content type='html'>Finally!  After all of f-i-v-e whole minutes it took to create this blog, it's finally up!  Phew, what a relief! &lt;br /&gt;&lt;br /&gt;     I guess this blog is to keep track of my daily doings, especially when it comes to programming.&lt;br /&gt;&lt;br /&gt;     Now I can go on to doing... absolutely nothing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4623244905769687779-1349415348253297864?l=victran.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victran.blogspot.com/feeds/1349415348253297864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victran.blogspot.com/2009/09/blog-is-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/1349415348253297864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4623244905769687779/posts/default/1349415348253297864'/><link rel='alternate' type='text/html' href='http://victran.blogspot.com/2009/09/blog-is-up.html' title='Blog is Up!'/><author><name>Victor</name><uri>http://www.blogger.com/profile/01741217389092354433</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
