User Profile

Collapse

Profile Sidebar

Collapse
dariophoenix
dariophoenix
Last Activity: Apr 10 '07, 01:28 AM
Joined: Oct 10 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dariophoenix
    started a topic Cgi

    Cgi

    I'm not sure whether this is the right place to ask, but...
    Me and a group of partners are developing a search engine; the basic idea is that a C++ module is invoked from a Linux console before starting to process queries: that is the indexing module, and it prepares all the data and data structures necessary to rsolve queries. That's alright: the problem is that we cannot find a way to solve the queries using CGI (the thechnology recommended...
    See more | Go to post

  • dariophoenix
    started a topic Deleting elements from a STL List conditionally
    in C

    Deleting elements from a STL List conditionally

    Hi,
    We¡re getting a segmentation fault because we¡re trying to delete elements from a List while traversing it, i.e.:

    Code:
    void Character::deleteProcessed(list<Line> &active,int y){
    	bool erasedAtTheEnd = false;
    	for (list<Line>::iterator it = active.begin();it != active.end()&&!erasedAtTheEnd;){
    		if (it->getHighPoint().getY() < (HeightFloat/Height)*(y+1)){
    ...
    See more | Go to post
    Last edited by dariophoenix; Nov 21 '06, 07:11 PM. Reason: Burnout

  • dariophoenix
    started a topic SVG, XML and W3C
    in C

    SVG, XML and W3C

    Greetings,
    We are making a rendering program. It receives an XML document which specifies how to do so, following the SVG format. The problem is: We need to underrstand the metrics used in that document so as to interpret the drawing commands correctly. Which leads us to reading the SVG specification in w3c.org, which leads us to conclude that their explanations suck.
    Do you know about a site which gives a more concrete explanation,...
    See more | Go to post

  • dariophoenix
    replied to Declare a Class
    in C
    Forgot the destructor
    See more | Go to post

    Leave a comment:


  • dariophoenix
    replied to Declare a Class
    in C
    Code:
    class Account{
       float balance;
    public:
       Account(float balance=0);
       float balance();
       float withdraw(float withdrawal);
       void deposit(float depositedAmount);
    };
    See more | Go to post
    Last edited by dariophoenix; Nov 9 '06, 02:42 AM. Reason: Error

    Leave a comment:


  • dariophoenix
    started a topic Memory control in C++
    in C

    Memory control in C++

    Does anyboy know if there is a way, in C++, to know how much free space left is there in the heap? (During runtime)
    See more | Go to post
    Last edited by dariophoenix; Nov 9 '06, 02:33 AM. Reason: Forgot something

  • dariophoenix
    replied to arrays
    in C
    To begin with, you should define a struct with the fields you need (year, winner, score, etc. with the typed you think appropiate). Then, define a vector<structTy pe> and push_back the records received in input 1. When you need to search, to make it simple, ask for an iterator for the vector and search sequentially comparing the corresponding field.
    This site is great:

    www.cppreferenc e.com...
    See more | Go to post

    Leave a comment:


  • I'd say you need to use sockets. If you are working in Windows, as it appears, you should investigate about the <winsock.h> and <winsock2.h> libraries.
    See more | Go to post

    Leave a comment:


  • dariophoenix
    replied to diff between cout and puts
    in C
    1 - puts is an ANSI C function defined in the <stdio.h> header
    2 - cout is not a function: it's a stream, associated to a file. When you do something like:
    cout << "Hello" << endl;
    You are using operator << (operator 'send to', which is a function, but written in C++, so unlike puts, it's Object-Oriented) : you are sending the string "Hello" to the stream cout, which...
    See more | Go to post

    Leave a comment:


  • dariophoenix
    started a topic XML parser
    in C

    XML parser

    Hi,
    I'm working with Visual Studio C++ in Windows XP and I need to parse XML documents (following a given DTD). Which parser do you recommend?
    See more | Go to post

  • dariophoenix
    replied to Destroying files in C
    in C
    It worked!! Thanks a lot!!
    See more | Go to post

    Leave a comment:


  • dariophoenix
    replied to binary tree
    in C
    If you mean you have to implement the binary tree data structure using pointers between links/nodes, as in the linked list implementations , check this out:

    http://www.cee.hw.ac.u k/~rjp/Coursewww/Cwww/tree.html
    See more | Go to post

    Leave a comment:


  • dariophoenix
    replied to graphs and trees
    in C
    I googled 'Trees in C' and found this:

    http://www.cee.hw.ac.u k/~rjp/Coursewww/Cwww/tree.html

    As for graphs, here's a headstart:

    http://www2.toki.or.id/book/AlgDesignManual/BOOK/BOOK3/NODE132.HTM
    See more | Go to post

    Leave a comment:


  • dariophoenix
    started a topic Destroying files in C
    in C

    Destroying files in C

    Hi,
    I am working in Windows XP and I need to destroy a file in a C program (not just erase its contents). The file was opened this way:

    Code:
    FILE* pBinFile = fopen(nameBinFile,"w+b");
    After that, I write data into the file. Finally, I try to destroy it with these instructions:

    Code:
    remove(nameBinFile);
    fclose(pBinFile);
    But the only...
    See more | Go to post

  • dariophoenix
    replied to Linux Sockets and POSIX threads example
    in C
    Well, I figured it out myself: Even if you close a socket correctly, it takes a maximum of 60 seconds for it to be freed: I ran the first time OK; then I waited a minute, ran again and had no problems. So that's it, I hope this helps someone.
    See more | Go to post

    Leave a comment:


  • Just access the structs' strings and compare those:
    if (list[index].name > list[index+1].name) ...
    See more | Go to post
    Last edited by dariophoenix; Oct 31 '06, 01:53 AM. Reason: More clear

    Leave a comment:


  • dariophoenix
    replied to Linux Sockets and POSIX threads example
    in C
    I discovered that changing the port number and recompiling allows for another succesful run (only once, like before). Therefore, it seems to me that ports are not freed after the program finishes. How can I do that?
    See more | Go to post

    Leave a comment:


  • dariophoenix
    started a topic Linux Sockets and POSIX threads example
    in C

    Linux Sockets and POSIX threads example

    Hi,
    I am trying to encapsulate Linux sockets and POSIX threads in C++ classes (I work in Knoppix, using KDevelop). Since sockets and threads are new to me, I searched for example code and found the following:

    Code:
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <errno.h>
    #include <netdb.h>
    #include <signal.h>
    #include
    ...
    See more | Go to post

  • dariophoenix
    started a topic font rendering from scratch
    in C

    font rendering from scratch

    we need to do a font rendering from stcratch (without using any non-standard library) in c++. Do you know about any site with information on algorithms and techniques necessary?
    See more | Go to post

  • dariophoenix
    replied to linked list
    in C
    Here's a headstart:

    Code:
    //linkedlist.h
    #ifndef LINKED_LIST_H
    #define LINKED_LIST_H
    
    template <class Element>
    class LinkedList{
       struct Link{
           Element* data;
           Link* next;
           Link(Element* dat, Link* nxt): data(dat), next(nxt) {}
       }  *head, *cur;   
    public:
       LinkedList() : head(0), cur(0) {}
       ~LinkedList();
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...