Thread: Ignoring most information from File.

  1. #46
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Even if this was an intro to C course, this isn't exactly an amazing example of why C is good. There are much more suited languages to this task.
    O_o

    Really?

    *shrug*

    No. There is no language more suited to the task when the task is "Learn to solve problems using the C language.".

    Imagine that if instead of writing a file with | as separators, the data was originally arranged in an XML style format.
    Yes. Let us imagine that the data had been provided as an XML document.

    Your task is sampling the data for reproduction with adjusted values as from currency conversion.

    You are allowed to use any language you like which, for this discussion, is guaranteed to have a "super awesome", either SAX or DOM at your discretion, XML parser.

    Depending on the quality of the parser, you may need to write a few dozen lines or several hundred. You may assume you have an XML parser as sophisticated as any as you have had exposure in any language with which you are familiar so as to ease your burden in accomplishing the given task. You, again for discussion, choose to use "Xerces" with the C++ language.

    Ready? Go!

    *seven seconds passes*

    Are you done?

    I am done.

    I imagined that my data was provided as a relational database living on a "PostgreSQL" instance with tables designed by a seasoned professional who, knowing that one column was a currency value, provided triggers with conversion provided by one of the industry standards.

    I'm going to assume that you'll take a little more time yet will accomplish the task.

    I accomplished the task, and I didn't even need to look away from my browser.

    Wait. We are even having this discussion because we are assuming an academic exercise. The format of the data is not actually relevant to the true task.

    Let us now imagine instead that the project was designed as an introduction to using the "Xerces" parsing library with the C++ language making the true purpose of the exercise familiarity with a commonly used tool.

    Obviously, I didn't get anything of value from my effort with respect to the purpose of the exercise.

    You on the other hand, having successfully employed the library and language to accomplish a task, gained experience solving problems with the tools being covered. You have learned something of processing XML serialized data using the "Xerces" library. You are more familiar with a common tool; you are thus a better candidate for some positions.

    If your goal was learning to process data with the "Xerces" library, how silly would it be for me to suggest you just use "PostgreSQL" and add your data to a database? The use of a relational database may even be more suitable for the tasks you have planned, and you could find many here who could advise you about which path to take, but your goal of learning to use "Xerces" can't be accomplished with "PostgreSQL". Similarly, learning to deconstruct an unfamiliar problem by breaking into smaller problems so as a solution may be implemented within the C language can not be accomplished with PHP and XML data.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  2. #47
    Registered User
    Join Date
    Dec 2014
    Location
    Czech Republic
    Posts
    36
    Happy new year to everyone, who reads it .

  3. #48
    Registered User
    Join Date
    Jun 2014
    Posts
    79
    Quote Originally Posted by Siggi View Post
    Happy new year to everyone, who reads it .
    The same to you, Siggi. Many thanks.

  4. #49
    Registered User
    Join Date
    Sep 2014
    Posts
    364
    Happy new year from Vienna/Austria
    (we are in the same timezone)
    Other have classes, we are class

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ignoring the stdio.h file in a c file
    By Raj 89 in forum C Programming
    Replies: 4
    Last Post: 11-28-2012, 11:08 AM
  2. removing/ignoring carrage returns from a file
    By katipo in forum C Programming
    Replies: 3
    Last Post: 12-01-2008, 03:55 PM
  3. Ignoring line in C++ when reading from file
    By falzone in forum C++ Programming
    Replies: 7
    Last Post: 11-16-2007, 12:08 AM
  4. File information in C
    By jakewendt in forum C Programming
    Replies: 2
    Last Post: 10-11-2002, 04:12 PM
  5. Ignoring a word from a .txt file
    By TrojanGekko in forum C++ Programming
    Replies: 1
    Last Post: 01-21-2002, 05:14 PM