|
Thank you for your excellent reply.
|
|
|
|
|
Hi All,
I m fighting against a problem that drove me crazy for long hours, I wanna create a simple prog like Client/Server under linux using C code. I wrote a Server.c and Client.c Files but when i type
$gcc -c Server.c Client.c
$gcc -o Blood *.o
it told me that there is a double declarion of the function main
So could some one tell me how could i test my prog on the same mchine ??? (local) Thank you !!!!
i Need Help so plz !!!
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: $gcc -c Server.c Client.c
$gcc -o Blood *.o
it told me that there is a double declarion of the function main
Did you try this?
$gcc -c Server.c Client.c
$gcc -o blood_server Server.o
$gcc -o blood_client Client.o
|
|
|
|
|
Ok i asked my professor and here what he told me to do:
after compiling the 2 files:
$gcc - client client.c
$gcc - server server.c
i ha to add a & when calling ther server:
$./server &
then i run the clien
$./client
that's all. i didn't try it yet but i hope that it'll works.
Thank you All for your Help. I appreciate it Well.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
you will need to compile each file separately. each file creates a different exe, one will create a client exe and the other a server exe.
each file has a main method, when you compile files together it to create a single exe, so what you are doing is incorrect. in short you can't have multiple definitions of a function, in your case that would be 'main'
try:
gcc -o server server.c
gcc -o client client.c
hope this helps
---
Yours Truly, The One and Only!
web: devmentor.org
Design, Code, Test, Deploy
|
|
|
|
|
Dear friends,
I'll appreciate if anyone could help me this problem.
I'm now trying to program with multi-core. For instant, with C/C++, how can I assign a task for the first core and another task for the second core? Is there any instructions support this? Or could you show me where can I find any documents relate to this field.
Thank you very much.
|
|
|
|
|
I think pthreads handle this automatically, but I don't know how much manual control you can get. Maybe this Linux magazine article (google cache) helps.
/M
|
|
|
|
|
Thanks. I'm checking.
Can otherone help me this? I'd like to receive more information.
|
|
|
|
|
You can use the sched_setaffinity() system call to lock a thread to a specific set of CPUs/cores. In most cases doing that is a bad idea and it will only slow down your system.
|
|
|
|
|
Thank you very much. This instruction was created so it must have some useful functions beside causing system slow down. But first of all, I need to try it. Once again, thanks.
|
|
|
|
|
hi i would like to know how to sort my dynamic generated table in php when i click on any header row on first click sort acending and on another click sort on decending order.
|
|
|
|
|
If you wanna sort Mysql Data, you should use two difference Mysql Query.
For example :
SELECT * FROM table1 ORDER BY filed ASC
SELECT * FROM table1 ORDER BY filed DESC
Else if you wanna sort a table in client you should use JavaScript.
|
|
|
|
|
ya i know these are two commands to show asc and desc but i would like to know that i have a grid table in php and on every field i want to do this and show a image full process to do this this grid is filled by while loop as used in php all dataare there but i want to show sorting on header of the fields click.
thanks for reply
|
|
|
|
|
I think you want to load a table and then be able to sort the data by a column after the data is loaded by clicking on the col header, correct? Uh oh, i think i may like jQuery too much as i just posted a different response pointing the user to the jQuery library.
Take a look at ajaxrain.com for table plugins to jQuery. I know there's a couple of them out there, if this is what you're looking for
|
|
|
|
|
There would be 3 components to this process-
1. User-facing page with <div id=data></div>
2. AJAX Javascript
3. Dynamic PHP page
The user-facing page will contain an empty div marked by an ID. The AJAX script will be something like-
http://whatsaranjit.com/includes/grabData.js[^]
Lastly, the PHP page will contain a script like-
$sql = "SELECT * FROM table";
if (isset($_GET['q'])) {
$q = $_GET['q'];
$sql .= " ORDER BY $q ASC";
}
On your user-facing page, you can make your table header a hyperlink-
<a href='javascript: grabData('headerName', 'data', page.php)'>Sort</a>
When you click the link, it will refresh the SQL query data into the div named 'data' appending the SQL query to order by whatever variable you pass to the AJAX script. You can expand on this to to get it to ascend/descend. Good luck!
Ranjit Viswakumar
Professional Services Specialist
rviswakumar@hostmysite.com
http://hostmysite.com/?utm_source=bb[^]
|
|
|
|
|
Need Linux library to get the pixel information from any image.
Example: By providing location(widht, height) x, y values, we should get the information of the pixel which is located at x and y position.
If any one knows about this, please help me.
Thanks in Advance
|
|
|
|
|
Have you tried following function?
unsigned long XGetPixel(XImage *ximage, int x, int y);
For more information you can see man XGetPixel .
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
hi i have a problem with my sql i have a field date and its not mandatory field show user can leave this field blank but when i store this i found and error not data in correct format and if i use 0000-00-00 then its store value 1/1/1970. while i want not use this date.
thanks in advance.
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
You could always make this field a VARCHAR (10) instead, which means that the field can take a null value; then, just insert any actual dates in the format YYYY-MM-DD, leaving fields blank where you want to, and then when you read the data from the database again, check if it's not null and if so parse it using a function like date_parse() .
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
thanks for reply.
|
|
|
|
|
hello
i would like to know that i have a report that not support chinese charachers while i am using iconv function. while on normal pages its shows correct but not in pdf file?
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
hi
i am using php with apachi and mysql with dreamcoder
1. if i am not enter date in my date filed than message incorrect value in my application user can leave this field blank how to do this.
2. i want that user can only input numeric value in my phone filed.
3. email validation
and tell me how to use this in php.
|
|
|
|
|
If you want the validation to be done client-side, before the form is submitted, then use JavaScript.
If you want the validation to be done server-side, after the form is submitted but before the data is processed, then use PHP.
Once you have decided which of these options to use, look on the Internet where you'll find a plethora of examples for both methods.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Form validation using Javascript is a browser-side function. You aren't really using PHP to do this. At max, PHP is used to generate Javascript calls. This is the code that I use on my sites and it works very well-
http://webcheatsheet.com/javascript/form_validation.php[^]
Good luck!
Ranjit Viswakumar
Professional Services Specialist
rviswakumar@hostmysite.com
HostMySite.com
[^]
|
|
|
|
|
hi i would like to know how to solve the problem that i have some data on page and each records having checkbox box when i checkall all checkbox are checked and when i click on uncheckall all checkbox unchecked suppose user select all or select multicheckbox and there is also a button named delete all than all checked check will delete from database and show only remaining records on the page.
thanks in advance?
plz some one help me.
|
|
|
|