Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
~14.0K People Reached
Favorite Forums
Favorite Tags

54 Posted Topics

Member Avatar for XodoX

Hello, how does an Interpreter work ? I read up on it and it seems you just parse each line and then (somehow) execute the lines. I suppose the code needs instructions on how to execute each line ?

Member Avatar for sepp2k
0
119
Member Avatar for XodoX

When I have a simple server-client code, how do I get the client to send the server a time request and the server responds, and the client then displays the offset and the delay ? The communication should be in NTP. I think that means there are 4 time stamps, …

Member Avatar for XodoX
0
341
Member Avatar for XodoX

I have a few questions. Server-client code with a (distributed) hash table. Give the peers their own port, own node-ID, predecessor and successor ( node-ID, IP and port of them). That's a snippet of it. port= argv[1]; ownNodeID = atoi(argv[2]); sucNodeID = atoi(argv[3]); sucIP = argv[4]; sucPort = argv[5]; preNodeID …

0
126
Member Avatar for XodoX

I have a small code utilizing a hash table. Now I want to convert it, basically, to a distributed hash table. Hoever, I can not find out how you actually code one or what changes you make to an existing hash table...??? Can anyone please help me, please? I can …

Member Avatar for L7Sqr
0
175
Member Avatar for XodoX

It's a server-client code. The client should wait for the server, and if there's no response, then send a new request. There's a 2 second wait. It's UNIX. I've been looking at some select() examples, but I'm not really sure... I found this example. #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> …

Member Avatar for iamthwee
0
161
Member Avatar for XodoX

If I want to have a datagram socket, what do I have to change here ? It's a stream socket right now. Just change it where it creates the socket ? `sockfd = socket(PF_INET,SOCK_STREAM,0);`

Member Avatar for Hiroshe
0
196
Member Avatar for XodoX

I found this site http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/ If I have a server-client code and this: clock_gettime(CLOCK_REALTIME, &time_a); // create socket clock_gettime(CLOCK_REALTIME, &time_b); // close socket If I have a and b wand want to measure the time it takes to communicate, what's the best way ? Still not fully understanding the exact …

Member Avatar for NathanOliver
0
263
Member Avatar for XodoX

I have some experience with client-server codes. TCP and udp client. I want to know how a stream socket works with HTTP. This client is for a server-client code where the greatest common divisor is calculated and displayed. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> …

Member Avatar for Banfa
0
259
Member Avatar for XodoX

I want to create a simple stream socket server. I haven't found a website that explains it well. So how do I create a simple stream server ? One connection is fine.

0
105
Member Avatar for XodoX

Hello, Billabong is just a small board game. You have kangaroos that you move clockwise around a lake. It looks like this: http://www.deskovehry.com/fotky/billabong/billabong-06.jpg First you need to draw the board etc. The example looks like this: static private void printField(String[][] field) { System.out.print(" "); String letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (int …

Member Avatar for JamesCherrill
0
181
Member Avatar for XodoX

I'm new to Python, but I can use a library to do this, right? Like this one: import pprint import scipy import scipy.linalg # SciPy Linear Algebra Library A = scipy.array([ [7, 3, -1, 2], [3, 8, 1, -4], [-1, 1, 4, -1], [2, -4, -1, 6] ]) P, L, …

Member Avatar for Gribouillis
0
2K
Member Avatar for XodoX

Hello, I'm looking for a CSV parser and I found this example.... package com.ibm.ccd.api.samplecode.parser; import java.io.BufferedReader; import java.io.StringReader; import java.util.ArrayList; public class CSVParser { String oneRes; private String line = ""; private int nbLines = 0; private BufferedReader reader; public CSVParser(BufferedReader reader) { this.reader = reader; } public String[] splitLine() …

Member Avatar for Taywin
0
131
Member Avatar for XodoX

To be honest, my programming skills stink. The College textbook I have been using dosen't do it for me. And I learn better by looking at examples. However, I have not been able to find a website that offers an extensive archive of C++ code examples. From the basics such …

Member Avatar for rubberman
0
231
Member Avatar for XodoX

I can nto find anything that explains semaphores well. From what I understand, you can create an array of the type sem_t , for instance. Like a "semaphore array", I guess. And you use loops somehow to create them. Or can somebody explain this to me, please? I'm trying to …

Member Avatar for XodoX
0
115
Member Avatar for XodoX

for i := 1 to n do for j := 1 to n do C[i, j] := A[i,j] + B[i, j] #include <iostream> #include <iomanip> using namespace std; int SIZE = 10; double Sum(double matrixA[SIZE], double matrixB[SIZE]) { int i = 0; int j = 0; double rows, columns; double …

Member Avatar for XodoX
0
130
Member Avatar for XodoX

import java.util.Arrays; public class binary_search { public static void main(String[] args) { int ar1[] = new int[128]; int p, key=78; p=Arrays.binarySearch(ar1, key); System.out.println("element found at index "+p); Arrays.sort(ar1); p=Arrays.binarySearch(ar1, key); long start = System.currentTimeMillis(); Long elapsed = System.currentTimeMillis() - start System.out.println("Time to do stuff (in milliseconds): " + elapsed ); …

Member Avatar for JamesCherrill
0
110
Member Avatar for XodoX

I'm having difficulties writing the rpc function. Specifically, I don't know how to pack a function name and input argument into a message body, send the message, set and unpack reply, and return result and error code. I know how to create the socket, request aconnection from the server etc. …

Member Avatar for XodoX
0
166
Member Avatar for XodoX

How di I use I/O redirection to load the input into an array ? % a.out < inputfile That's what I found. I don't know if that's all you need or if there's more..

Member Avatar for Lucaci Andrew
0
269
Member Avatar for XodoX

I was told you can access the index of an array and save it in a variable. Like, as you know, every element is referenced by an index number. 0,1,2,3,4 etc.. I don't want to save the content, I need the index number. I will need to know the position …

Member Avatar for triumphost
0
172
Member Avatar for XodoX

The input looks like this: Start 0 Run 40 Disk 0 Run 20 End Each word and number means something. The number is the time and the word a command. What's the best way to loop through it and evaluate it? So it's 2 different elements per line that should …

Member Avatar for XodoX
0
139
Member Avatar for XodoX

I have a linked list where the input is read into. The 2 types of input have to go into a queue. 1 queue for each type. I suppose that the output line of the linked list can be used to read it into the queue ? I know it …

Member Avatar for XodoX
0
160
Member Avatar for XodoX

I think this has something to do with process scheduling. (1st process) Start 0// starts at 0ms Run 10 // runs for 10 ms Disk 0 // no idea what this does, but it takes 10 ms Run 30 // run 30 ms End // terminates (2nd process) Start 5 …

Member Avatar for asrockw7
0
194
Member Avatar for XodoX

How many lines will the following codes print out, and why? main() { fork(); printf ("Hello!\n") fork(); printf("Good Bye!\n"); } // main What's the fork() doing here? Does it change the number of lines that will be output? > > The purpose of fork() system call is to create a …

Member Avatar for Lucaci Andrew
0
259
Member Avatar for XodoX

Ok, so I'm trying to fix this.. [CODE]# include <cstdlib> # include <iostream> # include <iomanip> # include <cmath> # include <omp.h> using namespace std; int main ( void ); void jacobi ( int n, double a[], double b[], double x[], double x_old[] ); void r8vec_uniform_01 ( int n, int …

Member Avatar for mrnutty
0
1K
Member Avatar for XodoX

Does anybody know of a good site where I can learn how to do linked lists and use multiple linked lists together? The sites I found weren't any good. I'm not getting it. I'm just the kind of person who needs to get it spoon-fed and detailed sometimes.. I would …

Member Avatar for myk45
0
52
Member Avatar for XodoX

I'm talking about Flow of Control, Functions, Parameters, overloading, arrays, classes, Pointers and dynamic data structures,exception handling, operator overloading and perhaps including linked data structures. I am not liking the programming exercises the book has at the end of each chapter. But I will have to program something to really …

Member Avatar for raptr_dflo
0
155
Member Avatar for XodoX

I read that you can use a while loop to read the input from a text file and create a doubly linked list? How do I do that? I would appreciate if someone could show me. Thank you!

Member Avatar for EskayJoe
0
1K
Member Avatar for XodoX

I'm trying to code something that's a little complex, imo. It's a C++ program that will count the number of operations of recursive functions and will compare it with O(g(n)). This count value will basically estimate time complexity function T(n). You have to find the g(n) to get O(g(n)) that …

Member Avatar for XodoX
0
157
Member Avatar for XodoX

Hi, how do I exactly do this? [quote]1) Read an integer from the input. (Reading will automatically stop after the first non-digit character, accounting for possible sign characters.) 2) DO read the next character WHILE the read character is whitespace, then validate it as an operator and store it. 3) …

0
75
Member Avatar for XodoX

Ok, I've asked something similar before, but I still have not been able to understand this... so I just want to have a txt file with math operations in it. Basically, it's just integers multiplies and added. Nothing else. 1*5+10 10+12 Each line can contain any multiplication or addition. The …

Member Avatar for Anirudh Rb
0
142
Member Avatar for XodoX

The input is in a text file and it being read by the code and stored in "line" by using getline. The input is just math operations.. 1*8+2 etc. Only * and +, nothing else. But the file can also contain invalid strings such as "1++" "1+2*+4" "2 + A …

Member Avatar for XodoX
0
116
Member Avatar for XodoX

Let's say I have a string with 1+5*9+4 etc.. whatever it may be. How do I use C++ do calculate this? I know recursive functions work here, but how? I figured I could loop ..searching for the * first ( higher precedence ) and then the +. No idea. Would …

Member Avatar for Taywin
0
164
Member Avatar for XodoX

Ok, I want to read integers from a text file...a large sum of integers. The input is a regular text file, where each line is terminated with an end-of-line character. The file is gonna contain any valid ASCII symbol between 32 and 127. A number of strings ( no negative …

Member Avatar for raptr_dflo
0
1K
Member Avatar for XodoX

I did this code ( this here is just a piece of it), and there's supposedly an incomplete function in there. I'm not sure what how to solve this. I suppose the boolean is wrong? I indicated where the problem is in the code. [code] public class Person { private …

Member Avatar for XodoX
0
180
Member Avatar for XodoX

Hello, I would like to have a program that solves Gaussian elimination. I need it for reference, I think it would be nice to have a tool like this. Now, I know there are many codes I could use online, but I need a code that formats my equation. Like, …

Member Avatar for mike_2000_17
0
155
Member Avatar for XodoX

So, I have this array and pointer: char array [6]; char *ptr; And this list of array [6] addresses and contents: 0x5010 a 0x5011 b 0x5012 F 0x5013 H 0x5014 X 0x5015 Y I'm looking for the values of the following: a) &array[0] b) array[0] c) *ptr d) (*ptr)+2 e) …

Member Avatar for Fbody
0
253
Member Avatar for XodoX

So, I have to store ( in a variable?) the number as a Roman Numeral ( M = 1000, D=500 etc.) Convert it to decimal and store in decimal. Print the number as a Roman numeral or decimal number as requested by the user. I suppose it's 2 separate functions, …

Member Avatar for XodoX
0
202
Member Avatar for XodoX

I'm still a beginner, so please bear with me;) I'm supposed to write a code that generates the Fibonacci series. Here is the sample program output: Please enter n (This program generates 0 to Fn) : 5 0 1 1 2 3 5 So, that's what I did.. [CODE] .data …

0
55
Member Avatar for XodoX

I'm trying to do the following using a linked list. [quote] delete("is",2) print 1:This 2:is 3:an 4:an 5:icorrect 6:sntence delete("an",3) print 1:This 2:is 3:an 4:icorrect 5:sntence delete("icorrect",4) print 1:This 2:is 3:an 4:sntence insert("incorrect",4) print 1:This 2:is 3:an 4:incorrect 5:sntence delete("sntence",5) insert("sentence",5) print 1:This 2:is 3:an 4:incorrect 5:sentence neighbors("is") 2:is previous:This …

Member Avatar for myk45
0
95
Member Avatar for XodoX

I'm trying to code a sentence editor. So, basically the input comes form a file, and the code sorts the words. The input in the file is I not do know, theoutput is I do not know. This is what's gonna be in the input file, but it can be …

Member Avatar for XodoX
0
168
Member Avatar for XodoX

Ok, I'm wanting to do the following... A C++ program that can edit a sentence with word insertions and deletions. You can assume the sentence has words and numbers separated by spaces and punctuation symbols. The input is a regular text file, where each line is terminated with an end-of-line …

Member Avatar for XodoX
0
114
Member Avatar for XodoX

I want to do the following: [quote] You will create a C++ program that will count the number of operations of two common recursive functions.This operation count will be basically estimate time complexity T(n). You have to find the g(n) to get O(g(n)). The program takes as input n, some …

Member Avatar for XodoX
0
144
Member Avatar for XodoX

Hello, the compiler has a problem with my "std::string line". It's in there twice, but I didn't know how else to do it. The program is like a lexical analyzer. What's the best way to fix this? [code] #include <iostream> #include <fstream> #include <string> #include <iostream> #include <string> #include <cctype> …

Member Avatar for XodoX
0
91
Member Avatar for XodoX

It's a program that works sort of like a lexical analyzer, but it's just supposed to pull any given data from a .txt file and display it. Nothing else. I'm not satisfied with the array I have so far. /**************************************************************** Array holding all keywords for checking. *****************************************************************/ char *keywords[]={"procedure","is","begin","end","var","cin","cout","if", "then","else","and","or","not","loop","exit","when", …

Member Avatar for LordNemrod
0
107
Member Avatar for XodoX

Hello, it's been a while since I took my last programming class, and I must say I don't know how to do the following. I want to create a program that pulls data from a txt file and then lists that data. The data is simply C++ variable names, reserved …

Member Avatar for XodoX
0
196
Member Avatar for XodoX

Helllo, I am supposed to do the following: [quote] Mathematically, a set is said to be consists of well-defined elements. For instance, the following are well-defined sets. A = {1, 2, 3, 4, 5, 6, 7} B = {2, 3, 4, 8, 9} A set may be described using other …

Member Avatar for guru_iyer
0
145
Member Avatar for XodoX

Hello, I got an car inventory program that stores the names of cars etc. I thin a class arraylist would work better. Like an array that can "grow" and "shrink". But I do not know how to convert the code from array to arraylist. It should still keep the member …

Member Avatar for BestJewSinceJC
0
114
Member Avatar for XodoX

Hello, I'm trying to do the following program in JAVA. I find JAVA very confusing. Liked C++ much better. Anyway, here's what I'm trying to do: [quote] Develop a program for a small auto dealership. This program will keep track of the auto inventory using an object of the class …

Member Avatar for BestJewSinceJC
0
626
Member Avatar for XodoX

Hello, These 3 codes had 5 syntax errors in each of them, but I don't think I found them all. Can somebody help me with this? [code] class AA { public: void print( ) const; int sum(); AA(); private: int x; int y; }; class BB { int one; int …

Member Avatar for XodoX
0
62
Member Avatar for XodoX

Hello, I need some help with this code. First of all, the program just closes after I enter the rows. It's not supposed to do that. Then, the coordinates (cards) 1,1 and 2,3 need to face up when I start it. How do I do that? I hope someone can …

Member Avatar for XodoX
0
125

The End.