Thread: Check out my code

  1. #1
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146

    Post Check out my code

    On Programmers' Day, I felt the need to write some code. I've been learning bits and pieces of HTML recently, and I came across a nice way to write HTML tables to make calendars. I thought that was cool, but it was tedious to write the HTML code for them by hand. So, I wrote a program that can write the HTML code for a calendar.

    I'm posting my code for two reasons. First, because I want to show it off to someone who can understand and appreciate it Second, so that I can get some feedback and criticism. Please let me know what you think.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  2. #2
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    Posts
    219
    First your question of Enter the first day of the month, is not clear to the user. It also put september as starting on thursday(5) when I specified monday(1). Otherwise it is okay. Also with <cstring> I got 13 errors. I changed it to <string> and all was okay.
    Last edited by velius; 09-15-2003 at 06:20 AM.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

  3. #3
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Originally posted by velius
    First your question of Enter the first day of the month, is not clear to the user.
    Well, I guess I could put something in like (ex. Wednesday), but I fail to see where confusion could arise.

    It also put september as starting on thursday(5) when I specified monday(1).
    Did you try to enter a number when prompted for the first day of the month? I tested my program for every month in 2003, and I just tested it again for September. When prompted for the first day of the month, the user is supposed to enter a string like "Monday".

    Otherwise it is okay. Also with <cstring> I got 13 errors. I changed it to <string> and all was okay.
    Ahh, you're right about that one. It compiles just fine wo/that 'c'.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  4. #4
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    Posts
    219
    Actually I used your source code to determine what values to type. And for the start of the month your program seemed to want an int not a string. I guess I miss read your source code.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

  5. #5
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Originally posted by velius
    Actually I used your source code to determine what values to type. And for the start of the month your program seemed to want an int not a string. I guess I miss read your source code.
    Yeah, you did. Understandable, though. I read in a string like "Monday" and then convert it to an int, in this case 1. Sorry for the confusion.

    Anything else?
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  6. #6
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    why not write it in PHP or Javascript? that way it can be run on the web...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  7. #7
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    couple semesters ago I had to write a shell script that made a simple html web page....I'm sure everyone wants to know!

    axon

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  8. #8
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Originally posted by major_small
    why not write it in PHP or Javascript? that way it can be run on the web...
    The simple answer to that is because I don't know those languages. I'm moving into Drexel University tomorrow. I've got 18 credits first term. I don't forsee learning any new languages in the near feature unless they're required for my intro to comp sci course.

    Then again, I imagine it wouldn't be too tough to just convert a single program. I dunno. Not tonight, though. I've gotta finish packing for the big move tomorrow. Yay for college!
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  9. #9
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Originally posted by joshdick
    I'm moving into Drexel University tomorrow. I've got 18 credits first term.
    hey congrats...college will be a lot of fun for you man! I know I'm having a blast....hehe...yea....wooohoooo.... huraahh....
    beer...coffee....cigarettes....coffee....beer...as pirin ....loud music ....yeah!


    but anyways...18 credit hours is a good start...it will keep ya busy the first semester! the most I ever took is 21...! that was a good ride.... anyhow, speaking of other languages, you probably will learn a language such as HTML or javascript. In my first cs class we did html, jscript, and shell scripts.

    anyways, have fun, and don't give up....best advice: don't procrastinate....manage your time wisely.

    axon

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  10. #10
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Originally posted by joshdick
    The simple answer to that is because I don't know those languages. I'm moving into Drexel University tomorrow. I've got 18 credits first term. I don't forsee learning any new languages in the near feature unless they're required for my intro to comp sci course.

    Then again, I imagine it wouldn't be too tough to just convert a single program. I dunno. Not tonight, though. I've gotta finish packing for the big move tomorrow. Yay for college! :D
    learning PHP shouldn't be hard... from what I've heard it's extremely close to C/C++...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code Check
    By Dae in forum C++ Programming
    Replies: 12
    Last Post: 01-08-2009, 07:01 PM
  2. HELP!!!!emergency ~expert please help
    By unknowppl in forum C Programming
    Replies: 1
    Last Post: 08-19-2008, 07:35 AM
  3. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Game Programming
    Replies: 0
    Last Post: 10-14-2002, 01:27 PM
  4. << !! Posting Code? Read this First !! >>
    By kermi3 in forum C# Programming
    Replies: 0
    Last Post: 10-14-2002, 01:26 PM
  5. Check my code Please
    By AdioKIP in forum C++ Programming
    Replies: 1
    Last Post: 03-12-2002, 08:52 PM