Looking for a good hash table implementation in C
I am primarily interested in string keys. Can someone point me towards a library? -A ...
I am primarily interested in string keys. Can someone point me towards a library? -A ...
I'm confused by these two warnings. Can anyone explain how I might have come about triggering them, and how they would be able to be debugged in gdb? (gtkworkbook:24668): GLib-GObject-CRITICAL **: g_cclosure_new: assertion `callback_func != NULL' failed (gtkworkbook:24668): GLib-GObject-CRITICAL **: g_signal_connect_closure_by_id: ass...
I'm trying to optimize the following. The code bellow does this : If a = 0.775 and I need precision 2 dp then a => 0.78 Basically, if the last digit is 5, it rounds upwards the next digit, otherwise it doesn't. My problem was that 0.45 doesnt round to 0.5 with 1 decimalpoint, as the value is saved as 0.44999999343.... and setprecisi...
I've been playing around with GEdit's syntax highlighting. I love the way that Visual Studio highlight's user created types. I would like to do this for my user created types in C/C++ (eg. typedef's/classes). For example (in C): typedef struct Node *pNode; And an example in C++: class BigNumber { // Class stuff here. }; See t...
I need to send an HTTP request to a server using HTTPS on Linux using plain sockets. Is there a way to do this? Code is appreciated. Thanks ...
We're writing code inside the Linux kernel so, try as I might, I wasn't able to get PC-Lint/Flexelint working on Linux kernel code. Just too many built-in symbols etc. But that's a side issue. We have any number of compilers, starting with gcc, but others also. Their warnings options have been getting stronger over time, to where they ...
Hi there, I'm writing a kernel (2.6.28) module that uses a dynamic timer. I'm using the timer_list structure as follows: struct timer_list our_timer; init_timer(&our_timer); our_timer.function = handleFlowTimer; our_timer.expires = jiffies + 2000; our_timer.data = 0; add_timer(&our_timer); void handleFlowTimer(unsigned long data) { ...
I hope I'm wording my question properly, but what I'm trying to do is actually rather trivial. I have a bunch of code with static object instantiation that looks like this: Foo *aFoo1 = [[[Foo alloc] init] autorelease]; [anArray addObject:aFoo1]; Foo *aFoo2 = [[[Foo alloc] init] autorelease]; [anArray addObject:aFoo2]; I simply want...
So I am basically doing the following and I want SomeText to have red forground color. How to achieve this: GtkWidget *menu_item =gtk_menu_item_new_with_labelex("SomeText"); I am using GDK 2.0 Thanks ...
Hii!, i'm programming in C/GTK+, but i don't understood yet why, when I call a function, like gtk_label_set_text (GTK_LABEL (label), "some text"); for example, i don't need to pass the reference of label pointer to the function. I learned that C pass all arguments as value, than, the function will don't affect the Widget label, in other...
The ISAPI Filter documentation says I can call SF_REQ_SEND_RESPONSE_HEADER to send the response header, and also append additional headers. ISAPI also has AddResponseHeaders to allow a filter to add additional headers to be sent in the response to the client. Is there a way, in ISAPI, to remove headers that would otherwise be sent t...
I'm refactoring some code in C++, and I want to deprecate some old methods. My current method for finding all of the methods looks like this: Comment out the original method in the source file in which I'm working. Try to compile the code. If a compiler error is found, then make a note comment out the call and try to recompile. Once th...
I am attempting to write a C# component which will expose events. The component is to be imported by an unmanaged C++ application. According to a few tutorials I have come up with this code (for the C# side): namespace COMTest { [ComVisible(true), Guid("02271CDF-BDB9-4cfe-B65B-2FA58FF1F64B"), InterfaceType(ComInterfaceType.InterfaceIsID...
Hi there, I'm trying to work out whether to learn DirectX or to continue on with OpenGL... I dev mainly games, and I know enough of OGL to get by, nothing more. I know that DirectX and D3D are popular amongst professional games developers, is there any reason behind this? Which API is easier to learn and use? Is there any difference i...
Is it possible to have pointers to data variables? I know I can have, say, pointers to strings e.g. char *str[n] and I can perform a 'for' loop over those pointers to retrieve the strings ... str[i] where i is the index counter. If I have some data e.g. char var1; int var2; char var3; and I wanted to get data from stdin I might use ...
I am writing a program that uses shared memory and semaphores for ipc. There is one main server process that creates the shared memory and semaphores. Any number of client processes can attach to the shared memory and read and write to it when allowed. The semaphores provide the blocking mechanism to control reads and writes. Everything ...
Hi all, I have been using gcc,g++ for my C,C++ application development till now and have found it to be amazing. But browsing through stackoverflow I found many members stating that error reporting in Comeau compiler is much more than any other compiler. Is this true? I haven't invested in any commercial release of a compiler. Is it rea...
I'm trying to take a 16 bit unsigned integer from a structure, mask the first 8 bits of it, and use it as an index to an array with the function analogWrite which takes the output pin on the Arduino and the output byte as arguments. The code in question looks something like this: analogWrite(outputPin, my_array[myStructure->data & 0xFF0...
ok, im building a search engine. and the search module able to extract the relevant words. and now i have a list of words and their offset in original source text.is it a bad idea to use levenshtein distance to compute difference between the query string and the portion of source text ( begin at given word's offset and up to query string...
I'm using CreateProcess() with startup flags set to STARTF_USESHOWWINDOW and SW_HIDE to start an application in the background with its window hidden. I'm doing this to run a scheduled maintenance tasks and i don't want to be bothered with windows. In most cases the windows are hidden but there are cases where the program's window pops ...