Difference between revisions of "Team Mighty Morphin Coding Rangers - OOP344"

From CDOT Wiki
Jump to: navigation, search
m (A1 Function assignment)
m (A2 assignment)
 
(103 intermediate revisions by 9 users not shown)
Line 3: Line 3:
 
__TOC__
 
__TOC__
  
== A1 Function assignment ==
+
== Member list ==
  
 
{| class="wikitable sortable" border="1"  cellpadding="5"
 
{| class="wikitable sortable" border="1"  cellpadding="5"
  
 
+
! Last Name  !! Name !! Seneca Username !! Section !! Blog Url !! IRC Nick !! SVN ID  !! My Contributions !! Role !! Alternative Email Address
! Last Name  !! Name !! Simple Function(s) !! Complex Function(s)
+
|-
 +
| Chau|| [http://zenit.senecac.on.ca/wiki/index.php/User:Schau5 Sunny] || [mailto:schau5@learn.senecac.on.ca?subject=OOP344 schau5]|| B || [http://s2000c.blogspot.com/ Blog] || ScsC|| schau5  || [[Special:Contributions/schau5|Contributions]] || The Experienced Guy || ~
 +
|-
 +
| Cheung|| [http://zenit.senecac.on.ca/wiki/index.php/User:Cgcheung Christopher] ||[mailto:cgcheung@learn.senecac.on.ca?subject=OOP344 cgcheung] || B || http://rocketpants.blog.ca/ || Rocketpants || n/a || [[Special:Contributions/cgcheung | Contributions]] || Team Contact || ~
 
|-
 
|-
 
+
| Huang|| [http://zenit.senecac.on.ca/wiki/index.php/User:Dhuang18 Dachuan] || [mailto:dhuang18@learn.senecac.on.ca?subject=OOP344 dhuang] || B || [http://hdc23.wordpress.com/ Blog] ||  Da_Truth || dhuang18  || [[Special:Contributions/dhuang18 | Contributions]] || Team Leader || [mailto:dachuan.huang@gmail.com Email]
| Chau|| Sunny|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_move.28int_r.2C_int_c.29 bio_move] || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#Line_Editor:_int_bio_edit.28.........29 bio_edit]
 
 
|-
 
|-
 
+
| John-Sandy|| [http://zenit.senecac.on.ca/wiki/index.php/User:Ajohn-sandy Anastasia] ||[mailto:ajohn-sandy@learn.senecac.on.ca?subject=OOP344 ajohn-sandy] || B || http://anastasiasaurus.blogspot.com  || annieJS || ajohn-sandy  || [[Special:Contributions/ajohn-sandy| Contributions]] || Team Contact || annieJS@gmail.com
| Cheung|| Christopher|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_clrscr.28void.29 bio_clrscr] || ~
 
 
|-
 
|-
 
+
| Oberes|| [http://zenit.senecac.on.ca/wiki/index.php/User:Daoberes Donna] || [mailto:daoberes@learn.senecac.on.ca?subject=OOP344 daoberes] || B || [http://donna-oberes.blogspot.com Blog] ||  <s>primadonna</s> donna_o || n/a  ||[[Special:Contributions/daoberes| Contributions]] || Team Contact || ~
| Huang|| Dachuan|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_flush.28void.29 bio_flush] ||  
 
 
 
[http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_displayMenuItem.28...........29 bio_displayMenuItem]
 
 
|-
 
|-
 
+
| Wang|| [http://zenit.senecac.on.ca/wiki/index.php/User:Cwang84 Cong] || [mailto:Cwang84@learn.senecac.on.ca?subject=OOP344 Cwang84] || A || http://wangcong422.blogspot.com/ || cwang84 || n/a  ||[[Special:Contributions/cwang84 | Contributions]] || Team Contact || ~
| John-Sandy|| Anastasia|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_cols.28void.29 bio_cols] || ~
 
 
|-
 
|-
 
+
| Wang|| [http://zenit.senecac.on.ca/wiki/index.php/User:Shengwei Shengwei] || [mailto:swang94@learn.senecac.on.ca?subject=OOP344 swang94] || A || http://shengwei-seneca.blogspot.com/ || Shengwei || swang94  ||[[Special:Contributions/shengwei | Contributions]] || Team Contact || [mailto:wangshengwei.ca@gmail.com Email]
| Oberes|| Donna|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_rows.28void.29 bio_rows] || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#Line_Editor:_int_bio_edit.28.........29  bio_edit]
 
 
 
|-
 
|-
 
+
| Xue|| [http://zenit.senecac.on.ca/wiki/index.php/User:Yxue11 Yong] || [mailto:yxue11@learn.senecac.on.ca?subject=OOP344 yxue11] || B || http://yxue11.blogspot.com/ || yxue11 || n/a  || [[Special:Contributions/yxue11|Contributions]] || Team Contact || ~
| Wang|| Cong|| ~ || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_display.28const_char_.2Astr.2C_int_row.2C_int_col.2C_int_len.29 bio_display]/[http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_displayflag.28...........29 bio_displayflag]
 
 
|-
 
|-
 
+
| ~ || ~ ||[mailto:yxue11@learn.senecac.on.ca,swang94@learn.senecac.on.ca,Cwang84@learn.senecac.on.ca,daoberes@learn.senecac.on.ca,ajohn-sandy@learn.senecac.on.ca,dhuang18@learn.senecac.on.ca,cgcheung@learn.senecac.on.ca,schau5@learn.senecac.on.ca?subject=OOP344__MM_Coding_Rangers, e-mail all @ once] || ~ || ~ || ~ || ~ ||~ ||~ || ~
| Wang|| Shengwei|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_putstr.28const_char_.2As.29 bio_putstr] || ~
 
 
|-
 
|-
 
| Xue|| Yong|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_putch.28int_c.29 bio_putch] || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_flag.28...........29 bio_flag()] 
 
 
 
|}
 
|}
  
Line 44: Line 34:
 
oop344_101rep4
 
oop344_101rep4
 
</big>
 
</big>
 +
 +
==<big>A2 assignment</big>==
 +
[[MM Rangers' OpText - OOP344|Rangers' OpText Development Page]]
 +
{| class="wikitable sortable" border="1"  cellpadding="5"
 +
 +
! IRC nick/user!! Class(es)/File(s)
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Schau5 ScsC] || BFrame Class, btext.h, BField Class
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Cgcheung Rocketpants] || BLabel class
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Dhuang18 Da_Truth] || BForm class, BTextEdit Class
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Ajohn-sandy annieJS] || TBA
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Daoberes donna_o <s>primadonna</s>] || BEdit class
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Cwang84 cwang84] || TBA
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Shengwei Shengwei] || BFrame Class, btext.h
 +
|-
 +
| [http://zenit.senecac.on.ca/wiki/index.php/User:Yxue11 yxue11] || TBA
 +
|-
 +
|}
 +
 +
== A1 Function assignment ==
 +
 +
{| class="wikitable sortable" border="1"  cellpadding="5"
 +
 +
! Last Name  !! Name !! Branches in workspace !! Simple Function(s) !! Complex Function(s)
 +
|-
 +
| Chau|| Sunny|| ScsC workspace || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_move.28int_r.2C_int_c.29 bio_move] - Committed to trunk|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#Line_Editor:_int_bio_edit.28.........29 bio_edit]
 +
|-
 +
| Cheung|| Christopher|| cgcheung workspace || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_clrscr.28void.29 bio_clrscr] || ~
 +
|-
 +
| Huang|| Dachuan|| Dachuan workspace || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_flush.28void.29 bio_flush] - Committed to trunck||
 +
 +
[http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_displayMenuItem.28...........29 bio_displayMenuItem]  - Committed to trunk
 +
 +
[http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#Line_Editor:_int_bio_edit.28.........29  bio_edit]  - Committed to trunk
 +
|-
 +
| John-Sandy|| Anastasia|| ~ || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_cols.28void.29 bio_cols] - Committed to trunk || ~
 +
|-
 +
| Oberes|| Donna|| Daoberes workspace || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_rows.28void.29 bio_rows] - Committed to trunk <br/> [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_%28AS1%29_-_OOP344#int_bio_getch.28void.29 bio_getch] - Committed to trunk || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#Line_Editor:_int_bio_edit.28.........29  bio_edit] - Validation logic for *offset, *curpos, & *offset = NULL *DONE*; Before editing begins, if *curpos & *offset have invalid values  *DONE*; Validation of positions that *curpos is never allowed to take *DONE*; !ReadOnly and *insertmode *To be modified*
 +
|-
 +
| Wang|| Cong|| ~ || ~ || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_display.28const_char_.2Astr.2C_int_row.2C_int_col.2C_int_len.29 bio_display]/[http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_displayflag.28...........29 bio_displayflag]
 +
|-
 +
| Wang|| Shengwei|| Shengwei workspace || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_putstr.28const_char_.2As.29 bio_putstr] - Committed to trunk||
 +
 +
[http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_menuItem.28...........29 bio_menuItem] Committed to trunk <font color='blue'>bio_putint</font> Committed to trunk
 +
|-
 +
| Xue|| Yong|| Yong workspace || [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#void_bio_putch.28int_c.29 bio_putch] Committed to trunk|| [http://zenit.senecac.on.ca/wiki/index.php/BIOF_20101_(AS1)_-_OOP344#int_bio_flag.28...........29 bio_flag()]Committed to trunk 
 +
|}
  
 
== Coding Style ==
 
== Coding Style ==
Line 78: Line 121:
 
<li>Declare each variable at the beginning of blocks.</li>
 
<li>Declare each variable at the beginning of blocks.</li>
 
<code>
 
<code>
Eg.  
+
Eg.
 +
 
 
main () {
 
main () {
    int length = 0; // correct, at the beginning of the block
+
int length = 0; // correct, at the beginning of the block
    ...
+
...
    ...
+
...
    int flag = 1; // incorrect, at the middle of the block
+
int flag = 1; // incorrect, at the middle of the block
    if ( length = 0) {
+
if ( length = 0) {
        int i = 0;  // correct, at the beginning of the block
+
int i = 0;  // correct, at the beginning of the block
        ...
+
...
        ...
+
...
        bool valid = true; // incorrect, at the middle of the block
+
bool valid = true; // incorrect, at the middle of the block
    }
+
}
    return 0;
+
return 0;
}  
+
}
 +
 
 
</code>
 
</code>
 
  
 
<li>Declare each variable in a line by itself. It is easier to comment a variable this way. Do not use commas to separate the variable names if they have the same data type.</li>
 
<li>Declare each variable in a line by itself. It is easier to comment a variable this way. Do not use commas to separate the variable names if they have the same data type.</li>
Line 111: Line 155:
 
<code>
 
<code>
 
main () { <br/><br/>
 
main () { <br/><br/>
    int x; //Notice the four spaces over <br/>
+
int x; //Notice the four spaces over <br/>
    int y; <br/><br/>
+
int y; <br/><br/>
    for (x = 0, y = 10; x < 10 && y >0; x++, y++) { <br/>
+
for (x = 0, y = 10; x < 10 && y >0; x++, y++) { <br/>
  
        printf("x is %d, y is %d\n", x, y); <br/>
+
printf("x is %d, y is %d\n", x, y); <br/>
        printf("The sum of x and y is %d\n", x + y); <br/>
+
printf("The sum of x and y is %d\n", x + y); <br/>
        if (x == 5) <br/>
+
if (x == 5) <br/>
            printf("We've reached the halfway point!\n"); //Moved four spaces over again
+
printf("We've reached the halfway point!\n"); //Moved four spaces over again
    } <br/><br/>
+
} <br/><br/>
    printf("Hello, world!\n"); <br/>
+
printf("Hello, world!\n"); <br/>
 
} <br/>
 
} <br/>
 
</code>
 
</code>
Line 149: Line 193:
  
 
</ul>
 
</ul>
 
<hr/>
 
  
 
==Issues==
 
==Issues==
 
Each member will post updates about their progress on the project. Triumphs, conflicts, and blood and tears will go here.
 
Each member will post updates about their progress on the project. Triumphs, conflicts, and blood and tears will go here.
  
 +
===Sunny===
 +
<strike>However, a new "Error E2040 C:\Borland\BCC55\Include\conio.h 1: Declaration terminated incorrectly" has appeared.</strike> Fixed! Feb11th<br/>
 
<strike>I am running into this error "Error E2209 biof.c 32: Unable to open include file 'conio.h'".  Know a way to fix this?</strike> Fixed!
 
<strike>I am running into this error "Error E2209 biof.c 32: Unable to open include file 'conio.h'".  Know a way to fix this?</strike> Fixed!
  
== Member list ==
+
===Donna===
 +
 
 +
Feb 20, 2010 - Just found out yesterday that another variable, int ReadOnly, has been added to parameters passed to bio_edit. ReadOnly is supposed to toggle between ReadOnly and !ReadOnly. This changes the default of the switch statement slightly.
 +
 
 +
Feb 4, 2010 - Committed my bio_rows to trunk. I ran into a few troubles while compiling, the biggest being Borland. Never used this compiler before. The frustrating part, after fixing all of my mistakes, is forgetting to take note of what went wrong so that I know how to fix it in the future. However, as far as I can recall, some of the biggest problems were:
 +
<ul>
 +
<li>Having to include -IC:\Borland\BCC55\Include \LC:\Borland\BCC55\Lib during compilation.
 +
 
 +
<li>Empty parameters in the function prototypes (in biof.h) actually needed the word "void" rather than just leaving them empty. (I just checked the function prototypes in the biof.c file, and some of them <i>are</i> empty. However, fixing just the .h file was enough). For some reason, they're as good as being not prototyped.
 +
</ul>
 +
There was something hinky about visual c++, too, but I forget now. I'll keep it in mind for next time. <br/>
 +
As for the actual coding, I forgot that the word "struct" has to be included when creating a struct. (<code>struct text_info x;</code>).
 +
 
 +
===Shengwei===
 +
*AS2:
 +
When we want to test our code under different platforms, it is important to change include statement in biof.c correspondingly.
 +
<br/>
 +
Style 1:
 +
<code>
 +
#include "biof.h"
 +
</code>
 +
Style 2:<br/>
 +
<code>
 +
extern "C"{
 +
#include "biof.h"
 +
};
 +
</code>
 +
 
 +
VCC, BCC like style 1, while LNX likes style 2. MAC is unknown.
 +
 
 +
* I found one [http://seneblog.fardad.com/2010/02/this-was-good-meeting.html blog] from Fardad's blogger. I think it is good for us to have a look at it.
 +
 
 +
===Dachuan===
 +
Placing void in Function(void) for Borland is important. It has gotten me frustrated a few times. <br />
 +
<s>bio_putint() doesn't seem to work under VCC now?</s> fixed. <br />
 +
 
 +
<s>bio_move() doesn't not work in Borland.</s> fixed. <br />
 +
 
 +
When using Putty, don't forget to set Function/Keyboard/Xterm R6! <br />
 +
 
 +
When compiling on Mac: cc biomain.c biof.c -lcurses (and then) ./a.out  <br />
 +
 
 +
===Cong===
 +
i really appreciate Sunny's help, my code works now.And i understand what link problem is.
 +
 
 +
i look the program and find a bug on tab key when you press tab key it jump 4 space forward but when you press backspace it suppose to jump back 4 space.
 +
 
 +
===Cgcheung===
 +
Not really an issue but my own mistake. A reminder to include "-l ncurses" to the compile line in linux >_> .
 +
 
 +
 
  
{| class="wikitable sortable" border="1"  cellpadding="5"
+
== Project Progress ==
 +
Update the current project's progress here. List what's done in each part, and what's not done. Simply cross-out things that are done.
  
 +
===Simple Functions===
 +
{| border="1"  cellpadding="5"
  
! Last Name  !! Name !! Seneca Username !! Section !! Blog Url !! IRC Nick !! SVN ID  !! My Contributions !! Role
+
! Function Name  !! Progress & Name !! Tested Platforms [VCC/BCC/LNX/MAC]]
 +
|-
 +
| void bio_init(void) || Compeleted || ALL
 +
|-
 +
| void bio_end(void) || Completed || ALL
 +
|-
 +
| int bio_rows(void) || Completed by Donna || ALL
 +
|-
 +
| int bio_cols(void) || Completed by Anastasia || ALL
 +
|-
 +
| void bio_clrscr(void) || Completed by Chris || VCC/BCC/LNX
 +
|-
 +
| void bio_flush(void) || Compeleted by Dachaun || ALL
 +
|-
 +
| int bio_getch(void) || Completed by Donna || VCC/BCC/LNX
 +
|-
 +
| void bio_move(int row, int col) || Compeleted by Sunny || VCC/BCC/LNX
 +
|-
 +
| void bio_putch(int ch) || Completed by Yong || VCC/BCC/LNX
 
|-
 
|-
 +
| void bio_putstr(const char* str) || Completed by Shengwei || VCC/BCC/LNX
 +
|-
 +
|}
 +
<br/><br/>
 +
 +
===Complex Functions===
 +
 +
{| border="1"  cellpadding="5"
  
| Chau|| Sunny|| [mailto:schau5@learn.senecac.on.ca?subject=OOP344 schau5]|| B || [http://s2000c.blogspot.com/ Blog] || ScsC|| TBA || [[Special:Contributions/schau5| Contributions]] || Team Contact
+
! Function Name  !! Progress & Name !! Tested Platforms [VCC/BCC/LNX/MAC]
 +
|-
 +
| void bio_display(const char* str, int row, int col, int len) || Compeleted by Cong || 
 +
|-
 +
| void bio_displayflag(const char* format, int row, int col, int status) || Compeleted by Cong ||
 +
|-
 +
| int bio_flag(const char* str, int row, int col, int* status, int radio) || Compeleted by Yong || VCC/BCC/LNX 
 +
|-
 +
| void bio_displayMenuItem(...) || Compeleted by Dachuan || ALL
 +
|-
 +
| void bio_menuItem(...) || Compeleted by Shengwei || VCC/BCC/LNX
 +
|-
 +
| colspan = "3" | '''int  bio_edit(char* str, int row, int col, int fieldlen, int maxdatalen, int *insertmode, int *offset, int *curpos, int IsTextEditor, int ReadOnly) '''
 +
|-
 +
| UP_KEY || Completed  || 
 +
|-
 +
| DOWN_KEY || Completed  || 
 +
|-
 +
| LEFT_KEY || Completed  || 
 +
|-
 +
| RIGHT_KEY || Completed  || 
 +
|-
 +
| PGUP_KEY || Completed  || 
 +
|-
 +
| PGDN_KEY || Completed || 
 +
|-
 +
| HOME_KEY || Completed || 
 +
|-
 +
| END_KEY || In Progress by Chris || Tested for BCC/VCC. Needs testing for LNX/MAC.
 +
|-
 +
| ENTER_KEY || Completed by Anastasia || 
 +
|-
 +
| TAB_KEY || In Progress by Anastasia ||   
 +
|-
 +
| BACKSPACE_KEY || Completed by Dachaun || ALL
 
|-
 
|-
 
+
| ESCAPE_KEY || Completed  ||
| Cheung|| Christopher|| [mailto:cgcheung@learn.senecac.on.ca?subject=OOP344 cgcheung] || B || http://rocketpants.blog.ca/ || Rocketpants || n/a || [[Special:Contributions/cgcheung | Contributions]] || Team Contact
+
|-
 +
| DEL_KEY || Completed by Dachuan || ALL
 
|-
 
|-
 
+
| INSERT_KEY || Completed  ||  
| Huang|| Dachuan|| [mailto:dhuang18@learn.senecac.on.ca?subject=OOP344 dhuang] || B || http://hdc23.wordpress.com/  ||  Da_Truth || n/a  || [[Special: Contributions/dhuang18 | Contributions]] || Team Contact
 
 
|-
 
|-
 
+
| F1-F12 || Completed ||   
| John-Sandy|| Anastasia|| [mailto:ajohn-sandy@learn.senecac.on.ca?subject=OOP344 ajohn-sandy] || B || http://anastasiasaurus.blogspot.com || annieJS || n/a || [[Special:Contributions/ajohn-sandy| Contributions]] || Team Contact
 
 
|-
 
|-
 
+
| DEFAULT || Completed by Donna || VCC/BCC/LNX/MAC
| Oberes|| Donna|| [mailto:daoberes@learn.senecac.on.ca?subject=OOP344 daoberes] || B || [http://donna-oberes.blogspot.com Blog] ||  Donna_Oberes || n/a  || [[Special:Contributions/daoberes| Contributions]] || Team Contact
 
 
|-
 
|-
 +
|}
 +
<br/><br/>
  
| Wang|| Cong|| [mailto:Cwang84@learn.senecac.on.ca?subject=OOP344 Cwang84] || A || http://wangcong422.blogspot.com/ || cwang84 || n/a || [[Special:Contributions/cwang84 | Contributions]] || Team Contact
+
===Helper Functions===
|-
+
<br/>
 +
'''void bio_putint(int val)'''<br/>
 +
* It prints an integer on the screen. <br/>
 +
<br/>
 +
'''char* toUpperCase(char* str)'''<br/>
 +
* This function only changes those letters in lower case to upper case. It changes the original string.<br/>
 +
<br/>
 +
'''char* myItoa(int val, char* str, int base)'''<br/>
 +
* This function converts a decimal base integer to any other non-decimal base number, such as binary number or octal number, or hex number, and than converts that number into a string variable. Or, it converts a decimal base integer directly into a string. The function returns the address of the string at the end.<br/>
 +
<br/>
 +
'''char* myFtoa(double val, char* str)'''<br/>
 +
* This function converts a double to a string variable, and returns the string. There will only be 2 decimal positions shown in the string. If we want to print a double value on the console screen, we can say: bio_putstr(myFtoa(val, str)). I think there is no need to code another function for bio_putdouble.<br/>
 +
<br/>
 +
'''int myPrint(const char* msg, ...)'''<br/>
 +
* This function works very similar with printf in stdio.h library. Float data type dose not work here; only double dose. The function only shows 2 decimal positions. <br/>
  
| Wang|| Shengwei|| [mailto:swang94@learn.senecac.on.ca?subject=OOP344 swang94] || A || http://shengwei-seneca.blogspot.com/ || Shengwei || n/a || [[Special:Contributions/swang94 | Contributions]] || Team Contact
+
== Microsoft SkyDrive ==
|-
+
We can put some useful files here.  
 +
* It's 25GB space, and the max size of a file which can be uploaded is 50MB.
 +
* All files can be set a certain permissions to allow different kinds of access.
  
| Xue|| Yong|| [mailto:yxue11@learn.senecac.on.ca?subject=OOP344 yxue11] || B || http://yxue11.blogspot.com/ || yxue11 || n/a  || [[Special:Contributions/yxue11| Contributions]] || Team Contact
+
[http://skydrive.live.com/ SkyDrive ]
|-
+
<br />
 +
ID: oop344_101rep4(same name as the repository)
 +
<br />
 +
PW: rangers
  
| ~ || ~ || [mailto:yxue11@learn.senecac.on.ca,swang94@learn.senecac.on.ca,Cwang84@learn.senecac.on.ca,daoberes@learn.senecac.on.ca,ajohn-sandy@learn.senecac.on.ca,dhuang18@learn.senecac.on.ca,cgcheung@learn.senecac.on.ca,schau5@learn.senecac.on.ca?subject=OOP344__MM_Coding_Rangers, e-mail all @ once] || ~ || ~ || ~ || ~ ||~ ||~
+
== <big>Helpful External Links</big> ==
|-
+
*[http://www.hydrairc.com/index.php?page=downloads Scroll down to find HydraIRC.exe or .zip]
 +
*[http://www.microsoft.com/express/Downloads/ Microsoft Visual Studio Express Edition Download]
  
|}
+
[[Category:OOP344]]

Latest revision as of 13:10, 18 June 2010


OOP344 | Weekly Schedule | Student List | Teams | Project | Student Resources

Member list

Last Name Name Seneca Username Section Blog Url IRC Nick SVN ID My Contributions Role Alternative Email Address
Chau Sunny schau5 B Blog ScsC schau5 Contributions The Experienced Guy ~
Cheung Christopher cgcheung B http://rocketpants.blog.ca/ Rocketpants n/a Contributions Team Contact ~
Huang Dachuan dhuang B Blog Da_Truth dhuang18 Contributions Team Leader Email
John-Sandy Anastasia ajohn-sandy B http://anastasiasaurus.blogspot.com annieJS ajohn-sandy Contributions Team Contact annieJS@gmail.com
Oberes Donna daoberes B Blog primadonna donna_o n/a Contributions Team Contact ~
Wang Cong Cwang84 A http://wangcong422.blogspot.com/ cwang84 n/a Contributions Team Contact ~
Wang Shengwei swang94 A http://shengwei-seneca.blogspot.com/ Shengwei swang94 Contributions Team Contact Email
Xue Yong yxue11 B http://yxue11.blogspot.com/ yxue11 n/a Contributions Team Contact ~
~ ~ e-mail all @ once ~ ~ ~ ~ ~ ~ ~

SVN Repository

oop344_101rep4

A2 assignment

Rangers' OpText Development Page

IRC nick/user Class(es)/File(s)
ScsC BFrame Class, btext.h, BField Class
Rocketpants BLabel class
Da_Truth BForm class, BTextEdit Class
annieJS TBA
donna_o primadonna BEdit class
cwang84 TBA
Shengwei BFrame Class, btext.h
yxue11 TBA

A1 Function assignment

Last Name Name Branches in workspace Simple Function(s) Complex Function(s)
Chau Sunny ScsC workspace bio_move - Committed to trunk bio_edit
Cheung Christopher cgcheung workspace bio_clrscr ~
Huang Dachuan Dachuan workspace bio_flush - Committed to trunck

bio_displayMenuItem - Committed to trunk

bio_edit - Committed to trunk

John-Sandy Anastasia ~ bio_cols - Committed to trunk ~
Oberes Donna Daoberes workspace bio_rows - Committed to trunk
bio_getch - Committed to trunk
bio_edit - Validation logic for *offset, *curpos, & *offset = NULL *DONE*; Before editing begins, if *curpos & *offset have invalid values *DONE*; Validation of positions that *curpos is never allowed to take *DONE*; !ReadOnly and *insertmode *To be modified*
Wang Cong ~ ~ bio_display/bio_displayflag
Wang Shengwei Shengwei workspace bio_putstr - Committed to trunk

bio_menuItem Committed to trunk bio_putint Committed to trunk

Xue Yong Yong workspace bio_putch Committed to trunk bio_flag()Committed to trunk

Coding Style

The Coding Rangers had their first somewhat informal meeting on Jan. 21 to determine a uniform coding style. They came up with the following:

  • Comment as much as you can using /* ... */.
    • At the top of every file, include your name, the filename, and the purpose of the file.
    • Comment on what a function is supposed to do before the function definition.
  • Change to newline once you reach column 80. Nothing to be typed beyond column 80!
  • When naming variables,
    • use single letters (like i, j, a, or v) for counters only;
    • assign the variable a name that best describes what it is used for (but please don't make it too long);
    • and separate words with caps.
      Eg. noOfOrders, not nooforders
  • When naming a function, name it according to what it is supposed to do.
    Eg. void updateDelivery, int setInitialValue, not void Deliveries, int InitialValues
  • Class names must begin with a capital letter
  • Declare each variable at the beginning of blocks.
  • Eg.

    main () { int length = 0; // correct, at the beginning of the block ... ... int flag = 1; // incorrect, at the middle of the block if ( length = 0) { int i = 0; // correct, at the beginning of the block ... ... bool valid = true; // incorrect, at the middle of the block } return 0; }

  • Declare each variable in a line by itself. It is easier to comment a variable this way. Do not use commas to separate the variable names if they have the same data type.
  • Eg. correct int i; //To count the number of times in for-loop int j;

    int k; //To count another variable

    Eg. wrong int i,j,k; //How do I separately comment

    int i; int j; int k; //the variables here?

  • Type four (4) spaces over for every block of code. (This is as opposed to tabbing.) For example:
  • main () {

    int x; //Notice the four spaces over
    int y;

    for (x = 0, y = 10; x < 10 && y >0; x++, y++) {

    printf("x is %d, y is %d\n", x, y);
    printf("The sum of x and y is %d\n", x + y);
    if (x == 5)
    printf("We've reached the halfway point!\n"); //Moved four spaces over again }

    printf("Hello, world!\n");
    }

  • Only main () will start at column 1. Tab every block of code four spaces over.
  • Include an empty line after the declaration of variables (see above example).
  • When using operators, make sure to have a space between the operands and the operator for readability.
    Eg. i = 0;, not i=0;
  • For keywords such as while, for, if, else, put a space after the keyword and the expression following it.
    Eg. if (x == 0) is correct; if(x == 0) is incorrect
  • When using brackets, put the opening bracket on the same line as the function or expression that opens it.
    Eg. CORRECT:
    int setSafeEmptyState {
    ...
    }

    INCORRECT:
    int setSafeEmptyState
    {
    ...
    }

Issues

Each member will post updates about their progress on the project. Triumphs, conflicts, and blood and tears will go here.

Sunny

However, a new "Error E2040 C:\Borland\BCC55\Include\conio.h 1: Declaration terminated incorrectly" has appeared. Fixed! Feb11th
I am running into this error "Error E2209 biof.c 32: Unable to open include file 'conio.h'". Know a way to fix this? Fixed!

Donna

Feb 20, 2010 - Just found out yesterday that another variable, int ReadOnly, has been added to parameters passed to bio_edit. ReadOnly is supposed to toggle between ReadOnly and !ReadOnly. This changes the default of the switch statement slightly.

Feb 4, 2010 - Committed my bio_rows to trunk. I ran into a few troubles while compiling, the biggest being Borland. Never used this compiler before. The frustrating part, after fixing all of my mistakes, is forgetting to take note of what went wrong so that I know how to fix it in the future. However, as far as I can recall, some of the biggest problems were:

  • Having to include -IC:\Borland\BCC55\Include \LC:\Borland\BCC55\Lib during compilation.
  • Empty parameters in the function prototypes (in biof.h) actually needed the word "void" rather than just leaving them empty. (I just checked the function prototypes in the biof.c file, and some of them are empty. However, fixing just the .h file was enough). For some reason, they're as good as being not prototyped.

There was something hinky about visual c++, too, but I forget now. I'll keep it in mind for next time.
As for the actual coding, I forgot that the word "struct" has to be included when creating a struct. (struct text_info x;).

Shengwei

  • AS2:

When we want to test our code under different platforms, it is important to change include statement in biof.c correspondingly.
Style 1:

#include "biof.h" 

Style 2:

extern "C"{
#include "biof.h"
};

VCC, BCC like style 1, while LNX likes style 2. MAC is unknown.

  • I found one blog from Fardad's blogger. I think it is good for us to have a look at it.

Dachuan

Placing void in Function(void) for Borland is important. It has gotten me frustrated a few times.
bio_putint() doesn't seem to work under VCC now? fixed.

bio_move() doesn't not work in Borland. fixed.

When using Putty, don't forget to set Function/Keyboard/Xterm R6!

When compiling on Mac: cc biomain.c biof.c -lcurses (and then) ./a.out

Cong

i really appreciate Sunny's help, my code works now.And i understand what link problem is.

i look the program and find a bug on tab key when you press tab key it jump 4 space forward but when you press backspace it suppose to jump back 4 space.

Cgcheung

Not really an issue but my own mistake. A reminder to include "-l ncurses" to the compile line in linux >_> .


Project Progress

Update the current project's progress here. List what's done in each part, and what's not done. Simply cross-out things that are done.

Simple Functions

Function Name Progress & Name Tested Platforms [VCC/BCC/LNX/MAC]]
void bio_init(void) Compeleted ALL
void bio_end(void) Completed ALL
int bio_rows(void) Completed by Donna ALL
int bio_cols(void) Completed by Anastasia ALL
void bio_clrscr(void) Completed by Chris VCC/BCC/LNX
void bio_flush(void) Compeleted by Dachaun ALL
int bio_getch(void) Completed by Donna VCC/BCC/LNX
void bio_move(int row, int col) Compeleted by Sunny VCC/BCC/LNX
void bio_putch(int ch) Completed by Yong VCC/BCC/LNX
void bio_putstr(const char* str) Completed by Shengwei VCC/BCC/LNX



Complex Functions

Function Name Progress & Name Tested Platforms [VCC/BCC/LNX/MAC]
void bio_display(const char* str, int row, int col, int len) Compeleted by Cong
void bio_displayflag(const char* format, int row, int col, int status) Compeleted by Cong
int bio_flag(const char* str, int row, int col, int* status, int radio) Compeleted by Yong VCC/BCC/LNX
void bio_displayMenuItem(...) Compeleted by Dachuan ALL
void bio_menuItem(...) Compeleted by Shengwei VCC/BCC/LNX
int bio_edit(char* str, int row, int col, int fieldlen, int maxdatalen, int *insertmode, int *offset, int *curpos, int IsTextEditor, int ReadOnly)
UP_KEY Completed
DOWN_KEY Completed
LEFT_KEY Completed
RIGHT_KEY Completed
PGUP_KEY Completed
PGDN_KEY Completed
HOME_KEY Completed
END_KEY In Progress by Chris Tested for BCC/VCC. Needs testing for LNX/MAC.
ENTER_KEY Completed by Anastasia
TAB_KEY In Progress by Anastasia
BACKSPACE_KEY Completed by Dachaun ALL
ESCAPE_KEY Completed
DEL_KEY Completed by Dachuan ALL
INSERT_KEY Completed
F1-F12 Completed
DEFAULT Completed by Donna VCC/BCC/LNX/MAC



Helper Functions


void bio_putint(int val)

  • It prints an integer on the screen.


char* toUpperCase(char* str)

  • This function only changes those letters in lower case to upper case. It changes the original string.


char* myItoa(int val, char* str, int base)

  • This function converts a decimal base integer to any other non-decimal base number, such as binary number or octal number, or hex number, and than converts that number into a string variable. Or, it converts a decimal base integer directly into a string. The function returns the address of the string at the end.


char* myFtoa(double val, char* str)

  • This function converts a double to a string variable, and returns the string. There will only be 2 decimal positions shown in the string. If we want to print a double value on the console screen, we can say: bio_putstr(myFtoa(val, str)). I think there is no need to code another function for bio_putdouble.


int myPrint(const char* msg, ...)

  • This function works very similar with printf in stdio.h library. Float data type dose not work here; only double dose. The function only shows 2 decimal positions.

Microsoft SkyDrive

We can put some useful files here.

  • It's 25GB space, and the max size of a file which can be uploaded is 50MB.
  • All files can be set a certain permissions to allow different kinds of access.

SkyDrive
ID: oop344_101rep4(same name as the repository)
PW: rangers

Helpful External Links