Is My New Chemistry Program Better Than the Windows Version?

Click For Summary
SUMMARY

The discussion centers on a new chemistry program uploaded to SourceForge, which is designed to outperform a Windows version used in laboratory settings. The program currently lacks an install target in the makefile due to issues with the $MANPATH variable on the RH 8.0 system. Several bugs were identified, including segmentation faults triggered by specific key presses and memory leaks, with actionable hints provided for resolving these issues. The developer has addressed some bugs and plans to implement further fixes based on user feedback.

PREREQUISITES
  • Familiarity with SourceForge project management
  • Understanding of makefiles and installation processes
  • Knowledge of debugging techniques in programming
  • Experience with memory management in C/C++
NEXT STEPS
  • Research how to define and use the $MANPATH variable in Linux
  • Learn about debugging tools like GDB and memory profilers such as memprof
  • Explore best practices for error handling in C/C++ programming
  • Investigate methods for implementing user input validation in software applications
USEFUL FOR

Software developers, particularly those working on scientific applications, programmers interested in debugging techniques, and contributors to open-source projects will benefit from this discussion.

grady
Messages
65
Reaction score
2
I just uploaded a project to sourceforge. I got the idea from a windows program that I used in the lab this semester. The program is simple, but it still does more than the windows program I had to use (yay), and you don't have to use a mouse. The project is at http://sourceforge.net/projects/mmconv/

I still need to put an install target in the makefile, but I haven't figured out how to get the system's man page directory. I hear it should be $MANPATH, but $MANPATH isn't defined on my RH 8.0 system so I'm still looking into it.
 
Computer science news on Phys.org
We're Sorry.
The SourceForge.net Website is currently down for maintenance.
We will be back shortly

O, well. Maybe tomorrow.

About the man pages, have you tried doing man man
 
Just playing around with the program a little here are some bugs I found:

1. Seg Fault when '?' is entered
Hint: Simply check if \0 is the next character in the string. If it is, error, else proceed to error check some more

2. Seg Fault when F1-F4 are pressed
Hint: Check for unusual ascii characters

3. Seg Fault when return is pressed with no input.
Hint: Check to see if there is anything in the string before processing it.

4. Memory Leaks Galore
Hint: Walkthrough program with debugger and make sure you free everything you allocate. Use an app like memprof to help you deduce which function the memory leak is coming from.

5. Integer/Float overflow
Hint: If you don't want to bother with large numbers, atleast warn the user and don't print out wrong answers.

6. Any number of periods accepted anywhere in the formula
Hint: Check for multiple periods within numbers. Also check for stray periods

Look what I did:

compound > H.H...
mass (g) > ...
H : nan g
H : nan g

7. Characters Accpeted for Mass
Hint: Check your string to make sure the characters are between '0' and '9'

8. Multiple Instances of Element Printed
Hint: Flag the elements you've already printed out, so you don't repeat them.
 
9) Your allowed to type a question mark followed by the element. It puts everyone on one line if you do.

compound > ?HI
mass H (g) > 2
mass I (g) > 3
H 1.000000 I 0.011914
Total mass (g): 5.000000
 
Ok, I fixed 1-4. 5 I'll fix later. 6&7 I'm not worried about right now, but I didn't know that was there so thanks for pointing them out and I'll fix them when i have some more time. 8 is a feature, and I prettied up the output of ? so 9 is "fixed". Thanks for all of the input, dduardo.
 

Similar threads

Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
895
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 10 ·
Replies
10
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K