User Profile
Collapse
-
Alright, thanks! -
Thanks for the replies.
Yes DoBock, I am trying to use the signed-magnitude method.
Currently when I run my program it is not encoded in that method. I am wondering if it is possible to specify the encoding method.
Currently I am using a work around by using an unsigned 16bit and limiting the domain to 0-32767 and then manually setting the first bit using bitwise operations.
How ever this could...Leave a comment:
-
Sign-Magnitude Method of a signed 16bit int
I am running in Linux x86 and I am wondering if there is a way to specify to use the Sign-Magnitude Method for representing a signed 16bit int.
When i use int16_t as a data type it does not use that method but I need it to. -
Should I be setting up a swap partition while booting off a CF card?
I am running Debian on a PC Engine Alix board booting off of a 4gb CF card.
Should I be setting up a swap partition while booting off a CF card.
Im asking because ive heard this is bad for cf cards because it increase read/writes to the cf card by quite a bit.
What is peoples thoughts about this? -
Thanks for the reply ashitpro, but I don't you understand the problem I am having.
My machine can send packets to the target machine on the 10.13.0 network without a problem and the target machine can send packets/ping to my machine if it uses my 10.13.0 address. But if it uses my 10.0.0. address my network will not allow it to go.
My problem is probably due to how my network is setup but I do not have much control over...Leave a comment:
-
BSD Sockets - Selecting Source Address
Hello Bytes,
I am using UDP BSD sockets in my program, all is working just fine until my computer has two nics or 1 nic and one virtual nic. I am running Linux x86 Debian Squeeze.
I have one nic pointed at my 10.0.0. network and another one at 10.13.0. network
My outbound packets are making it to the destination on my 10.13.0 network.
The problem is that the computer on the 10.13.0 network... -
Thanks for the reply that will do it.
However is it possible to have Class B be more vague when setting up the triggers.
What I mean by that is if I want say Class C to set Class B's trigger then I would need two Class B set trigger methods and their respected variables. One with
int (A::*TriggerCal lbackA)(int level);
void setTriggerA(int (A::*TriggerCal lbackA)(int level));
and another with...Leave a comment:
-
Function Pointers to Function Members
Hello Bytes,
I am trying to use function pointers in program with two classes.
Here's my setup:
In Class A I have a public method defined as [int doSomthing(int a) ].
In Class B I need a method to set a callback for a method [ int callback(int)]
This all works well if the callback function i give is not a member of class A or any other class.
A.cpp:187: error:... -
This is what ive come up with.
After I do my port setting i use ioctl():
Code://status &= ~TIOCM_DTR; //status &= ~TIOCM_CTS; status |= TIOCM_DTR; status |= TIOCM_CTS; ioctl(fd, TIOCMSET, &status);
Neither low or high bit status for TIOCM_DTR seems to work though?
Is this the right wa...Leave a comment:
-
Linux Serial port setting for turning DTR off
Hello Bytes,
I am writing a program in Linux Debian x86 to control a module.
My only problem is that the module needs to have the DTR setting and all flow control off. I have been unable to figure out how to do this.
This is how ive configured my port settings thus far:
Any ideas??
...Code:fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY); -
No, i am not trying to get the cpu usage of any process but the entire system.
I am getting gibberish when ran from process not still active in stdin. But I cant figure out why.Leave a comment:
-
Outputing top to a file from a forked process
Hello Bytes,
CPU Info: Debian Lenny x86
I am trying to use the output of top to return cpu usage.
- Im am actually trying to find a simple solution to gather cpu and mem usage, I have found top is the simplest to me.
My code works great when I run it from main, however as soon as my process forks to the background when the below code runs it does not work anymore.
Any clues why it... -
Well i figured it out.
I had to create a second address structure like:
Then set ipa equal to ifAddrStruct before using ipa in the while loop.Code:struct ifaddrs * ipa = NULL;
This allows the code to keep a copy of linked list head ifAddrStruct for freeing.
Final Code looks like:
...Code:struct ifaddrs * ifAddrStruct, *ipa = NULL;Leave a comment:
-
getifaddrs - Memory leak
Hello Bytes,
I am using getifaddrs from ifadddrs.h on Debian Linux (Lenny).
Im using valgrind to check for memory leaks in my program. It seems that I have a memory leak in the code below but I cant figure out how to fix it. I thought i was freeing the address structure right but no luck.
If I do not run the loop and call "ifAddrStru ct = ifAddrStruct->ifa_next;" I don't get a memory leak... -
shmget: Permission Denied
Hello Bytes,
Computer Type: Debian Lenny Linux x86
I am trying to use shmget to create a block of shared memory. I managed to get that working fine, I run the program always in root.
My problem though is when I want a user that is non-root to access the block I keep getting Permission Denied error.
I set the S_IWOTH so that other users can access the block it doesn't seem to be working.... -
What I meant was, does the local device compare its local database increment number to the other remote dbs. If it has a lower value it assumes it needs to update its database....Leave a comment:
-
Yes that is close to what im looking for. Thanks
If a device somehow misses the update message, the next time they want to read the db, they will notice that change number has increased, so they have to update themselves before they make any changes.
One question though, if a device misses an update message how do they know that the number has increased when making a change?Leave a comment:
-
Keeping files synced between multiple computers
Hello Bytes,
For reference I'm running Linux Debian x86 but the problem is not related to an architecture.
I have a networked system with multiple computers (say 20-50). On each computer there is a directory that needs to be consistent with all other nodes in the system. Each computer has the privileges to make changes to the directory and those changes need to be reflected across the entire system over some amount... -
Nevermind, my dumb mistake.
It was throwing a connection reset by peer error but I missing it and the next time I called send() it crashed which is ok.Leave a comment:
-
I managed to figure it out, here is my solution.
...Code:#include <ifaddrs.h> struct ifaddrs * ifAddrStruct = NULL; void * tmpAddrPtr = NULL; char s[INET6_ADDRSTRLEN]; getifaddrs(&ifAddrStruct); localAddress.clear(); while (ifAddrStruct != NULL) { if (ifAddrStruct->ifa_addr->sa_family == AF_INETLeave a comment:
No activity results to display
Show More
Leave a comment: