Programming :: Implement Two Periodical Processes In C++?

Jul 28, 2010

I am doing real time programming in C++, under Linux. I have two processes, let me say A and B. A process is being started periodically, every 5ms. B process is being started every 10ms. The process A is doing data processing. The process B is reading that data and displays it. I am confused about how to run periodically processes. The problem is that the period of process A should be as much as it is possible accurate (5ms). For the process B it isn't so important. I have created independent processes, each in one .cpp file, and I am starting them from bash file. Is that OK? I don't have to make child processes in order to have parallel processes?

View 1 Replies


ADVERTISEMENT

Programming :: Automate Periodical Activities In A Website (client Side)?

Jan 12, 2011

automate daily routines in a website. The things what I should do is to:

- log in
- click on HTML objects (I think I have to trigger the JavaScript onclick event)

Code:

<a href="http://www.xtremetop100.com/in.php?site=11111111" target="_blank" class="account_links">
<img src="/resource/bla/bla/vote/xtop100.gif" border="0"/>
</a>

(This is an image what I have to click on, after it I will receive a reward, then I have to wait 12 hours to benefit from it again.) My first idea was that to code it in C++, and I have searched the internet for the appropriate C++ headers, but I did not find any. So as you can see its not a concrete programming question, my main question is that, in what way could I do the above mentioned things.

View 4 Replies View Related

Programming :: Use Socket Programming In Order To Implement Chatting Feature?

Aug 25, 2010

how to use socket programming in order to implement chatting feature

View 5 Replies View Related

Programming :: Implement The OOP In Interpreter?

Mar 7, 2011

I have a partially completed interpreter that has first-calss functions and can store scopes in variables. That way it is possible to implement a simple class like this:

Code:

MyClass = func () {
value = 0;
setValue = func (x) value = x;;

[code]....

But what about inheritance, and what if I want to know the type of the object?

View 6 Replies View Related

Programming :: How To Implement Whole New Writing System

Aug 11, 2010

So basically, there is a really cool writing system I have been working on. It could be viewed (for simplification purposes) like an encryption method for the Latin script.

Facts about the writing system:
It has a little over 300 symbols.
It is syllable-driven.
It is highly compositional (eg. "c", "ca", "cae", "ca " and "ci." all map to different symbols - and NOT by overlaying elements)
Symbols have medium graphical complexity (comparable to Korean Hangul, or Japanese Hiragana)
Has a rather complex set of diacritics (~10, some of which can go on any symbol)
Has no ligatures

How transliteration occurs:
Sequences of Latin symbols map to certain symbols. Example below:[G][rou][p ][hu][g.]Characters sequences between "[" and "]" map to a single symbol (so it would take only 5 symbols to write "Group hug.").

How I want it to work:
I would like to have a daemon that: Intercepts all text displayed on the screen.
Converts it to my writing system (changes letter sequences with individual Unicode codes)
Leaves unsupported symbols unchanged.
Displays all the text on the screen using my font and characters intertwined with the fonts and characters left unchanged.

For example, if you take the following line of C++ code:for (i = 1; i <= n; i++)
I would like it displayed like this:[fo][r ]([i ]= [1]; [i ]<= [n]; [i]++)
Bold-symbols should be in my Unicode font with special symbols defined for this writing system, and the rest should be in its original font and encoding. Also, I would like this encoding to hold for display-purposes only. The data in the memory should remain unaffected. This also means real-time adjustments: if I open a text editor (say, from the OpenOffice Suite) and I start typing, I would like to see what I type encoded with my writing system, even though the document actually contains Latin letters. This also means that the symbol immediately before the cursor may change as you type.

View 3 Replies View Related

Programming :: How To Implement Count Word

Nov 9, 2010

I have these but not working.

size_t count_words(const std::string& s)
{
std::istringstream is(s);
return distance( std::istream_iterator<std::string>(is),
std::istream_iterator<std::string>());
}
and
std::string s; // word count
unsigned int wordno = 0;
while(getline(myfile, s))
{ ++wordno;
if(s.empty())++ wordno;
else wordno += count_words(s);
std::cout << s << '
';
}

myoutput1<< "Number of words : " << wordno << '
';
myoutput1 << "
Word" <<" " <<" Occurrence" <<endl;
myoutput2<< "Number of words : " << wordno << '
';
myoutput2 << "
Word" <<" " <<" Occurrence" <<endl;

View 6 Replies View Related

Programming :: Implement Own Protocol With AgenjJ?

Feb 9, 2011

I developed a protocol "it's a modification of OLSR" for wireless networks, it was with JAVA and I try to simulate it on NS2, I used AgentJ, so in the TCL I did any thing like usual;

set val(chan) Channel/WirelessChannel ;# channel type
set val(prop)Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type

[code]....

and I didn't specified the protocol because I attached my nodes to the JAVA class responsible for the protocol, but when I run it generates errors, it claims the protocol to use, so I don't know how proceeding.

View 2 Replies View Related

Programming :: Implement Persistent SSL Connection ?

May 14, 2011

I implemented a SSL client using openssl on Linux and it's working fine i am getting response from server...

But my problem is I have a separate thread for each request comes form front end and i have to do SSL communication in each thread, for this i have to create a separate SSL Context for each thread and this is taking too much time hence my transaction is getting delayed

My question is can we implement Persistent SSL connection where i will do SSL Handshake only at the time of application startup and use that connection in all the threads....

View 2 Replies View Related

Programming :: Implement A Set Class (like In Stl) Using A Vector?

Sep 3, 2010

i need to implement a Set class(like in stl) using a vector.Here is my code that doesnt work corectly:

Code:
#include <iostream>
#include <vector>
template<class T>
class Set
{

[Code]....

View 2 Replies View Related

Programming :: Implement C_str() For A String Class?

Oct 19, 2010

How can I implement c_str() for a string class?

View 2 Replies View Related

Programming :: Implement Variable Substitution In Strings?

May 6, 2011

I have an interpteter that supports string literals, and the way it works is that the lexer returns the entire string as a single token, with the quotes removed and escape sequences replaced with the literal characters they represent.

I already implemented single-quote strings, they don't interpret any characters specially except for the single quote. I partially implemented double-quoted strings, they already support all the same backslash escape sequences that C does. But I would also want to add variable substitution.

The way it would work is that "${expression}" would interpret the expression (which could just be a variable name) and replace itself with the result. But I have no idea how to do this.

In case it matters, I'm using a hand-written lexer and recursive-descent parser.

View 14 Replies View Related

Programming :: Implement SAML 1.1 SSO Process In Php / Java Or C#?

Oct 11, 2010

I need to implement SAML 1.1 SSO process in Php(Preferred), Java, or C# I am having a very difficult time finding information related to this task. If I could use SAML 2.0 I would be home free with "Simple Saml Php" but I am not that lucky. Would the process be as simple as building the SAML in XML then submitting it with a SoapClient? According to the Docs I've read that would appear to work.

View 1 Replies View Related

Programming :: Implement Inheritance An Polymorphism In Plain C?

Mar 20, 2009

how to implement inheritance an polymorphism in plain C. Most of them do this through function pointers.However I'd like to support multiple inheritance.

View 14 Replies View Related

Programming :: Implement A Dynamic Menu Which Will Allow To Specify An IP Address

Jul 2, 2010

I'd like to implement a dynamic menu which will allow me to specify an IP address and read it into memory. This is what I've got so far (it's fairly basic...)

Code:
IPS=`ifconfig -a | grep 'inet addr:' | awk '{print $2}' | tr -d "addr:"`
PS3='Select an option and press Enter: '
select i in $IPS
do
case $i in
$i) echo $IPS;;
esac
done
echo $IPS

At the moment it just says "Which IP would you like to use" and then freezes, most success I've had is it showing all the IP's listed in ifconfig and then showing the same menu.

View 4 Replies View Related

Programming :: Implement A Timer Expiry Function

Jan 17, 2010

I'm implementing a TCP protocol. TCP implementation requires to send packets continuously and if the receiver doesnt respond after a particular interval of time it should resend the packet again. I need some method to implement a timer expiry function. How can I implement it? Should i implement threads (If yes can you please give a sample)? or is there any better method? I'm implementing it in a Unix system.

View 3 Replies View Related

Programming :: Implement Some Part Of Codes To Use The GPU Of Graphic Card?

Sep 25, 2010

I wish to implement some part of my codes to use the GPU of my graphic card but I have no idea whether GNU as already implemented it (as for OpenMP). I mean, there are PGI Fortran compiler which embedded CUDA but I figure it's not free. I also wonder if that works only with ATI graphic cards or if for instance I can use my Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller.

View 4 Replies View Related

Ubuntu :: Periodical Hangs With USB Install?

Jan 8, 2010

I've recently installed Ubuntu to my USB stick (Installed from CD so not Live Persistent). But it hangs every few seconds, I think this is because of the low read/write speed of the usb stick. However when using the Live version booting/shutting down takes a long while, I basically need it to be able to boot fast, run fast, and shutdown fast.

View 7 Replies View Related

Programming :: Implement Dhcpctl In A Program To Manipulate Dhcp Leases?

Aug 1, 2011

i would like to implement dhcpctl in a program to manipulate dhcp leases. It doesn't work and there are errors at compilation :

/tmp/ccYPRIt5.o: In function `LeaseCleaning(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
pxe.cpp.text+0x133a): undefined reference to `dhcpctl_initialize()'
pxe.cpp.text+0x1352): undefined reference to `dhcpctl_connect(__omapi_object**, char const*, int, __omapi_object*)'

[Code]...

View 7 Replies View Related

Programming :: Learn Basic C++ - Implement Something Using System() Or Popen() Without Success

Jul 21, 2010

I've got a (very) simple perl xinetd server that I'd like to port to C++. implement something similar using system() or popen() without success.

[code]...

View 14 Replies View Related

Programming :: Implement A Device That Is In Fact A Program That Reads From Other Devices?

Aug 1, 2010

you have to read from many devices separate devices and make it look like a single one. It sounds very much like a device driver to me, perhaps... but getting my hands dirty with kernel code sounds like a daunting task for me that I've never done it...

View 2 Replies View Related

Programming :: Implement User Ranking In Php With A Huge Number Of Users?

Aug 21, 2010

I'm writing a user ranking module for a site. This ranking depends on some criterias and it's possible to set or unset any one of these criterias in order to consider them in calculating the user rank or not. And here's the way I've implemented the ranking calculation :

when I set one or more of the criterias to be considered in ranking , for each user in the system I insert one record for each criteria , for example : if I have 2 criterias and both are set and consider that I have two users , I'll have :

Ranking table
--------------
username | criteria | to_be_added | score
--------------------------------------------------
user1 | criteria1 | 1 | 0

[code]....

It means I just set the to_be_added field to 1 for all of them and leave the calculation of score for each criteria for each user to the time the user logins so that to prevent doing all these calculations at once , because there are a huge number of users ... But there is one problem , if I want to show for example the best user (based on the highest score) , the result can't always be true because some users might not logged in at that time and their score might be zero .

View 1 Replies View Related

Programming :: Implement (linear Data Structure) Queue In Shell Script?

Jun 21, 2010

I am in deeply need of queue (linear data structure) in shell script. How can I implement this ??

View 2 Replies View Related

Programming :: Measure Time Of N Processes?

Oct 24, 2010

how can I measure time of N processes and N threads and then compare this time to prove that threads are faster than processes. understanding C code, or also for some good way to measure time of N processes and N threads for C.

View 5 Replies View Related

Programming :: Different Processes Using Same File Object

Sep 29, 2009

I have 2 completely different processes A and B (they do not have any relationship) suppose A opens a file with file descriptor 4 and B opens another file with file descriptor 5

Can process A use the fd 5 (i.e using the file object of processs B) by any means..if suppose i let the fd 4 of process A to point to the file object of process B(fd 5) will it work? is it safe?

View 3 Replies View Related

Programming :: How To Kill Zombie Processes

Dec 3, 2010

I have my code with my fork in a server and each time a client connects one more process is created. i use this code for the handling of zombies

void sig_chld(int signo){//Diadikasia gia tin diagrafi twn 'zombies'
signal( SIGCHLD, sig_chld );//signal gia ton entopismo tou zombie
pid_t pid;

[code]....

but i need the server to kill each zombie after the client is disconnecting and not to have to press ctrl+c

View 1 Replies View Related

Programming :: Switch Between Processes When Debugging With Gdb?

Feb 11, 2011

How to switch between processes when debugging with gdb?

View 2 Replies View Related

Programming :: Perl To Kill Off Some Processes?

Nov 18, 2010

how to even start this Perl script. I have the following processes:

Command used to get this info:

ps aux --forest | grep -e process_name -e ksh | awk '{if ($1 == "user1" && $1 != "root" && $1 != "UID" && $1 != "xfs" && $1 != "mfg" && $1 != "mfgnet") print $0}'

Processes

user1 2819 0.0 0.0 4272 612 ? S Nov17 0:00 \_ -pksh-ksh
user1 2820 0.0 0.0 64956 1584 pts/833 Ss+ Nov17 0:00 \_ -ksh

[code]....

I need a way to kill off the pids 2819, 2820 because they do not have a process tied to them like pids 2918, 2922 and 6657. The way it works is peek shell (pid 2918)is opened then it starts a ksh (pid 2922) session then from there the end user runs a command (pid 6657).

View 7 Replies View Related

Programming :: Memory Optimization For Child Processes?

Sep 6, 2010

I work on Linux for ARM processor for cable modem. There is a tool that I have written (as the job demands) that sends/storms customized UDP packets using raw sockets. I form the packet from scratch so that we have the flexibility to play with different options. This tool is mainly for stress testing routers.

The details are here.

I actually have multiple interfaces created. Each interface will obtain IP addresses using DHCP. This is done in order to make the modem behave as virtual customer premises equipment (vcpe).

When the system comes up, I start those processes that are asked to. Every process that I start will continuously send packets. So process 0 will send packets using interface 0 and so on. Each of these processes that send packets would allow configuration (change in UDP parameters and other options at run time). Thats the reason I decide to have separate processes.

I start these processes using fork and excec from the provisioning processes of the modem.

The problem now is that each process takes up a lot of memory. Starting just 3 such processes, causes the system to crash and reboot.

I have tried the following:- 1-I have always assumed that pushing more code to the Shared Libraries will help. So when I tried moving many functions into shared library and keeping minimum code in the processes, it made no difference to my surprise.

2-I also removed all arrays and made them use the heap. However it made no difference. This maybe because the processes runs continuously and it makes no difference if it is stack or heap?

3-I suspect the process from I where I call the fork is huge and that is the reason for the processes that I make result being huge. I am not sure how else I could go about. say process A is huge -> I start process B by forking and excec. B inherits A's memory area. So now I do this -> A starts C which inturn starts B will also not help as C still inherits A?. I used vfork as an alternative which did not help either. I do wonder why.

reduce the memory used by each independent child processes.

View 1 Replies View Related

Programming :: Creating Child Processes In A Script?

Oct 14, 2010

the wrong part of the forum but basically im working on a project and getting no where what so ever and i was wondering if i could get your help. Basically i have to create two scripts do:

The parent script which is going to:
o spawn several child processes.
o keep track of the progress of the child processes.

[code]...

View 1 Replies View Related

Programming :: Use Of Dlopen When Forking Many Similar Processes?

Dec 27, 2010

I am building a queue system (in C on CentOS 5) where each directory queue has a number of process instances 'watching' it. I have a root-permission queue supervisor process which does all the forking, and the instance processes give up root as their first action. For max security each queue is accessible to a different set of users and groups.

I need to keep the RAM requirements as low as possible, so I am relying heavily on copy-on-write (since all memory writes are to shmget() shared memory)

Each process presently dlopen's the libraries it requires after fork, but I'm wondering if I would gain by performing the dlopen before forking a number of instances which all require the same libraries.

Any pointers to mid-level tutorials on dlopen and fork internals would be most appreciated: this is about my third post anywhere since I converted to Linux, but I just can't find the answer to this anywhere online.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved