Jeff Yan

Ranch Hand
+ Follow
since Nov 05, 2009
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 Jeff Yan

hey, im trying to run a program using JRE 1.4 and when i go to run the main class it comes up with:

/Users/stephensmith/Desktop/SWANS stuff/j2sdk1.4.2_14/jre/bin/java: /Users/stephensmith/Desktop/SWANS stuff/j2sdk1.4.2_14/jre/bin/java: cannot execute binary file



what can i do?
8 years ago
in what sense is it odd?? i need some constructive critasism. the problem with that tutorial is that i do not want to implement that knock knock protocol! i want it to be able to receive a GET request and process it accordingly, either getting a requested webpage or directory / file.
hey,

im having trouble getting my java server to write to the socket to get a browser to read the html it has been sent, the browser just waits for a response!!

i dont know what else to do, i need to be able to have html the server sends readable by 127.0.0.1:PORT

here is the code:


any help appreciated
sorry for the impatience, i was getting stressed about it! and the code is just a basic outline it needs refinement, but the first answer hit the nail on the head, so thank you for that. problem resolved.
9 years ago
hey, basically i have programmed a nextFit algorithm that is a cable ordering system. the user orders a length and type of cable and the program processes the order cutting the cable that is required at the required length. the orders are generated using a seperate class and are passed as a parameter to the algorithm to be processed.
i have this code working; however - it works only for the first run of each type of cable.

e.g.

-programme starts
-one order gets processed for 28m of aluminium,
-there is no aluminium in the store so more is ordered (a random integer between 100 and 200 used to represent the length ordered)
-the 28m gets taken of the ordered aluminium, say 190m was ordered from the store, the remaining aluminium after this has been processed is 168m

then after this one run, when another order of aluminium is processed, it does not take the value off the remaining aluminium variable.

i dont know if this is something to do with using the same object to process all the data?? but it should work. i cannot see the bug anywhere and have been looking for hours to no avail. the code for the class with the bug is below. any help much appreciated.

9 years ago
it is better practice to work out the Big O notation of an algorithm by hand using the mathmatical technique. in most cases it is easier than getting software to work it out for you. doing it yourself you can get the best worst and average cases of the algorithm quickly.
9 years ago
but do all these work with https aswell as http?
9 years ago
ok, thank you, il try it and get back to ya !!
9 years ago
ok, ive just looked up that, and it seems like it will work but how do i implement it?

sorry if it sounds wierd, i have only ever used the standard java class librarys! so i have no clue as to how id go about doing this
9 years ago
hey all, i have been racking my brain and researching for a few days now about this matter,

the thing is i want to be able to get information off the internet that has the https protocol,

i have created a login class and i have hardcoded some login details in it to test it, however, now it has got to the stage where i have to get information of a https website to complete the project.

i need to login to the https server from the java app and get timtable information off of it. i have looked at servelets and sockets and have no idea where to start, from what i have looked at i need to run something from the server side of things but i am not allowed to do this as it is a university site.

is there any possible way of getting the information just by logging in by the java app??

im at my wits end with this
9 years ago
hey, i am making a virtual map software that is for a pda, or android phone etc. and i was wondering what was the best way to make the main menu, the only idea i have got is just the buttons (which are map, organiser, settings, logout) in a vertical column down. i was wondering if anybody had any better ideas on how to present it?
much appriciated. jeff
9 years ago
yes, i have created the menu correctly and done all that, but IN A DIFFERENT CLASS. how do i use that menu in the other class? i have tried to do but it comes up with non static method create() cannot be referenced from a static context.
when i try and set the method create() to static it comes up with all these errors saying cannot use * variable from a static context! its really annoying! HELP :s
9 years ago
hey all, i have a main class and a menu class, in the main class i have a JFrame, and in the menu class it just creates the menu (file, edit etc) without putting it in a frame! is there any way to put that menu in the JFrame of the main class? if so . . . how? ive been trying to figure it out for ages.

ive tried creating a new object of the menu class and adding that into the JFrame like this:
but it doesnt work!

9 years ago
yea i get it now, i just dont know how to implement it properly!
9 years ago