User Profile

Collapse

Profile Sidebar

Collapse
creativeinspiration
creativeinspiration
Last Activity: Dec 21 '07, 06:42 AM
Joined: Jun 26 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Java actionPerformed and global variables

    Hi everybody,
    I have a question. In java I have a class which has global variables. Also, in this class I have an actionPerformed method implemented, which is called every time some event happens. Now, in actionPerformed , I set these variables. Although inside actionPerformed their values do appear to change, after it is finished, the values go back to their old ones. Why is this happening? How do I get the values to stay? Please help..
    See more | Go to post

  • creativeinspiration
    started a topic System call error
    in C

    System call error

    Hey guys. I am trying to implement a system call in linux kernel. I usually use ubutntu, but this I am doing on Fedora. I am using kernel 2.6. Here is what I did:

    1. Added a line to arch/i386/kernel/syscall_table.S :

    .long sys_foo

    2. Added a line to linux/include/asm-i386/unistd.h:

    #define __NR_foo 324

    also incremented the call count by 1.

    3. Added this code...
    See more | Go to post

  • I mean unix style file integer descriptors ( i am writing this in linux).
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    started a topic Checking if a file descriptor is valid
    in C

    Checking if a file descriptor is valid

    Does anybody know how to check if the file descriptor is valid?
    See more | Go to post

  • creativeinspiration
    replied to Templates Error
    in C
    When I move the function to the same file it compiles fine. Is there a way I can keep this function in a .h file?
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    started a topic Templates Error
    in C

    Templates Error

    Hey guys,
    Here is what I am doing:

    Code:
    Code:
    template <typename T>
    void func(vector<T> vec)
    {
     ..
     ..
     ..
    }
    Now when I call this function as func<somestruct >(st); I get a compile time error? I am I calling the function wrongly?
    See more | Go to post

  • creativeinspiration
    started a topic STL vector core dump
    in C

    STL vector core dump

    Hey everybody. I have an issue where pushing a new item onto an STL vector, I get a core dump. Now, the capacity of the vector is not exceeded (its only 3). The vector contains integers. Now, in my application, I push stuff to the vector and works fine until that one point. Basically, I do this:

    Code:
    vector<int> vec;
    vec.push_back(newInt);
    and get a core dump. Now, the function which involves...
    See more | Go to post

  • creativeinspiration
    started a topic C++ Debug Messages
    in C

    C++ Debug Messages

    Hi everybody. I was wondering if there is a way in C++ to have debug messages, and the ability to turn them off. For example, lets say I would like my program to have two modes. One mode is the mode where all the debug messages are printed, and another where they are not. Is it possible to do through the compiler? Ie to choose whether to compile the program with the debug info? I looked some stuff on google, and found some strange way in Visual...
    See more | Go to post

  • creativeinspiration
    started a topic STL vectors and delete
    in C

    STL vectors and delete

    Hey everybody. I understand that erasing elements in the vector invalidates the iterators. If you consider the following code:

    Code:
    #include <iostream>
    #include <vector>
    using namespace std;
    
    int main()
    {
      vector<int> vec, vec2;
      
      vec.push_back(1);
      vec.push_back(2);
      vec.push_back(3);
      vec.push_back(4);
      vector<int>::iterator
    ...
    See more | Go to post

  • creativeinspiration
    replied to Strange problems with string class
    in C
    string buffer is how i declared it.
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    started a topic Strange problems with string class
    in C

    Strange problems with string class

    Hey Guys. This is a weird one. Basically what I am doing is reading a string from the file using getline(file, buffer) where buffer is a C++ string. For example: lets say the file contains the string "hello" without the quotes on one line. After I read the file and print out the buffer it says "hello" (cout << buffer) like it should..BUT when I do this:

    buffer == "hello" , the answer is false....
    See more | Go to post

  • creativeinspiration
    started a topic STL set of Classes
    in C

    STL set of Classes

    Hey Everybody. Does anybody know which operators need to be implemented in order to make the stl set of those objects works? For example I have a class myclass, and I want to have set<myclass> myclass_set where I can insert objects into the myclass_set. Any idea is cool.
    See more | Go to post

  • I actually meant in linux..
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    started a topic Memory Usage From C++ Program in Linux
    in C

    Memory Usage From C++ Program in Linux

    Hey guys,
    Do any of you happen to know of a way to monitor the memory usage of your program from within your program? Any help would be great.
    See more | Go to post

  • creativeinspiration
    started a topic Class templates strange problems
    in C

    Class templates strange problems

    Hey Everybody. I have a question. I have a code like this in my .cpp file of the class:

    template <typename T>
    int myClass<T>::get Number()
    {
    return 1;
    }

    In my .h file I have everything set up correctly for the template class. However, when I compile it I get this error:

    myClass.cpp: error: no âint myClass<T>::get Number()â member function declared in class...
    See more | Go to post

  • creativeinspiration
    started a topic Linux Kernel Programming Book

    Linux Kernel Programming Book

    Hey Everybody,
    Could anybody suggest a good linux kernel programming book? The best kind would be like one those where you can learn a lot fast (like those 24 hour series books). Please let me know if you know any good ones.

    Thanks
    See more | Go to post

  • creativeinspiration
    replied to Weird thing with push_back again..
    in C
    i fugued it out thank you.
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    replied to Weird thing with push_back again..
    in C
    It looks something like this:

    ostream& operator << (ostream& ostr, user_state& var){
    if(var.getthatf lag()){
    ostr << "1";
    } else {
    ostr << "0";
    }
    return ostr;
    }
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    replied to Weird thing with push_back again..
    in C
    I overloaded the << operator
    See more | Go to post

    Leave a comment:


  • creativeinspiration
    started a topic Weird thing with push_back again..
    in C

    Weird thing with push_back again..

    Hey everybody,
    I have a situation where I have class, one of the elements of the class is a boolean. I also have a vector of that class type. Here is what i do:

    vector<myclass> myv;

    myclass m1 (initialize the class with the variable set to true)
    myclass m2 (initialize the class)

    myv.push_back(m 1);
    cout << myv[0] << endl;

    this prints correctly, and...
    See more | Go to post
No activity results to display
Show More
Working...