Re: out of memory
Richard Hall wrote: > I've just begun using JDK1.1.6 on my Debian 2.0.29 machine, and the > compiler often, but not always claims to be out of memory. top says: > > Mem: 14324K av, 14020K used,304K free, 8732K shrd, 92K buff > Swap: 32252K av, 17908K used, 14344K free 3616K cached > > The compiler has bailed with close to 1M of RAM free. The only things > running while this is happening besides a few xterms are X, Netscape, and > XEmacs. Do I need to add more swap or what? > netscape and emacs both gobble prodigious amounts of memory, and you don't have a whole lot to start with. try shutting down netscape (naturally i would never advocate shutting down emacs, keep that running until you shut down the system!). you could use more swap but you may end up with a whole lot of swapping going on. you probably need more memory. kanpai! pat
Re: Survey, what tool do you use?
Dustin Lang wrote:
> > What development tool do you use to help on daily coding?
>
> pico :)
>
wimp! real men use cat:
cat > hiya.java
class hiya
{
public static void main(String argv[])
{
System.out.println("hiya pooky!");
}
}
^D
Re: clarification regarding java-linux
hi mahesh, microcon wrote: > Hai, > > I would like to run my java applet in linux. I am not able to set the > classpath properly. > > steps which I had follwed is > > 1) I have unzipped tar file jdk1.1.5-v5-980311.tar.gz under linux > this bit is ok, take a not of where you untarred the file. a popular location is:/usr/local/java > 2) I opened the profile /etc/profile to check wheather path and > classpath has set properly. > but there was no entry for path and classpath you don't actually need to set your classpath, just set your path like this (maybe): for tcsh: setenv PATH /usr/local/java/bin:$PATH for zsh: export PATH=/usr/local/java/bin:$PATH read the man page for whichever shell you are using for the exact method of setting your path. untarring the jdk distribution does not set your path for you. hope this helps pat ps: your system clock seems to be off by a bit.
Re: Problem with difference between Mac & Linux Java
Glenn Valenta wrote:
> I'm new to Java and have taken a course at CU Denver in Java
> Programming. The course outline states (ironically) that you must
> have W95 or a Mac to take the course. I have entered it using
> Linux. All has been fine up till I turned in my first code. The
> following code compiles and runs on my machine without error but
> the instructor stated that when he compiled and ran my code, he
> got an error.
>
> "I get an IO exception on any input to sreport.java. Let
> me know if you are seeing a different behavior."
>
i can also get this error on nt, but your code works ok on
solaris with jdk1.2beta3. my linux machine is not accesible
at the moment, however.
> Why would this code work fine on Linux and not on his Mac?
> Could someone be so kind as to compile and confirm my results?
>
he has a mac? well i don't know enough about macs to be sure,
but i have good reason to believe that it doesn't work on windows
because pressing "enter" on a windows machine generates
"carriage return/line feed" whereas on a linux machine it generates
"carriage return". by slightly modifying your code, i was able to
make it work on windows, but then it didn't work properly
on solaris. now i could just *tell* you what i did, but i wouldn't
want to spoil the fun by doing your homework for you now would i? ;-)
but here's a few hints:
> (I'm unsure of what version he is running.)
> My version is JDK_1.1.5 on RH5.0 using kernal 2.0.33
>
> //sreport.java/
> // a cheesy program to demonstrate IO //
> // Program will add sales items and calculate//
> // Salesman's commistion //
>
you spelled commission ^^ wrong up there
> import java.io.*;
>
> public class sreport {
> public static void main(String args[]) throws IOException
> {
> double _total=200; //var init to base salary
> final double _PC=0.09;//percent commission
>
> final double _A=239.99*_PC;
> final double _B=129.75*_PC; //commission on cost of
> final double _C=99.95*_PC; //each Item
> final double _D=350.89*_PC; //itemcost * percent-commission
>
> char prod=0;
> do
> {
> System.out.println("Enter the Product Sold ( A->D ). X to Exit");
> prod=(char)System.in.read();
> switch(prod)
> {
> case'a':case'A':
> _total+=_A;
> break;
> case'b':case'B':
> _total+=_B;
> break;
> case'c':case'C':
> _total+=_C;
> break;
> case'd':case'D':
> _total+=_D;
you don't have a default for your switch statement, so i can put in
products E through Z or even a-z, 0-9, !@#$%^&*()_{}:"';\/. if i want to.
(not that this is in any way related to your problem of course).
> }
> System.in.skip(1);//remove nl
> }while(prod!='x'&&prod!='X');
> System.out.println("Total Weekly Pay is $"+_total);
>}
> }
>
maybe one of these last lines needs to change a little bit?
if you are really close to a deadline i can tell you the answer,
but the problem basically is that this command line stuff is
not portable across architectures. pay close attention to
the different values returned by windows and unix pressing
the enter key, and the answer will leap out and byte you.
see your instructor and ask for only graphical assignments,
then you should be ok. if your deadline fast approaches,
i can tell you the answer in return for copious amounts of
beer. ;-)
hope this helps,
kanpai!
pat
Re: Problem with difference between Mac & Linux Java
Eitzenberger Thomas wrote:
> pat cavanagh wrote:
>
> > > }
> > > System.in.skip(1);//remove nl
> > > }while(prod!='x'&&prod!='X');
> > > System.out.println("Total Weekly Pay is $"+_total);
> > >}
> > > }
> > >
> >
> > maybe one of these last lines needs to change a little bit?
> > if you are really close to a deadline i can tell you the answer,
> > but the problem basically is that this command line stuff is
> > not portable across architectures. pay close attention to
> > the different values returned by windows and unix pressing
> > the enter key, and the answer will leap out and byte you.
> > see your instructor and ask for only graphical assignments,
> > then you should be ok. if your deadline fast approaches,
> > i can tell you the answer in return for copious amounts of
> > beer. ;-)
> >
> > hope this helps,
> > kanpai!
> > pat
>
> I never tried it but isn't there a property called line.separator in
> java.lang.System.getProperties() ??
>
ah yes, so there is. i've never tried it either, because after all, if i
wantedcommand line stuff, i would probably use perl, or maybe c++ if i was
feeling
really masochistic. but looking at the web page
http://www.javasoft.com/products/jdk/1.1/docs/api/java.lang.System.html#getProperties()
http://www.javasoft.com/products/jdk/1.1/docs/api/java.util.Properties.html#_top_
it looks like you could do something like this:
Properties p = System.getProperties();
String nl = p.getProperty("line.separator");
and then see if the next stuff on System.in is the same as nl.
i guess that would be portable. so to correct my previous
statement, "this command line stuff is easy to write non-portably
and a bit more work to write portably."
> BTW could I get a beer too ?
free beer for everybody! it's the new age of the java linux list.
kanpai!
pat
