I'm porting code from Win32 to Linux, a math science app, the thing is that the app have full dependency of de win32 function _fpclass(). Today I was looking all day that function on Linux but it doesn't exist. I know that there are some functions that can make the job mixing them in a other one like in this link below, more or less. [URL]
Well the app use very high virtual memory, Gigas of it(around 500), use Linux as Calculation Server using a very large swap space. If we can't find some way to fix this trouble, we can change the Linux for some open *nix like Open Solaris, because those have fp_class_l().
I have an old C application in which i am trying to include some STL cointainers. When i use the STL container alone it works fine, but when i include it into a C struct i have segmentation faults errors. I know that it is not a good idea to mix C and C++. Considering this code:
Code:
typedef struct{ int shmid; ... APPLSPACETYPE applSpace;
[code]...
and how to make a malloc for this issue; something like :
I have been spending time (starting yesterday) reverse-engineering GTK+ to get my programming skills up. I came across a struct in the headers (_GtkArg, which was then typedeffed into GtkArg) that includes a union in it that has pretty much the same properties as a struct. Then, there was a struct inside the union.
I'm confused. Just what is the difference between a union and a struct?
P.S. I am using GTK's native C programming language.
How do we allocate memory of struct? what i did was
Code:
int main() struct amp {
[code].....
cout <<"The size of 'struct' is"<< sizeof(struct amp)<<"and it is located at"<<struct amp*s = malloc(sizeof(struct amp))<<endl; it gives me an error--- In funtion 'int main()': error: expected primary-expression before 'struct' error: expected ';' before 'struct'
For a work project, I've got a bunch of python code from about a year ago that controls the movement of our EVI-D30 camera over a ttyUSB connection. It used to work fine on a 32-bit Fedora box, but recently we moved our whole project over to a 64-bit Gentoo server, and the same code seems to be worthless on the new platform. I didn't write the code, so I'm have trouble figuring out how to fix it. Error messages usually look like this:
Code:
File "./CameraController.py", line 172, in pan turn_callback(cmdStruct[0], cmdStruct[1]) File "./CameraController.py", line 147, in turn_callback cameras[camera].TiltUp()
I have what should be a relatively simple program (fadec.c) that maps a struct from an included header file (fadec.h) to a shared memory region, but Im struggling accessing members in the struct from the pointer returned by shmat. Ultimately, I want to access members in the shared memory structure with a globally declared version of the struct, shm__. Not only do I not know how to accomplish that, but I cant even seem to access members of the shared struct directly from the pointer itself (compiler complains about dereferencing pointer to incomplete type). Im at a loss and could use another set of eyes if you guys dont mind taking a gander:
Compile Errors: tony-pc:/cygdrive/p/test> cc -o fadec fadec.c fadec.c: In function 'main': fadec.c:30: error: dereferencing pointer to incomplete type fadec.c:31: error: dereferencing pointer to incomplete type
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
I want to read a pressed key or a combination of pressed keys from the keyboard and perform some action afterwords.
e.g.
Ctrl-Alt-F1
Out of ncurses lib. and the termios struct which can be used best for the above purpose and why ?I tried to search on Google, the differences between these two but couldn't get much !
I understand that block_device pointer *bd sholuld get initialized. Program should produce initialization error for *bd. Compiler is producing '->'. I am not understanding why?
This for Kernel 2.6.29.6. I'm trying to code a kernel module that displays process information.
how to count opened file descriptors per task. I have been able to write a module that lists all the current process names along with their pid number in /var/log/messages. Basically, I cycle through the ring of processes using the macro for_each_process(task) and printk the comm and pid of each task. I'm trying to see how many file descriptors each task has open. I've been reading up in books and all over the internet. At first I thought I needed to access max_fds under files_struct, but that just lists the maximum number of file descriptors that can be opened per task, which by default is set at 256. I then thought about counting the elements in the fd_array. But then I learned that every task's fd_array is initially set at 32. Now I know that I need to access open_fds of type fd_set * in files_struct. open_fds is a pointer to all the open file descriptors. The problem is that I don't know how to access a pointer of type fd_set.
Is there a good guide or book that really focuses on type fd_set and open_fds? Every book and resource I've read never really go into depth on this. relationship between files struct, open_fds, and the open file descriptors in task?
Since upgrading to Lucid (I think), I can't boot into Windows. When I select the Windows Vista entry in GRUB, the screen goes blank for a moment before returning me to the GRUB menu.I have tried pressing 'e' to edit the GRUB entry before booting, and what I find is that it says the root is hd0,1Since my Windows partition is sda1 in GPartEd, should that translate to, for example hd0,0 ?The only reason I want to boot into Windows in the first place is to install a BIOS upgrade from HP, which only works with their Windows software. If someone can suggest an alternative way of doing this then I won't need to boot into Windows at all.
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash addelementtoarray() { local arrayname=$1
Why are basic math problems returning 0? I know that Integers can only hold whole numbers, and it had the exact same problem when I used floats. I am using GCC 4.4.4.
I have the following function, and it appears to set the var correctly, but then tries and executes the line as a command. Anyone know how to keep it from doing that?
I am facing issue in my OPENSSL code. I have written openssl client. It sends request to the host and receives response for that request.
My problem is, it connects, sends request successfully to host at first time only in sencond attempt it fails on SSL_write(). where SSL_get_error() returns SSL_ERROR_SYSCALL error.
In that ERR_get_error() returns 0. man page shows "If ret == 0, an EOF was observed that violates the protocol".
Code Snippet. w=SSL_write(SSLRequestData.ssl,c2s,c2sl); switch(SSL_get_error(SSLRequestData.ssl,w)) { case SSL_ERROR_NONE: if(c2sl!=w)
I'm studying the C Language, None of the documents I'm reading covers returning values from a function. They state that the function sends the valve to the caller but that is the only info I have. Do I have to create a varible with the name of the function I called and is it stored there?
I am working on software that is to run on a variety of linux machines where changing the os/version is not an option.My software uses the inotify_rm_watch call, and this is occassionally failing. In every case the operands are both valid, yet the result is EINVAL. This appears to only occurr when a watched file is deleted, and the read command on the inotify yeilds two events IN_DELETE_SELF AND IN_IGNORE (at the same time).I have seen a few messages detailing this same scenario - but no workarounds.
If I have a Query that returns columns where some of the values are NULL, is it possible to tell SQL to return all the NULL values as empty strings instead of the NULL datatype?
If the solution is vendor specific I am (unfortunately) using a Microsoft 2008 SQL server.
Example:
Code: Select * from imaginary_table where id = 1 Might return: Code: Id: 1 Name:xyz
fit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:
Code: I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.
well i thought about trying out the new webgl feature , however i didn't get off to a good start as , all apps that i've seen on the web aren't running ?
complaining about incompatibility , what the heck ?
isn't FF 5.0 supposed to be this new Uber release with the most advanced technologies enabled?