Thread: Google and c

  1. #31
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Quote Originally Posted by MK27
    I just mention this because it kind of sounds like someone has taken a very wacky, excessively complex route to accomplish a fairly straightforward task, and if you are interested in learning about things like this, you are being led astray...
    Hence my Rube Goldberg machine comment

    Quote Originally Posted by Angel45
    The reason there is so many lines of code is because the information is being stored into text files everywhere.
    If you're using what I suggested, then you should just be storing the data in memory. If you do write to file, it will because you are writing the translation obtained from the service to file as output.

    Quote Originally Posted by Angel45
    And everything is getting evaluated twice to get the correct size for malloc to be called.
    What do you mean by "evaluated twice"?

    Quote Originally Posted by Angel45
    It gets exactly what the chrome developers tools get, which is .html, with .js as I believe. We technically are not even running that code, we are just collecting and reorganizing it to display just the results which are stored in the code.
    Then that sounds like you are not actually leveraging the developer tools. My impression is that you used the source inspection from the developer tools, decided that you would like to parse that for the translated text, and so went about trying to leverage the developer tools do that.

    But the truth is that if you just want to get the translated text, then trying to format source in the same way as the developer tools is pointless. You might need the source of the page in order to get certain pieces of data so as to mimic the AJAX request to the service, but you don't need to mimic what the developer tools do. You need to mimic what the script on the page itself does.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #32
    Registered User
    Join Date
    Mar 2012
    Yeah there was no reason to write to file, we just wanted to see what we were getting. We evaluated it once to see the size of the string and other information, then did the same thing to fill it into a new string with the correct size after changes. And thanks for all the help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. The end of Google
    By Mario F. in forum General Discussions
    Replies: 34
    Last Post: 09-22-2010, 12:06 AM
  2. Reading Google Sketchup (.skp) or Google Earth (.kmz)
    By Zeeshan in forum Game Programming
    Replies: 9
    Last Post: 03-07-2008, 05:25 PM
  3. google down
    By DavidP in forum A Brief History of
    Replies: 6
    Last Post: 07-28-2004, 03:11 PM

Tags for this Thread