Search Results

Search found 12 results on 1 pages for 'nomemory'.

Page 1/1 | 1 

  • Junit HTML report

    - by nomemory
    Is there a way to (easily) generate a HTML report that contains the tests results ? I am currently using JUnit in addition to Selenium for testing web apps UI. PS: Given the project structure I am not supposed to use ANT :(

    Read the article

  • Should i enforce realloc check if the new block size is smaller than the initial ?

    - by nomemory
    Can realloc fail in this case ? int *a = NULL; a = calloc(100, sizeof(*a)); printf("1.ptr: %d \n", a); a = realloc(a, 50 * sizeof(*a)); printf("2.ptr: %d \n", a); if(a == NULL){ printf("Is it possible?"); } return (0); } The output in my case is: 1.ptr: 4072560 2.ptr: 4072560 So 'a' points to the same adress. So should i enforce realloc check ? Later edit: Using MinGW compiler under Windows XP. Is the behaviour similar with gcc on Linux ? Later edit 2: Is it OK to check this way ? int *a = NULL, *b = NULL; a = calloc(100, sizeof(*a)); b = realloc(a, 50 * sizeof(*a)); if(b == NULL){ return a; } a = b; return a;

    Read the article

  • How do I write my own desktop sharing application in java ?

    - by nomemory
    Hello I want write my own desktop sharing application in Java. The application should have some very default features: Capture screen; Allow a remote connected user to click / edit fields. I was thinking to use Java Robot class for mouse movements / key pressing. The problem is i don't know what screen capture strategy to use. Should I make sequentially screen captures (on the hosting computer) every second, and send those captures with UDP via network, so that the clients can intercept the data-grams ? Isn't this a little overkill for the network ? What other strategies are available ? (Except trying an already existing app). PS: If necessary I can even write native code using JNI (still that's the last thing I planning to do).

    Read the article

  • How to create a generic C free function .

    - by nomemory
    I have some C structures related to a 'list' data structure. They look like this. struct nmlist_element_s { void *data; struct nmlist_element_s *next; }; typedef struct nmlist_element_s nmlist_element; struct nmlist_s { void (*destructor)(void *data); int (*cmp)(const void *e1, const void *e2); unsigned int size; nmlist_element *head; nmlist_element *tail; }; typedef struct nmlist_s nmlist; This way I can have different data types being hold in "nmlist_element-data" . The "constructor" (in terms of OOP) has the following signature: nmlist *nmlist_alloc(void (*destructor)(void *data)); Where "destructor" is specific function that de-allocated "data" (being hold by the nmlist_element). If I want to have a list containing integers as data, my "destructor" would like this: void int_destructor(void *data) { free((int*)data); } Still i find it rather "unfriendly" for me to write a destructor functions for every simple primitive data type. So is there a trick to write something like this ? (for primitives): void "x"_destructor(void *data, "x") { free(("x" *)data); } PS: I am not a macro fan myself, and in my short experience regarding C, i don't use them, unless necessary.

    Read the article

  • Is there any workaround for making a structure member somehow 'private' in C ?

    - by nomemory
    I am developing a simple library in C, for my own + some friends personal use. I am currently having a C structure with some members that should be somehow hidden from the rest of the application, as their use is only internal. Modifying by accident one of this members will probably make the library 'go wild'. Is there any 'workaround' to hide those members so that they can't be accessible ?

    Read the article

  • How to implement a set ?

    - by nomemory
    I want to implement a Set in C. Is it OK to use a linked list, when creating the SET, or should I use another approach ? How do you usually implement your own set (if needed). NOTE: If I use the Linked List approach, I will probably have the following complexities for my operations: init : O(1); destroy: O(n); insert: O(n); remove: O(n); union: O(n*m); intersection: O(n*m); difference: O(n*m); ismember: O(n); issubset: O(n*m); setisequal: O(n*m); O(n*m) seems may be a little to big especially for huge data... Is there a way to implement my Set more efficient ?

    Read the article

  • Writting a getter for a pointer to a function .

    - by nomemory
    I have the following problem: "list.c" struct nmlist_element_s { void *data; struct nmlist_element_s *next; }; struct nmlist_s { nmlist_element *head; nmlist_element *tail; unsigned int size; void (*destructor)(void *data); int (*match)(const void *e1, const void *e2); }; /*** Other code ***/ What will be the signature for a function that returns 'destructor' ?

    Read the article

1