:: Home Page
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Testimonials Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
 Categories >> Code Snippets
  Programming Code (810)   Scripts_Markup Code (196)
Suggest New Category 


Question Asked @ Answers Views     Select
Write a simple encryption program using string function which apply the substitution method.    0  3305
how to write test case for a text field that should be mandatory paypal   1  2328
write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20    0  2019
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility" genpact   1  2295
How to add a value from textBox over an existing certain column in SQL Server    0  1265
Using C# Write a program that performs the following. The user inputs a number and then enters a series of numbers from 1 to that number. Your program should determine which number (or numbers) is missing or duplicated in the series, if any. For example, if the user entered 5 as the initial number and then entered the following sequences, the results should be as shown. Input Sequence Output ---------------------- --------------- 1 2 3 4 5 Nothing bad However, if 7 were the high number, the user would see the results on the right for the following number entries: Input Sequence Output ---------------------- --------------- 1 3 2 4 5 Missing 6 Missing 7 And if 10 were the high number and the user entered the numbers shown on the left, note the list of missing and duplicate numbers: Input Sequence Output ---------------------- --------------- 1 2 4 7 4 4 5 10 8 2 6 Duplicate 2 ( 2 times) Missing 3 Duplicate 4 ( 3 times ) Missing 9 The program should check the high number that the user inputs to ensure that it does not exceed the size of any array you might be using for storage.    0  2362
How to Check if a string is alphanumeric or not using VB Script    1  2484
what is oop?    3  2127
which function is used to clear the buffer stream on gcc? for example: I wrote following code on gcc #include int main(void) { char ch; int a,b; printf("\nenter two numbers:\t"); scanf("%d%d",&a,&b); printf("enter number is %d and %d",a,b); printf("\nentercharacter:\t"); scanf("%c",&ch); printf("enter character is %c",ch); return 0; } in above progarm ch could not be scan. why?plz tell me solution.    2  2713
does anyone know the code to display a triangle using a applet?    1  2051
code inside filter to restrict users to access a servlet component . niit   1  1661
write a c program which takes 20 numbers in an array as input from user and rearrange them in two different array defining even or odd    0  1458
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)    0  1618
program for check the given number is prime or not in    0  1624
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n jomo-kenyatta-university   0  1264
E-Mail New Answers        Answer Selected Questions       
Prev    1    8   [9]    10  ... 16   ... 21   ... 26   ... 31   ... 36   ... 41   ... 46   ... 51   ... 56   ... 61   ... 66    Next
Un-Answered Questions
 Question Views   Select
plzzzzzzzzz xplain this code import java.awt.*; import java.util.Date; import java.awt.event.*; import java.awt.MenuItem.*; import java.sql.*; import sun.jdbc.odbc.*; import*; public class NewConnection extends Frame implements ActionListener { Label l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13; Button exit,save,bnext,top,prev,botm,ad,edit; TextField txtSvNo,txtConsNo,txtSvDt,txtConsName,txtAddr1,txtPhNo,txtCy lQty,txtCylDep,txtRegDep,txtRegQty,adr2,adr3,tot,stnry,rmrk; Date date=new Date(); String ConsName; String Addr1; public static void main(String sr[]) { new NewConnection().setVisible(true); } public NewConnection() { super("New Connection"); Statement stmt; ResultSet rs; //PreparedStatement pst; Connection con; try { Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:Agency"); if (con!=null); System.out.println ("connected"); stmt =con.createStatement (); } catch(Exception e1) { System.out.println (e1); } setSize(1280,800); setBackground(Color.lightGray); setLayout(null); l1=new Label("SV NO"); l1.setBounds(260,60,90,30); l1.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l1.setAlignment(Label.CENTER); add(l1); l2=new Label("CONSMR NO"); l2.setBounds(30,60,90,30); l2.setFont(new Font("TimesRoman",Font.PLAIN,15)); l2.setAlignment(Label.CENTER); add(l2); l3=new Label("SV DATE"); l3.setBounds(520,60,90,30); l3.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l3.setAlignment(Label.CENTER); add(l3); l4=new Label("NAME"); l4.setBounds(30,150,45,30); l4.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l4.setAlignment(Label.CENTER); add(l4); l5=new Label("ADRS"); l5.setBounds(30,220,45,30); l5.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l5.setAlignment(Label.CENTER); add(l5); l6=new Label("PH NO"); l6.setBounds(500,150,45,30); l6.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l6.setAlignment(Label.CENTER); add(l6); l7=new Label("CYLDR"); l7.setBounds(30,390,55,30); l7.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l7.setAlignment(Label.CENTER); add(l7); l8=new Label("DEPOSIT"); l8.setBounds(320,390,65,30); l8.setFont(new Font("TimesRoman",Font.PLAIN,15)); l8.setAlignment(Label.CENTER); add(l8); l9=new Label("DEPOSIT"); l9.setBounds(320,440,65,30); l9.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l9.setAlignment(Label.CENTER); add(l9); l10=new Label("RGLTR"); l10.setBounds(30,440,55,30); l10.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l10.setAlignment(Label.CENTER); add(l10); l11=new Label("TOTAL"); l11.setBounds(320,480,55,30); l11.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l11.setAlignment(Label.CENTER); add(l11); l12=new Label("Cur.Statn.NO."); l12.setBounds(290,550,85,30); l12.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l12.setAlignment(Label.CENTER); add(l12); l13=new Label("REMARKS"); l13.setBounds (30,630,85,30); l13.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l13.setAlignment (Label.CENTER); add(l13); txtSvNo=new TextField(); txtSvNo.setBounds(375,60,80,30); txtSvNo.setBackground(Color.white); add(txtSvNo); txtConsNo=new TextField(); txtConsNo.setBounds(130,60,80,30); txtConsNo.setBackground(Color.white); add(txtConsNo); txtSvDt=new TextField(); txtSvDt.setBounds(635,60,80,30); txtSvDt.setBackground(Color.white); add(txtSvDt); txtConsName=new TextField(); txtConsName.setBounds(100,150,200,30); txtConsName.setBackground(Color.white); add(txtConsName); txtAddr1=new TextField(); txtAddr1.setBounds(100,220,350,30); txtAddr1.setBackground(Color.white); add(txtAddr1); adr2=new TextField(); adr2.setBounds(100,250,350,30); adr2.setBackground(Color.white); add(adr2); adr3=new TextField(); adr3.setBounds(100,280,350,30); adr3.setBackground(Color.white); add(adr3); txtPhNo=new TextField(); txtPhNo.setBounds(570,150,150,30); txtPhNo.setBackground(Color.white); add(txtPhNo); txtCylQty=new TextField(); txtCylQty.setBounds(100,390,60,30); txtCylQty.setBackground(Color.white); add(txtCylQty); txtCylDep=new TextField(); txtCylDep.setBounds(410,390,60,30); txtCylDep.setBackground(Color.white); add(txtCylDep); txtRegDep=new TextField(); txtRegDep.setBounds(410,440,60,30); txtRegDep.setBackground(Color.white); add(txtRegDep); txtRegQty=new TextField(); txtRegQty.setBounds(100,440,60,30); txtRegQty.setBackground(Color.white); add(txtRegQty); tot=new TextField(); tot.setBounds(410,490,60,30); tot.setBackground(Color.white); add(tot); stnry=new TextField(); stnry.setBounds(410,550,60,30); stnry.setBackground(Color.white); add(stnry); rmrk=new TextField(); rmrk.setBounds(140,630,600,30); rmrk.setBackground(Color.white); add(rmrk); exit=new Button("EXIT"); exit.setBackground(; exit.setBounds(760,700,40,40); exit.addActionListener(this); add(exit); save=new Button("SAVE"); save.setBackground(; save.setBounds(715,700,40,40); save.addActionListener(this); add(save); bnext=new Button("NEXT"); bnext.setBackground(; bnext.setBounds(90,700,40,40); bnext.addActionListener(this); add(bnext); top=new Button("TOP"); top.setBackground(; top.setBounds(0,700,40,40); top.addActionListener(this); add(top); prev=new Button("PREV"); prev.setBackground(; prev.setBounds(45,700,40,40); prev.addActionListener(this); add(prev); botm=new Button("BOTM"); botm.setBackground (; botm.setBounds (135,700,40,40); botm.addActionListener (this); add(botm); ad=new Button("ADD"); ad.setBackground (; ad.setBounds (300,700,40,40); ad.addActionListener (this); add(ad); edit=new Button("EDIT"); edit.setBackground (; edit.setBounds (345,700,40,40); edit.addActionListener (this); add(edit); } public void actionPerformed(ActionEvent e) { if(e.getSource()==exit) { this.dispose(); System.exit(0); } if(e.getSource()==save) { try { Connection con=DriverManager.getConnection("jdbc:odbc:Agency"); PreparedStatement pst=con.prepareStatement("INSERT INTO NewCon values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); pst.setInt (1,Integer.parseInt(txtConsNo.getText())); pst.setInt (2,Integer.parseInt(txtSvNo.getText())); pst.setString (3,txtSvDt.getText()); pst.setString (4,txtConsName.getText()); pst.setInt(5,Integer.parseInt (txtPhNo.getText())); pst.setString(6,txtAddr1.getText()); pst.setString(7,adr2.getText()); pst.setString(8,adr3.getText()); pst.setInt(9,Integer.parseInt (txtCylQty.getText())); pst.setInt(10,Integer.parseInt (txtCylDep.getText())); pst.setInt(11,Integer.parseInt (txtRegQty.getText())); pst.setInt(12,Integer.parseInt (txtRegDep.getText())); pst.setInt(13,Integer.parseInt (tot.getText())); pst.setInt(14,Integer.parseInt (stnry.getText())); pst.setString(15,rmrk.getText()); pst.executeUpdate (); con.close(); } catch(Exception e2) {System.out.println(e2);} } if(e.getSource()==ad) { int newcono=60000,newsvno=10000; System.out.println("entered if body"); try { System.out.println("entered the try:"); Connection con1=DriverManager.getConnection("jdbc:odbc:Agency"); Statement stmt1=con1.createStatement(); ResultSet rs1=stmt1.executeQuery("SELECT Cons_No,Sv_No FROM NewCon "); while( { //System.out.println(rs1.getInt("Cons_No")); txtConsNo.setText(""+rs1.getInt(1)); txtSvNo.setText(""+rs1.getInt(2)); //newcono=rs1.getInt("Cons_No"); } //rs1.last(); newcono=Integer.parseInt(txtConsNo.getText ()); newsvno=Integer.parseInt(txtSvNo.getText ()); //newcono=rs1.getInt("Cons_No"); System.out.println(newcono); newcono=newcono+1; newsvno=newsvno+1; txtConsNo.setText (""+newcono); txtSvNo.setText(""+newsvno); txtSvDt.setText(""+ date); txtConsName.setText(""); txtAddr1.setText(""); txtPhNo.setText(""); txtCylQty.setText(""); txtCylDep.setText(""); txtRegDep.setText(""); txtRegQty.setText(""); adr2.setText(""); adr3.setText(""); tot.setText(""); stnry.setText(""); rmrk.setText(""); con1.close(); } catch(Exception e4){System.out.println (e4);} } if(e.getSource()==bnext) { try{ Connection con2=DriverManager.getConnection ("jdbc:odbc:Agency"); Statement stmt2=con2.createStatement (); ResultSet rs2=stmt2.executeQuery("SELECT * FROM NewCon ");; { txtConsNo.setText(rs2.getInt(1)+""); txtSvNo.setText (rs2.getInt(2)+""); txtSvDt.setText (rs2.getString(3)+""); txtConsName.setText (rs2.getString(4)+""); txtPhNo.setText (rs2.getInt(5)+""); txtAddr1.setText(rs2.getString(6)+""); adr2.setText (rs2.getString("Address2")+""); adr3.setText (rs2.getString("Address3")+""); txtCylQty.setText (rs2.getInt(9)+""); txtCylDep.setText (rs2.getInt(10)+""); txtRegDep.setText (rs2.getInt(11)+""); txtRegQty.setText (rs2.getInt(12)+""); tot.setText(rs2.getInt (13)+""); stnry.setText(rs2.getInt(14) +""); rmrk.setText(rs2.getString (15)+""); } } catch(Exception e5){} } } } 799
how to transform XML Data into HTML 968
how to remove or delete multiple selected items from listbox in on button click in asp? 263
Sir... please give some important coding questions asked by product companies.. 441
How to change winform look? 1378
can any one give me code to keyed a flat file and used chain in RPGLE to search any item 711
What is the functionality of FindWindow? 272
How can a procedure fetch data from FTP? I need a general code for this.. 1104
Hello I am hosting remoting within IIS. Everything works just fine as long as I allow anonymous access at the IIS level. When I allow only Windows Authenticated sessions, something very strange happens: If the client activates the remote object with IP address - works fine If the client activates it using a machine name - get http 401 exception is thrown. The exception is thrown when the client calls the remote method. I set the channel's useDefaultCredentials property to true. Any idea how to allow Windows Authentication? Here is the call stack: System.Net.WebException: The remote server returned an error: (401) Unauthorized .. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean handshakeComplete) at System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob, Boolean handshakeComplete) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.Authenticate(String challenge, WebRequest webRequest, ICredentials credentials) at System.Net.AuthenticationManager.Authenticate(String challenge, WebRequest request, ICredentials credentials) at System.Net.AuthenticationState.AttemptAuthenticate (HttpWebRequest httpWebRequest, ICredentials authInfo) --- End of inner exception stack trace --- 2739
Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net. 1324
can everyone explain this code Private Sub DrawRect(rectSource As RECT, lngColour As Long) Line (rectSource.Left, rectSource.Top)-(rectSource.Left, rectSource.Bottom), lngColour Line (rectSource.Left, rectSource.Top)- (rectSource.Right, rectSource.Top), lngColour Line (rectSource.Right, rectSource.Bottom)- (rectSource.Right, rectSource.Top), lngColour Line (rectSource.Right, rectSource.Bottom)- (rectSource.Left, rectSource.Bottom), lngColour End Sub 1388
1.Explain what happens to a session object when the browser associated with it is closed? 2.Explain how a session object is created and used. (Note: you are not required to provide the Java statements such as ‘getAttribute’) 1049
how to pass data between pages using URLs 677
Common UI for Multiple web applications. Suppose there are 35 websites using same third party controls.These 3rd party controls are made together that all 35 websites can use these controls.If we put all 3rd party controls and use its dll in 35 websites,only class files will be accessable. But I want to use CSS,images also in all 35 websites. how I can design the N-tier solution for this project. 1196
create Drop-Down Navigation Menus 798
E-Mail New Answers        Answer Selected Questions