shopnobhumi 0 Light Poster

well its a game that i am trying to run on eclipse

What will you do with the .java file after you compile it to a .class file?
Will it be a standalone application that you run on the desktop?
Or will it only execute within some server with a special environment?

shopnobhumi 0 Light Poster

I have the .jsp file and now i have to make it a readable file for java virtual machines such as(secure shell or eclipse) and i believe one can only run the .java files in order to use these virtual machines.

How are you going to use the .java source file you are creating from a .jsp file?

shopnobhumi 0 Light Poster

i also have the .jsp file that i have to convert to .java

Converting an HTML page to java source code (a .java file) makes no sense.
HTML is a Markup Language.
Java code is source for an executable program. Vastly different things.

There's something missing in your description of what you want to do.

Are you trying to write a .jsp file that will generate an HTML page?
A .jsp file is a mix of HTML and java source.

shopnobhumi 0 Light Poster

Ok i have a html page which i have to convert to .java file.I used html converter to convert the page to a .jsp file and now i have to convert it to .java file.According to the replies when i run TOMCAT,it should automatically create the file but i do not see it(well i searched the .java file).Here is the screenshot of the Tomcathttp://img375.imageshack.us/i/captureic.jpg/

shopnobhumi 0 Light Poster

Hi, i want to convert a .jsp file to .java file. I read various forums and they said to use tomcat to convert .jsp to .java.I have ran tomcat but it is not doing anything(i cannot write anything). Through command prompt i ran it and it just opens a new tomcat window and does nothing.May be i am missing the whole point here.Please help and suggest what to do and how to do that.

shopnobhumi 0 Light Poster

what you wrote is a c++ code..but i need assembly code for this(i.e-MIPS)

shopnobhumi 0 Light Poster

no i want to know how would you write it in mips language.

shopnobhumi 0 Light Poster

what would be the recursive implementation of the following c program:
int fact(int n)
{
if (n == 0) return (1);
else return(n*fact(n – 1));
}

shopnobhumi 0 Light Poster

I am trying to convert some instruction to MIPS code. But have no idea how to do that.. i know c language so i can decode it to C but dont know how to convert it to MIPS.
1.I need to write a main
2. create an array of 10 integers
3.Declare a variable
4.make a loop to check if it is odd or even
5. print a string saying "it is odd or it is even creating if else statement
6.and increment the variable.
I can write C program for these. But what would it be in MIPS?

int main()
{
int array[10]={1,2,3,4,5,6,7,8,9,10};
int i=0;
while(i<10){
if(i%2==0)
printf("It is even\n");
else 
printf("it is odd\n");
i=i+1;
}
return 0;
}
shopnobhumi 0 Light Poster

after running i am getting this error messages:
Exception in thread "main" java.lang.NullPointerException
at file1.readFile(file1.java:55) **here it should be 57
at file1.main(file1.java:10)

shopnobhumi 0 Light Poster

line number please

if(copy[0]==null) System.out.println("DEBUGGING IS IMPORTANT");

Put that in your readFile method before the while loop.

shopnobhumi 0 Light Poster

This is not running in Eclipse but ran in other jvm. Not sure if there is anything missing :(

import javax.swing.JOptionPane;
import java.io.*;

public class file1 {
static int[][] number=new int[1000][1000];;
static int row,column;

    public static void main(String[] args) {

   readFile();
   /*for(int i=0;i<row;i++)
   	for(int j=0;j<column;j++)
   		System.out.println(number[i][j]);
		*/
	String result="";

	for(int i=0;i<row;i++)
		result+="Row "+(i+1)+" Minimum value: "+findMinimum(i)+"\n";
	JOptionPane.showMessageDialog(null, result);

	JOptionPane.showMessageDialog(null, "Even numbers in array are: "+displayEven());

	JOptionPane.showMessageDialog(null, "Sum of all number is: "+getSum());
	//prints the box with dialogue minimum vale, even numbers in array 
	//and sum of all number is:  
for(int i=0;i<row;i++)
	sortRow(i);

JOptionPane.showMessageDialog(null, "After sorting each row:\n"+Print());
    }
    
    // prints the box with dialoge after sorting each row
    



private static void readFile(){

	String ver,hor,temp;
	String[] copy=new String[1000];
	int i=0,j,len=1,beg=0,end=0;

	
	try{
	FileReader fr = new FileReader("test.txt");
	BufferedReader br = new BufferedReader(fr);


		while((copy[i++] = br.readLine()) != null);
			
			fr.close();		
			i--;	
	}catch(IOException e){}
		while(copy[0].charAt(end)!=',')
			end++;
			
		ver=copy[0].substring(beg,end);
		row=Integer.parseInt(ver);
		
		beg=end;
		while(end<copy[0].length())
			end++;
		
		hor=copy[0].substring(beg+1,end);
		column=Integer.parseInt(hor);
				
		
		i=0; j=0;		
		while(i<row){
			end=0;beg=0;j=0;
			while(end<copy[i+1].length())
			{
				try{
						while(copy[i+1].charAt(end)!=','  &&  end<copy[i+1].length())
							end++;
						
						}catch(StringIndexOutOfBoundsException e){}
						
					temp=copy[i+1].substring(beg,end);
				
					number[i][j]=Integer.parseInt(temp);
					
					System.out.println(number[i][j]);
					beg=++end;
					j++;
				}
				//JOptionPane.showMessageDialog(null,"The sum is"+integers[i],"Samir",JOptionPane.WARNING_MESSAGE);	
			i++;
			}


			
}






private static int findMinimum(int row)
{
int min=0,max=0;
            for(int i=0;i<column;i++)
              if(number[row][i]>max)
                  max=number[row][i];
min=max;
            for(int i=0;i<column;i++)
                if(number[row][i]<min)
                    min=number[row][i];

return min;
}






private static String displayEven()
{
String result="";

for(int i=0;i<row;i++)
    for(int j=0;j<column;j++)
        if(number[i][j]%2==0)
            result+=number[i][j]+" ";

return result;
}






private static int getSum()
{
int result=0;

for(int i=0;i<row;i++)
    for(int j=0;j<column;j++)
        result+=number[i][j];
return result;
}






private static void sortRow(int inrow)
{
int tempo;
    for(int j=0;j<column;j++)
    for(int i=1;i<column;i++)
        if(number[inrow][i]<number[inrow][i-1])
        {
        tempo=number[inrow][i];
        number[inrow][i]=number[inrow][i-1];
        number[inrow][i-1]=tempo;
        }
}





private static String Print()
{ …
shopnobhumi 0 Light Poster

I need to find the IPC(instructions per cycle) for each processor, the clock rate for p2 that reduces its execution time to that of p1 and the numbers of instructions for p2 that reduces its execution time to that of p3.
processor ____ clock rate__ no. inst._____time
p1_____________2ghz____20*10^9 _____7s
p2____________1.5 ghz____30*10^9____10s
p3_____________3ghz_____ 90*10^9_____9s

I do not need the answer.. just tell me how to approach to each problems.(my book did not arrive yet so have no clue).

shopnobhumi 0 Light Poster

Hats off to you boss but i guess that is not my cup of tea .. i am happy with visual studio :)

i use windows and when you create a new win 32 app all you have to do is tell it not to precomplie the headers and use an empty project. this way you get and empty project and can do whatever you want. i never use stdafx.h unless i need it.

shopnobhumi 0 Light Poster

#include "stdafx.h" is mendetory if you are debugging with microsoft visual studio but yes if you are using other debugger such as venus then you dont need that.BTW yeah it ran after i changed it to int main().. thank you a lot.

shopnobhumi 0 Light Poster

i am trying to compile it (ms visual c++) but it is not compiling, i guess there is some errors but visual c++ is only saying fatal error which i have no idea what it is.Any idea?

#include "stdafx.h"
#include <iostream>
using namespace std;
      int nbs=0;
   
      void Queens(int nn, int row[], int k=0)
   
      { if(k==nn)
   
      { cout<<endl<<"Solution "<<(++nbs)<<":"<<endl;
   
      for(int i=0; i<nn; i++)
   
      { for(int j=0; j<nn;j++)
   
      { if(row[i]==j) cout<<("Q "); else cout<<(". ");
   
      } cout<<endl;} cout<<endl;}
   
      else
  
      { for(int i=0; i<nn; i++)
  
      { row[k]=i;
  
      for(int j=0; j<k;j++)
  
      { if((row[j]==row[k])||((row[j]-row[k])==(k-j))
  
      ||((row[k]-row[j])==(k-j))) goto fails;
  
      } Queens(nn, row, k+1); fails:;}}
  
      }
  
      int qu_main(int argc, char *argv[])
  
      { const int nn = 8;
  
      int *row = new int[nn];
  
      Queens(nn, row);
  
      return 0;
  
      }
shopnobhumi 0 Light Poster

ok here i am getting it to ask to enter a sentence but then not working. :(
import javax.swing.JOptionPane;

public class project0 {
    public static String inputWord;
    public static void main(String args[]){
        inputWord = JOptionPane.showInputDialog(null,"Enter a sentence.");
        while (!inputWord.equals("stop"))
        if(args.length == 0){
        //System.out.println("Enter a sentence.");
        //System.exit(1);
        }
        String s = args[0];
        int upper = 0, lower = 0;
        for(int i = 0; i < s.length(); i++){
        if(Character.isUpperCase(s.charAt(i))) upper++;
        if(Character.isLowerCase(s.charAt(i))) lower++;
        }
        System.out.println("There are:\n" +
        upper + " uppercase characters\n" +
        lower + " lowercase characters\n");
    }
}
shopnobhumi 0 Light Poster

here is my code but its not running. And i need specific letter to be counted .Dont know how to do that.

public class project0 {
    public static void main(String args[]){
        if(args.length == 0){
        System.out.println("Enter a sentence.");
        System.exit(1);
        }
        String s = args[0];
        int upper = 0, lower = 0;
        for(int i = 0; i < s.length(); i++){
        if(Character.isUpperCase(s.charAt(i))) upper++;
        if(Character.isLowerCase(s.charAt(i))) lower++;
        }
        System.out.println("There are:\n" +
        upper + " uppercase characters\n" +
        lower + " lowercase characters\n");
    }
}
shopnobhumi 0 Light Poster

I need to write a program where it will ask the user to write a sentence and count the upper case and lower case alphabet 'e'. I.E- number of lower case e is say 4 and number of upper case E is 3. Every tree is not an Elm,Emile. and it should keep asking the user to enter sentences till the user writes stop to stop the program.any idea?

shopnobhumi 0 Light Poster

here is the code but it is giving me syntax error on function main. Can anyone tell me why please

.txt
.globl main

main:
# f= (g+h)-(i+j);

    li $s0,0
    li $t1,0
    li $t2,0
    li $s1,4
    li $s2,5
    li $s3,6
    li $s4,7

    add $t1, $s1, $s2 

    add $t2, $s3, $s4 

    sub $s0, $t1, $t2 
    li $v0,1
    move $a0, $s0
    syscall
    li $v0, 10
    syscall 
shopnobhumi 0 Light Poster

i meant to say it is not running

shopnobhumi 0 Light Poster

You have a problem with the MARS library.

li $v0,1 Print integer
mov $a0,$s0 a0 is integer
syscall <--- MISSING

li $v0,10
syscall #exit

oh thank you but i am still getting syntax error while trying to load on PCSpim as it is saying problem with line where it says .globl main

shopnobhumi 0 Light Poster
.txt
.globl main

main:

# f= (g+h)-(i+j);

    li $s0,0
    li $t1,0
    li $t2,0
    li $s1,4
    li $s2,5
    li $s3,6
    li $s4,7

    add $t1, $s1, $s2 # sum of s1,s2 is stored in t1 or temporary variable
    t1 contains g+h

    add $t2, $s3, $s4 # sum of s3,s4 is stored in t2 or temporary variable
    t2 contains i+j

    sub $s0, $t1, $t2 # s0 gets $t1- $t2, which is (g+h)-(i+j)
    li $v0,1
    move $ao, $s0 # suppose to printf("f=%d\n",f) 
    li $v0, 10      
    syscall
#it is giving me syntax error
shopnobhumi 0 Light Poster

This is the output:
24
4
8
The address of b is: 0xbfec9710
The address of b+1 is: 0xbfec9718
The address of &b is: 0xbfec9710
The address of &b+1 is: 0xbfec9728

shopnobhumi 0 Light Poster

What could be the possible explanation of this program output? I am trying to learn c++ so please help

#include <iostream>
using namespace std;

int main( )
{int b[3][2];

cout<<sizeof(b)<<endl;

cout<<sizeof(b+0)<<endl; 

cout<<sizeof(*(b+0))<<endl; 

// the next line prints 0012FF68

cout<<"The address of b is: "<<b<<endl;  

cout<<"The address of b+1 is: "<<b+1<<endl; 

cout<<"The address of &b is: "<<&b<<endl; 
;
cout<<"The address of &b+1 is: "<<&b+1<<endl<<endl;  

return 0;
}
shopnobhumi 0 Light Poster

everytime i open my browser(both firefox,ie) another website opens with that such as http://online-securityscanner.com/2009/1/en/_freescan.php?nu=770522170802 and so on after saying my computer has virus which obviously is a spyware.. i tried using spybot, ad-aware and so on but did not work. here is the log file from hijack this. Please help me remove the spyware.Thank you.

Logfile of HijackThis v1.99.1
Scan saved at 7:40:38 AM, on 12/17/2008
Platform: Windows XP SP3 (WinNT 5.01.2600)
MSIE: Internet Explorer v7.00 (7.00.6000.16762)

Running processes:
C:\WINDOWS\System32\smss.exe
C:\WINDOWS\system32\winlogon.exe
C:\WINDOWS\system32\services.exe
C:\WINDOWS\system32\lsass.exe
C:\WINDOWS\system32\svchost.exe
C:\Program Files\Windows Defender\MsMpEng.exe
C:\WINDOWS\System32\svchost.exe
C:\WINDOWS\system32\svchost.exe
C:\Program Files\Intel\Wireless\Bin\EvtEng.exe
C:\Program Files\Intel\Wireless\Bin\S24EvMon.exe
C:\Program Files\Intel\Wireless\Bin\WLKeeper.exe
C:\WINDOWS\system32\spoolsv.exe
C:\Program Files\Common Files\LogiShrd\LVMVFM\LVPrcSrv.exe
C:\PROGRA~1\AVG\AVG8\avgwdsvc.exe
C:\Program Files\Common Files\LogiShrd\LVCOMSER\LVComSer.exe
C:\Program Files\Dell\NICCONFIGSVC\NICCONFIGSVC.exe
C:\Program Files\Intel\Wireless\Bin\RegSrvc.exe
C:\WINDOWS\system32\svchost.exe
C:\PROGRA~1\AVG\AVG8\avgrsx.exe
C:\PROGRA~1\AVG\AVG8\avgemc.exe
C:\Program Files\Intel\Wireless\Bin\ZcfgSvc.exe
C:\PROGRA~1\Intel\Wireless\Bin\1XConfig.exe
C:\WINDOWS\Explorer.EXE
C:\Program Files\Apoint\Apoint.exe
C:\WINDOWS\system32\hkcmd.exe
C:\Program Files\Intel\Wireless\Bin\ifrmewrk.exe
C:\Program Files\Dell\QuickSet\quickset.exe
C:\Program Files\Common Files\InstallShield\UpdateService\issch.exe
C:\Program Files\Windows Defender\MSASCui.exe
C:\Program Files\Apoint\Apntex.exe
C:\Program Files\Java\j2re1.4.2_03\bin\jusched.exe
C:\PROGRA~1\MICROS~3\wcescomm.exe
C:\WINDOWS\system32\ctfmon.exe
C:\PROGRA~1\MICROS~3\rapimgr.exe
C:\Program Files\Digital Line Detect\DLG.exe
C:\Program Files\Yahoo!\Messenger\ymsgr_tray.exe
C:\Program Files\Lavasoft\Ad-Aware\aawservice.exe
C:\hijackthis\HijackThis.exe
C:\Program Files\Mozilla Firefox\firefox.exe

R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://www.dell4me.com/myway
R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Bar = http://g.msn.com/0SEENUS/SAOS01?FORM=TOOLBR
R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Page = http://g.msn.com/0SEENUS/SAOS01?FORM=TOOLBR
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://www.yahoo.com/
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Search_URL = http://us.rd.yahoo.com/customize/ie/defaults/su/msgr8/*http://www.yahoo.com
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Bar = http://us.rd.yahoo.com/customize/ie/defaults/sb/msgr8/*http://www.yahoo.com/ext/search/search.html
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Page = http://us.rd.yahoo.com/customize/ie/defaults/sp/msgr8/*http://www.yahoo.com
R0 - HKLM\Software\Microsoft\Internet Explorer\Main,Start Page = http://www.yahoo.com/
R1 - HKCU\Software\Microsoft\Internet Explorer\SearchURL,(Default) = http://g.msn.com/0SEENUS/SAOS01?FORM=TOOLBR
R0 - HKCU\Software\Microsoft\Internet Explorer\Main,Local Page = 
R1 - HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings,AutoConfigURL = http://qcproxy.qc.cuny.edu/qcproxy.pac
O2 - BHO: Adobe PDF Reader Link Helper - {06849E9F-C8D7-4D59-B87D-784B7D6BE0B3} - …
shopnobhumi 0 Light Poster

I have this RAM installed-512MB, Shared DDR2,400MHz 2 Dimms, Inspiron 6000

Do i need to buy exactly same model to work both of them together?because i seem not to find the exact model :(

shopnobhumi 0 Light Poster

I have a DELL INSPIRON 6000 notebook. It has RAM memory of 504mb. I would like to upgrade it to 1 gb or 2 gb. But my question is if i buy a 1gb RAM,can i still keep my 504mb one.ex-Will both the 1gb and 504mb RAM work together?making it 1.504gb RAM?or i have to change it completely if i want to upgrade..please let me know

shopnobhumi 0 Light Poster

i need it to create a random number and to print out whether this random number is prime or not!! On tutorial there is noting like that :(

shopnobhumi 0 Light Poster

I have 3 instructions-
1- Use rand() to generate a number less then 100 and greater than 1
2- Call the prime() function to test the result
3- Print out the result

So far i have found how to get a prime number but don't know how to fill up the conditions.(how to use rand() function)

#include <iostream>
using namespace std;

int smallFactor(int x) {
   int answer = 2;
   while (x % answer != 0) answer++;
   return answer;
}

int main() {
   int n;
   cout << "Enter a number greater than 1: " << endl;
   cin >> n;
   if (n<1 ||n>99) cout<<"Illegal";
   else if (n == smallFactor(n)) cout << "That is prime.";
   else cout << "That is not prime.";
   cout << endl;
   return 0;
}
shopnobhumi 0 Light Poster

This is the code:
#include <iostream>
using namespace std;
int main() {
int x;
cout << "Enter a positive integer: ";
cin >> x;
if (x <= 0) {
cout << "Illegal" << endl;
exit(1);
}
if (x <= 100) {
cout << x;
}
else {
cout << x/100 << x%10 << endl;
}
return 0;
}

**when the user inputs 456 the output is 46 or say when 4560 output is 450. Can someone please explain me how it happens?

shopnobhumi 0 Light Poster

got it.thnx a lot.

shopnobhumi 0 Light Poster
include <iostream>
using namespace std;
int main()
{
int x=0;
cout<<"please enter a positive even number"<<
cin>>x;
if ((x%2==0)
cout<<"the square is"<<x*x<<endl;
if ((x%2==1)
cout<<"value is illegal"<<endl;
exit (0);
return 0;
}

This is what i did

shopnobhumi 0 Light Poster

I need to write a program where it would ask the user to enter a positive even number,when entered if wrong then it would say value is illegal and will terminate the program. If it is even then program prints out the square of the number.
I have just started programming and i am finding this really hard.please help.

shopnobhumi 0 Light Poster

sorry i m not sure how to put them in 'code tags'

shopnobhumi 0 Light Poster

This is what i got

*****
*
*
*
*

using this code :

#include<iostream>
using namespace std;

int main()

{
        int i=0;
        int j=0;
        while (i<4)
        {
            cout<<'*';
            i++;
        }
        while (j<5)
        {
            cout<<'*';
            j++;
            cout<<endl;
            i++;
        }
        return 0;
}
shopnobhumi 0 Light Poster

Hi i have just started my c++ class and really having hard time with that.i was assigned to draw a graph which should look like dis :

*****
*****
*****
*****
*****

This is what i am trying but getting only this result :
*****
*
*
*
*

Please help me out with this:

#include<iostream>
using namespace std;

int main()
{

        int i=0;
        while (i<4)
        {
        cout<<'*';
        i++;
        }
        int j=0;
        while (j<5)
        {
        cout<<'*';
        j++;
        cout<<endl;
        i++;
 }
return 0;   
}