buckwheat88

Members
  • Content Count

    27
  • Joined

  • Last visited

Posts posted by buckwheat88

  1. Hi, I was wondering if anyone knew of any free, free demo, or cheapest software for recovering photos off of a SanDisk SDHC card. All the photos were accidentally deleted. I found one program that was "free". I was able to preview all the photos on the disk, but I would have to pay $40 to save the photos. I tried searching for software but the only things I could find were similar products or links to forums. Figured if all I could do was find forums anyways, I would ask a forum that I knew and trusted. Searched here to see if the question was asked before, but I couldn't find anything. So anyways, anyone know any free, free demo, or cheaper than $40 software to recover deleted photos off a Sandisk SDHC card? Thanks!

    - Aron

  2. edit! *Oh gosh, I just noticed after posting this that I'm posting under Buckwheat....Aron must have logged in here and I didn't notice--oh well, this is Liz*

    LOL, Pat....you were a wee bit cranky, weren't you? :D That's perfectly OK, by the way! *bighug* I got a big grin from reading your post and thought "sisters in arms"! I should have posted about my day yesterday, but I was TOO cranky and tired! Ton of stuff to do and Hubby sat on the couch all day and never even offered to ask to help (noooo, I won't ask him, he's supposed to notice such things, right?) And today, when I only had a fraction of the things-to-do, what did he do? Asked if I needed help and cooked supper....wonder if he figured out I was mad at him? :D

    I agree with the kids and Santa.....luckily (?) my kids ran up to him with open arms and leaped on his lap with hugs. But I'm a "bad momma" I guess. I've always told them to trust strangers when they're in trouble as 99% of strangers will help a child. Came in handy when Son got lost and knocked on a stranger's door for directions home, she gave him a ride!

    And if a kid is shy, it's not their fault and they should NEVER be forced to sit on Santa's lap! Every good Santa knows that, shame that the parents don't!

    Write "Happy New Year" on your cards and you'll be OK! :thumbsup:

    Oh, Merry Christmas to everyone!

    Liz

  3. Not sure if this belongs in this forum section, but seemed like the most logical explanation to me...

    I went to get on my girlfriend's laptop and noticed the zip drive sticking out of it was crooked, pulled the zip drive out and the black strip in the middle of the USB port came out with it. I'm just wondering if I can just slide the black strip back on to the golden metal prongs or if it has to be professionally fixed, or replaced.

    Thanks for your time,

    Aron

  4. A little game manual was dropped on the keyboard and a couple of shortcut type keys were pressed and now IE is abnormally large. The file, edit, help, etc menu area and address bar are gone and the taskbar on bottom automatically hides only when IE is open. I'm sure it's something easy like pressing alt-m or ctrl-z or something, just don't know which one's were pressed, wasn't really paying attention when the manual was dropped. If anyone knows which keys were pressed, and which keys will reverse it I would greatly appreciate any response. I'll add a pic on bottom to see what it looks like, if I'm not clear enough.

    Mom freaked when I almost posted this under her screen name *thinks of other ways as easy as this that I can piss her off*

    untitled1.jpg

  5. Sorry about not responding sooner, have either been busy or forgeting about this, but thank you all for the help! Thanks to everyone who helped with any of the questions that I had, it was much appreciated. Got the program working, don't know how I did though, as it was due on the last day of class. Ended up getting an A- overall in the grade though. Wouldn't have been able to do it (well without pulling out patches of hair out of frustration) without you guys.

    Thanks again!

    -Aron

  6. I am now also working on decode.cpp. I believe I have everything right up to the last step. I have some pseudocode written out, but don't know how to code my pseudocode...

    My pseudocode is for the do while statement at the end. This is what I have:

    do
    Read from the odd file
    if the end of file has not been read for the odd file, write into the write file
    Read from the even file
    If the end of file has not been read for the even file, write into the write file
    While(you have not read past the end of file for odd and even)

    This is the code I have written out so far:

    // stdlib required for the exit() function
    #include <stdlib.h>
    #include <stdio.h>
    #include <iostream.h>
    #include <time.h>
    #include <string.h>


    int main()
    {
    long int sec_since_1970;
    char date_time_string[26];

    char write_filename[65];
    FILE *read_file_pointer, *write_file_pointer;
    int input_value;
    FILE *myfile;

    // This function will produce the # of seconds since 1970
    time(&sec_since_1970);

    // Copy the date & time into a manageable array
    strcpy(date_time_string, ctime(&sec_since_1970));

    // Set last position to null.
    // Some versions of this function incorporate a line feed at this point
    date_time_string[24]=0;

    cout << "\n\nDate time string = " << date_time_string;


    // Get filenames from user
    cout << "\n\nEnter the write File Name ";
    cin >> write_filename;


    // Open files in binary mode
    myfile = fopen("odd.txt", "rt");
    myfile = fopen("even.txt", "rt");

    if(write_filename[0] !=0) write_file_pointer = fopen(write_filename, "wb");
    else write_file_pointer = NULL;

    if(write_file_pointer == NULL) exit(1);

    do
    {
    input_value = fgetc(read_file_pointer);
    if(!feof(read_file_pointer))
    {
    fputc(input_value, write_file_pointer);
    }
    }
    while(!feof(read_file_pointer));
    // while(feof(read_file_pointer)==0) could also be used

    fclose(read_file_pointer);
    fclose(write_file_pointer);
    return 0;
    }

  7. Ok, figured out the counter shiznit, the way he put it confused me. "Integer counter variable" confused me, if he would have said an "int counter" I would have known what to do. Did that step, and also added in the date and time, and this is what I have up to now:

    // stdlib required for the exit() function
    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>
    #include <string.h>


    int main()
    {
    long int sec_since_1970;
    char date_time_string[26];


    char read_filename[65], write_filename[65];
    FILE *read_file_pointer, *write_file_pointer;
    int input_value, C;
    FILE *myfile;

    // This function will produce the # of seconds since 1970
    time(&sec_since_1970);

    // Copy the date & time into a manageable array
    strcpy(date_time_string, ctime(&sec_since_1970));

    // Set last position to null.
    // Some versions of this function incorporate a line feed at this point
    date_time_string[24]=0;

    cout << "\n\nDate time string = " << date_time_string;


    // Get filenames from user
    printf("Enter the read File Name ");
    gets(read_filename);


    // Open files in binary mode
    if(read_filename[0] !=0) read_file_pointer = fopen(read_filename, "rb");
    else read_file_pointer = NULL;

    if(read_file_pointer == NULL) exit(1);

    myfile = fopen("odd.txt", "wt");
    myfile = fopen("even.txt", "wt");

    int counter = 0;

    do
    {
    input_value = fgetc(read_file_pointer);
    ++counter;
    if(!feof(read_file_pointer))
    {
    fputc(input_value, write_file_pointer);
    }
    }
    while(!feof(read_file_pointer));
    // while(feof(read_file_pointer)==0) could also be used

    fclose(read_file_pointer);
    fclose(write_file_pointer);
    return 0;
    }

    For the last step,

    (Remove the fputc() line and replace it with a conditional statement that fputc()s to the odd.txt file when counter is odd and to the even.txt file otherwise. (Remember modulus).)

    a conditional statement, would that be like an if-then statement? a do-while statement? something else?

    And for fputc() I understand kinda how it works. Take "fputc('a', stdout) for example writes a character 'a' to the standard output, but for putting the odd counter to odd.txt and evens to even.txt, what would I put in for the written character? The place to put it would be "fputc('?', odd.txt) right?

  8. Ok, I've hacked through it a little bit, have this for encode.cpp:

    // stdlib required for the exit() function
    #include <stdlib.h>
    #include <stdio.h>


    int main()
    {
    char read_filename[65], write_filename[65];
    FILE *read_file_pointer, *write_file_pointer;
    int input_value, C;
    FILE *myfile;


    // Get filenames from user
    printf("Enter the read File Name ");
    gets(read_filename);


    // Open files in binary mode
    if(read_filename[0] !=0) read_file_pointer = fopen(read_filename, "rb");
    else read_file_pointer = NULL;

    if(read_file_pointer == NULL) exit(1);

    myfile = fopen("odd.txt", "wt");
    myfile = fopen("even.txt", "wt");

    do
    {
    input_value = fgetc(read_file_pointer);
    if(!feof(read_file_pointer))
    {
    fputc(input_value, write_file_pointer);
    }
    }
    while(!feof(read_file_pointer));
    // while(feof(read_file_pointer)==0) could also be used

    fclose(read_file_pointer);
    fclose(write_file_pointer);
    return 0;
    }

    and now I don't think I know how to do step 4: "Declare an integer counter variable and set to 0". Not sure if it's the wording or if I just missed that part in class

  9. Ok, now that I'm working on this and not finding answers in my notes, I'm becoming confused. I'm writing encode.cpp, under his hints he has "Delete the write-file prompt, filename input, and fopen()," I'm assuming it's these lines,

    "if(write_filename[0] !=0) write_file_pointer = fopen(write_filename, "wb");

    else write_file_pointer = NULL;"

    but I'm not sure if it's exactly these two lines, more or less.

    (Already removed the line that changes case, this is what I have written so far, not very far as you can see)

    // Encode.cpp by Aron 12/05/2002

    // This program demonstrates the use of single character
    // file input/output functions to read a file, change lower
    // case characters to upper and write them back. Be careful,
    // the integrity of most files will be destroyed by this operation.
    // File names are input from the keyboard.


    // stdlib required for the exit() function
    #include <stdlib.h>
    #include <stdio.h>


    int main()
    {
    char read_filename[65], write_filename[65];
    FILE *read_file_pointer, *write_file_pointer;
    int input_value;

    // Get filenames from user
    printf("Enter the read File Name ");
    gets(read_filename);

    printf("Enter the write File Name ");
    gets(write_filename);


    // Open files in binary mode
    if(read_filename[0] !=0) read_file_pointer = fopen(read_filename, "rb");
    else read_file_pointer = NULL;

    if(read_file_pointer == NULL) exit(1);

    if(write_filename[0] !=0) write_file_pointer = fopen(write_filename, "wb");
    else write_file_pointer = NULL;

    if(write_file_pointer == NULL) exit(1);

    do
    {
    input_value = fgetc(read_file_pointer);
    if(!feof(read_file_pointer))
    {
    fputc(input_value, write_file_pointer);
    }
    }
    while(!feof(read_file_pointer));
    // while(feof(read_file_pointer)==0) could also be used

    fclose(read_file_pointer);
    fclose(write_file_pointer);
    return 0;
    }

  10. Don't really have a question yet, I'm just sure I will have one eventually. Writing out what I have to do so I can save myself that step when I actually have a question...

    Encode.cpp

    Your company is concerned about the security of data shipped through the mail or the Internet. It is your duty to devise a program that will read a file and creat two encoded files. Read the file to be encrypted and alternately place the character read into one of two files opened, one called odd.txt and the other called even.txt.

    Decode.cpp

    You are also requested to write a program that will recreate the original file. Once again, use Chario.c as an example. Alternately read from the odd and even files, writing the character read into the write file.

    You muse use // for comments and cout, cin for screen output and keyboard input. Also, display the current date and time in the upper left corner of the screens.

    General Hints:

    1. Find Chario.c from the C FILE INPUT/OUTPUT OPERATIONS handout (I'll supply for the forum).

    2. Key it in as Chario.cpp.

    3. Remove the line that changes the case.

    4. Test the program to see if it copies a file.

    5. Change comments from /* to //

    6. Test again.

    7. Copy Chario.cpp to Encode.cpp and Decode.cpp

    Encode.cpp hints

    1. Leave the read-file prompt, filename input, and fopen() as is.

    2. Delete the write-file prompt, filename input, and fopen().

    3. Open the files odd.txt and even.txt for writing.

    4. Declare an integer counter variable and set to 0.

    5. After the fgetc() line, increment the counter.

    6. Remove the fputc() line and replace it with a conditional statement that fputc()s to the odd.txt file when counter is odd and to the even.txt file otherwise. (Remember modulus).

    Decode.cpp hints

    1. Delete the read file user prompt and file open and replace the opening of the files odd.txt and even.txt

    2. Leave the write file prompt and open as is. Allow the user to determine the name of the reconstruced file.

    3. Modify the do-loop as follows:

    a. Perform the loop as long as the end of file has not been reached in both files.

    b. Input a character from the odd file and write it if eof has not been reached.

    c. Input a character from the even file and write it eof has not been reached.

    Here's chario.c

    /* chario.c by Teacher 11/26/2002
    *
    * This program demonstrates the use of single character
    * file input/output functions to read a file, change lower
    * case characters to upper and write them back. Be careful,
    * the integrity of most files will be destroyed by this operation.
    * File names are input from the keyboard.
    */

    /* stdlib required for the exit() function */
    #include <stdlib.h>
    #include <stdio.h>


    int main()
    {
    char read_filename[65], write_filename[65];
    FILE *read_file_pointer, *write_file_pointer;
    int input_value;

    /* Get filenames from user */
    printf("Enter the read File Name ");
    gets(read_filename);

    printf("Enter the write File Name ");
    gets(write_filename);


    /* Open files in binary mode */
    if(read_filename[0] !=0) read_file_pointer = fopen(read_filename, "rb");
    else read_file_pointer = NULL;

    if(read_file_pointer == NULL) exit(1);

    if(write_filename[0] !=0) write_file_pointer = fopen(write_filename, "wb");
    else write_file_pointer = NULL;

    if(write_file_pointer == NULL) exit(1);

    do
    {
    input_value = fgetc(read_file_pointer);
    if(!feof(read_file_pointer))
    {
    if(input_value >= 'a' && input_value <= 'z') input_value -=32;
    fputc(input_value, write_file_pointer);
    }
    }
    while(!feof(read_file_pointer));
    /* while(feof(read_file_pointer)==0) could also be used */

    fclose(read_file_pointer);
    fclose(write_file_pointer);
    return 0;
    }

  11. Hi, I have to convert some of my programs from C to C++. I think I'm doing it right, but I'm getting errors. This is my original program:

    /* million.c by Aron 10/03/2005 */

    /* This program asks the user to input a dollar
    * amount and an interest rate, and the program
    * will calculate how long it will take to reach
    * $1 million. Input comes from the keyboard and
    * output is sent to the screen
    */

    #include<stdio.h>
    int main()
    {
    /* Declaration */
    int years;
    double amount, rate;

    /* Heading */
    printf("Million\n\n");

    /* Input Section */
    do
    {
    printf("Enter Amount ");
    scanf("%lf", &amount);
    }
    while(amount < 1.00 || amount > 250000.0);

    do
    {
    printf("\nEnter Rate (Ex: .03, .04) ");
    scanf("%lf", &rate);
    }
    while(rate < .01 || rate > .29);

    /*Processing */
    years = 0;

    while(amount < 1000000.0)
    {
    ++years;
    amount = amount + amount * rate;
    }

    /* Output Section */
    printf("\n\n%d Years required to reach $%.02lf\n",
    years, amount);

    return 0;
    }

    and this is what I have so far in my converted program:

    // million.cpp by Aron 11/27/2005

    // This program asks the user to input a dollar
    // amount and an interest rate, and the program
    // will calculate how long it will take to reach
    // $1 million. Input comes from the keyboard and
    // output is sent to the screen

    #include<stdio.h>
    #include<iostream.h>
    int main()
    {
    // Declaration
    int years;
    double amount, rate;

    // Heading
    cout <<"Million\n\n";

    // Input Section
    do
    {
    cout <<"Enter Amount ";
    cin >>"%lf", &amount;
    }
    while(amount < 1.00 || amount > 250000.0);

    do
    {
    cout <<"\nEnter Rate (Ex: .03, .04) ";
    cin >>"%lf", &rate;
    }
    while(rate < .01 || rate > .29);

    // Processing
    years = 0;

    while(amount < 1000000.0)
    {
    ++years;
    amount = amount + amount * rate;
    }

    // Output Section
    cout <<"\n\n%d Years required to reach $%.02lf\n",
    years, amount;

    return 0;
    }

    I'm getting the errors "local variable 'amount' used without having been initialized" and "local variable 'rate' used without having been initialized", but weren't they both initialized in the declaration?

    Thanks in advance for the help

  12. Hi, me again! Have 2 quick questions (one about C programming, another about the forum). I'll tackle the forum question first...

    Every time I have a new question on how to program something, should I start a new topic, or keep all my questions in one? Don't want to clutter the forum with a bunch of new topics asking questions, but I want my newest post to be known as a new question, not as a reply to my old one.

    *edit again*

    Ok, figured out my first programming question. May have another question later on tonight, so I'm keeping this thread, also because my first question still applies. Thanks if you almost helped!

    *last edit*

    Didn't need any help with the 2nd program. Once I figured out the first one the second one was a breeze. I think I may be learning, YAY! Question about starting a new topic or reviving old still in effect

  13. Thank you all again (sorry bout the dead thread revival, just that todays the first day I've been here since the 12th).

    And I didn't get a hangover, thanks mom! Thankfully I recieved that gift from you, I don't get hangovers either (had 1 my entire life).

    And yeah, the name, buckwheat, is from a nickname that my grandpa used to call me and the 88 is when hotmail randomly generated a new screenname (buckwheat was already taken) so now I use the 88 on almost everything.

    But thanks again for the birthday joy

  14. Figured out the problem I was having. I understood that amount had to be in there, but the program still wasn't working. After comparing the 2 programs (the one using only float that worked, and my program that still didn't work) I finally realized my problem was here:

    I originally had "scanf("%lf", &miles);" but miles was an integer value, not a floating point, so I had to change it to "scanf("%int", &miles);". Minor mistake that I just never noticed. Once I noticed it I was like "D'Oh! Of course!"

    But anyways, thanks for the help.

  15. I know this doesn't really have anything to do with the problem that we're working with now, but I fixed one minor problem that I was having. The problem was the number of decimal places for the final product. I was getting "0.000000", but I made the final floating point "$%.2lf" to make it say "$0.00" now.

    And I think I'm going to go to bed and work on it some more during my breaks tommorrow (it's 2 am here, have to be up at 8 am). So good night, and thanks for your help.

  16. Thanks!

    Yeah, I noticed my mom was very able to add her input often, with the speed that she got to almost 2000 posts. In other forums that I've been active in for over a year, I don't even have that many posts... Thats my mom for ya though, once you get her to talk she doesn't quit.

    Thanks for the luck, I'll need it. I've been a coach for 3 years and a referee for about 5, so hopefully that gives me some practice for teaching, although I'm sure it will be quite different.

    So far so good for enjoying my stay. Been getting quick help when I have questions.

    Thanks again!

    -Aron

  17. So it's kinda like what shanenin was saying earlier, I should add "amount" to the end of the final "printf()". Earlier when I attempted that it gave me a weird number every time, now when I do that it's giving me 0.000000 again.

    I also notice I don't have rate anywhere except for in my formula, should rate be in somewhere?

  18. @ Hai-Etlik

    I kinda understand what you're saying Hai-Etlik... I changed the "if" statements to "else if" statements, that worked fine, but the first part I'm kinda foggy on.

    Are you saying I should add something similar to this "("%i %i %lf", intvar1, intvar2, doublevar1)" into my program, only using my values instead, for example "("%lf, %lf, %d", &rate, &amount, &miles)", and should I put that in the scanf() section?

    @ shanenin

    I think I do need the "amount" added in there, but I think I need something else too, because every time I run the program with that added, no matter what number I put in, I get "-47244603.000000"

  19. Yeah, you're right. I didn't need it in there. I was writing it as I go, was thinking I was going to use it at first and didn't think about deleting it until you said something. Good call

    *edit*

    Hmph, that's weird. I don't know why it works with float but not double...

    Not sure if this is related, but I have an "int" value and a "double" value, but I only use the "double" conversion specifier (%lf). Should I use the int conversion specifier (%d) somewhere?