Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Andrew Lit

Ranch Hand
+ Follow
since Jul 01, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrew Lit

Hi,

i add canvas into mine form and want to draw an image which i read from file. but when i run the program my canvas draws nothing.
this is how i read the image file:
if i do it like this than it draws me something

but if i change generatePixels function like this, i get empty window:

I can't understand what is wrong. I would be really glad if tou helped me
16 years ago
Hi,
i got really wierd problem here and can't solve it.
i wrote client/server programm in java everything works fine, (both sides in c\c++ also ok), i am trying to make java client to work with c server, but got very strange bug(well i don't know how to call it)
this is code from client


//...
is = new BufferedReader(new InputStreamReader(server.getInputStream()));
os = new PrintStream(server.getOutputStream());

String buffer = "name " + Login + " " +pswd;

// send first time
os.println(buffer+"\0");

String buffer1 = is.readLine();

String comm = getCommand(buffer1);
StringTokenizer st = new StringTokenizer(buffer1);
st.nextToken();
ID = st.nextToken();
if(comm.equals("accepted")){
println("Yout ID - "+ID); //everything is fine here
}

println("Repeat");

buffer = "name " + Login + " " +pswd;
println("send one more time "+buffer);
//send second time
os.println(buffer+"\0");
//this is for test purpose
while(true){
String buffer2 = is.readLine();

println("X "+buffer2);
if(buffer == "ad") break;
}


now i'll try to explain what results i get
after i send first time i get such string back(response to that string)

second time i send SAME thig to the server i get 3 strings

sometimes before accept i get some garbage. i checked the server, but it send only the data i need (wrote the answer string byte by byte into file)
so my question would be wtf is happenning here ??
i would be really glad if you helped me, because i have no idea where the problem could be.
thank you in advance.
Hi,
this is a console program
thank you in advance
Hi
is it possible to do it in console ? i searched the forum on this topic and found one post dated (2001) where it was said that it is impossible.
do i have to use JNI to make that work ?
16 years ago
Hi,
i have this simple code

well, i specially turned off server to test and client gets connection refused exception, but it is not getting out of the program and my console window hangs doing nothing.
What is wrong here?
thank you in advance.
Hi,
i've got a task, which i have no idea how to solve, this task sounds like this :
" you have N rectangles. and need to construct a rectangle of a maximum perimeter using given rectangles (only a part of given rectangles may be used) "
my problem is that i have no idea where to start from i tried to search the web, but i don't even know the name of the algorithm that must be used to solve the problem.
any help appreciated
16 years ago
Hi,
if i want to write a XML parser what i have to know ?
maybe there are some special algorithms used to parse a XML file?
thank you in advance.
16 years ago
Hi,
i just wanted to ask an algorithm on this assignment,
to find the longest knight's move, that it wouldn't cross it's own path.
path is the shortest line between start of the one move and end of the one move.
thank you.
16 years ago
Hi,
i was wondering how to create an exception that would react on some events of my own. well for example when some expression is false then exception is thrown.
thank you.
17 years ago
yes, it did.
thank you.
17 years ago
thank you.
17 years ago
Hi,
i can't understand what is the reason for such a wierd output, first loop gives me different numbers but second gives me 11???

probably you could suggest me better way to generate numbers, thank you.
17 years ago
Hi,
is it possible to determine if the window with my applet is active at the moment?
17 years ago
Hi,
if my class, let's say Board, extends Canvas and there is a paint method there, it means that method paint called automatically (correct me if i am wrong).
So the question would be, if there is a way to avoid that automatic paint call?
17 years ago
Hi,
i was just wondering what would be more efficient :

or

[ July 15, 2003: Message edited by: Andrew Lit ]
17 years ago