Hi, I want to find all the words(scabble words) that can be made out of given set of letters. ex: abnana results: a aa ab an baa ban banana na nab How could i achieve this? Do i need a binary tree? Plz some one help me...

Member Avatar
Member Avatar
+0 forum 15

Hi all, I get 'Invalid string or buffer length' exception when trying to do this. String s=resultSet.GetString(1) Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3906) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5697) at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353) at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1503) at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:381) at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174) at java.sql.DriverManager.getConnection(DriverManager.java:579) at java.sql.DriverManager.getConnection(DriverManager.java:243) at Controll.Test.sselect(Test.java:72) at Controll.Test.main(Test.java:33) Not only getString(), any method in Resulset cannot be assigned to a variable. But this prints the values. When i try to assign the value to a variable it throws the exception. System.out.println(resultSet.GetString(1)) Here is my code try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Connection conn = DriverManager.getConnection("jdbc:odbc:abc"); Statement stmt = conn.createStatement(); ResultSet rss …

Member Avatar
Member Avatar
+0 forum 14

Hi all, I'm developing a simple RMI chat server. Im getting following exception when i execute Client. Server works well. java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) at sun.rmi.transport.Transport$1.run(Transport.java:177) at sun.rmi.transport.Transport$1.run(Transport.java:174) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:173) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160) at ServrImplementation_Stub.joinChatRoom(Unknown Source) at ClientImplementation.<init>(ClientImplementation.java:28) at ClientImplementation.main(ClientImplementation.java:79) this is my client implementation public ClientImplementation(String name) throws RemoteException { String arg = "rmi://localhost:2828/chatfun"; myName=name; // myGui=gui; try{ csi=(chatServerInterface)Naming.lookup(arg); csi.joinChatRoom(name,(chatClientInterface)this);//this is the line which the exception shows this.chatStart(); }catch(Exception ex) …

Member Avatar
Member Avatar
+0 forum 7

Hi, Im developing a game. When the human gets his turn i want to display a JFrame with some buttons. So the game must wait until the user clicks on a button. Also i want to identify which button is clicked. I read that JOptionPna gets any component as a parameter.I did the following. but the coding of the my object is shown inside an input field. MyFrame my=new MyFrame(); JOptionPane.showInputDialog(null,"test",my); PLZ....... help me

Member Avatar
Member Avatar
+0 forum 2

Hi, I want to get the object of the currently open JFrame? I found this Frame[] frames = Frame.getFrames(); Does this provide the open frames? If so how to get the frame that i need. Plz Help..

Member Avatar
Member Avatar
+0 forum 1

Hi all, I have givn a task to implement a game. It has ruls of texa's Holdem poker and the objective is to make words like scabble.So it is a blend of these 2 games. So i need to store (Only with 5 letters)words(I dont know whether it is a trie,database,map or what..). There are about 20,000 words. What i want do is: When im providing 2 letters(ex: a,c) the storage should give me all the words which contains a and c. PLZ some one give me a way of doing this. I feel like store all the words in …

Member Avatar
Member Avatar
+0 forum 4

Hi, I want to implement an English word dictionary without the meanings. I have 51,947 words. I read many articles on the internet and sugestions were trie, Hashset Will implementing a trie provide better perfomance for serching or Hashset or anyother. Plz help me..

Member Avatar
Member Avatar
+0 forum 2

Hi all, I dont why my code is not detecting the matching words. Firstly Im reading the words from a text file into an array. Plz help me to make this correct. This is my code. import java.util.*; import java.io.*; public class TestRegex{ public static void main(String[] arg) { String s="ace"; int i=0; /*if (s.matches(".*c.*e.*")) System.out.println("ok"); for(char alphabet = 'A'; alphabet <= 'Z';alphabet++){ System.out.println(alphabet); } */ String[] arrayWords=new String[120]; /* arrayWords[0]="apcple"; arrayWords[1]="appa"; arrayWords[2]="esjdchc"; arrayWords[3]="csksjce"; arrayWords[4]="ce"; arrayWords[5]="jazz"; arrayWords[6]="classic"; arrayWords[7]="sjdheiudc"; arrayWords[8]="no"; arrayWords[9]="yes";*/ try { FileInputStream fileStm = new FileInputStream("words.txt"); DataInputStream ins = new DataInputStream(fileStm);// Get the object of DataInputStream BufferedReader br = …

Member Avatar
Member Avatar
+0 forum 5

Hi, i get an NullPointerException in this line:if (let==currentLink.aLetter) in search method. This is node class public class Letter { char aLetter; int points; Letter next; public Letter(char aLetter,int points) { this.aLetter=aLetter; this.points=points; } public Letter() { } public String printLink() { // System.out.print("{" + aLetter + ", " + points + "} "); return aLetter+" "+points; } } This is the other class public class CardClass { private Letter head; // private Letter prev; private static int size=0; public CardClass() { head=new Letter(); //prev=new Letter(); } //Returns true if list is empty public boolean isEmpty() { if (head == …

Member Avatar
Member Avatar
+0 forum 7

Hi all, Im new to android and eclipse. When i create a new android project it provides a string call "hello" and the value is "Hello world, Test1Activity" as my project name is Test1. So when i run it the string is shown.No prob there. But if i modify the value to lets say "Hi" It does not work. A xml file is created in res folder called Strings.out.xml. Y...Im confuced. Even if i deleted it again it is created. Plz help me.

Member Avatar
Member Avatar
+0 forum 1

Hi ! I am writing simple email client that uses TCP/IP sockets to interact with an SMTP server to send email messages. this is my code import java.io.*; import java.net.*; import java.util.*; import java.text.*; public class TestSendMail { public static void main(String args[]) throws IOException { Socket socket; DataInputStream dataInput; DataOutputStream dataOutput; String mailServer = new String("smtp.gmail.com"); socket = new Socket(mailServer, 587); dataInput = new DataInputStream( socket.getInputStream()); dataOutput = new DataOutputStream( socket.getOutputStream()); String sender= "mymail@gmail.com"; dataOutput.writeBytes("MAIL FROM: " + sender ); System.out.println( dataInput.readLine() ); String addressee= "friend@gmail.com"; dataOutput.writeBytes("RCPT TO: " + addressee ); System.out.println( dataInput.readLine() ); dataOutput.writeBytes("DATA"); System.out.println( dataInput.readLine() ); …

Member Avatar
Member Avatar
+0 forum 3

Hi all, I have given a assignment to implement patterm matching algorithms and to do a experimental analysis on number of comparisons, real time taken and CPU time taken for each algorithm. I have done all except CPU time calculation. Plz can anyone guide me how to do this...

Member Avatar
Member Avatar
+0 forum 7

Hi all, Im new to java. I get this error. Non-static variable this cannot be referenced from a static context myClass c=new myClass() ^ this is my code [CODE] public class MyOwnBm{ private Hashtable myHash=new Hashtable(); public static void main(String[] args) { myClass c=new myClass(); c.match(); } public class myClass{....} } [/CODE] PLZ... help me I've wasted hours on this.

Member Avatar
Member Avatar
+0 forum 7

Hi all, Im trying to remove from a HashTable by providing key and to get by proving key. And i tried as follows for removing, Caharcter ch=p.charAt(i); but gives these errors. myOwnBm.java:60: cannot find symbol symbol : method Remove(char) location: class java.util.Hashtable myHash.Remove(p.charAt(i)); ^ myOwnBm.java:77: inconvertible types found : java.lang.Object required: int int v=(int)myHash.get(c); this is my code for remove Error in line 10 [CODE] Hashtable myHash=new HashTable(); public void preprocess(String p) { for (int i=0;i<p.length();i++) { if (myHash.containsKey(p.charAt(i))) { myHash.Remove(p.charAt(i)); myHash.put(p.charAt(i),i); } else { myHash.put(p.charAt(i),i); } } } [/CODE] this is my code to get. i tried int value=(int) …

Member Avatar
Member Avatar
+0 forum 5

Hi all, I've declared a static int variable call Click=0; in the Pay.Designer.cs. then i just want to get the value of it in a button click of another form. But it says : [B]The event 'System.Windows.Forms.Control.Click' can only appear on the left hand side of += or -=[/B] It gives aline under Click [CODE] public partial class LostBookEntry : Form { private void button1_Click(object sender, EventArgs e) { Pay ppay = new Pay(int.Parse(dataGridView1.Rows[ee.RowIndex].Cells["Fine"].Value.ToString()), "Fine", textBox1.Text); ppay.Show(); int i = ppay.[B]Click;[/B] if (i==1) { Pay pppay = new Pay(int.Parse(dt.Rows[0][0].ToString()), "Lost", textBox1.Text); pppay.Show(); } }[/CODE] this is my Pay.Designer.cs [CODE] namespace …

Member Avatar
Member Avatar
+0 forum 4

Hi all, I want to show Form2 when button1 of Form1 is clicked. how would i do it. this is what i was trying to do.But it is not working But it gives me an error ; The event 'System.Windows.Forms.Control.Click' can only appear on the left hand side of += or -= [CODE] Form1 fm1=new Form1() fm1.show(); EventHandler ev=fm1.button1.Click(); if (ev!=null) { Form2 fm2=new Form2() fm2.show(); } [/CODE] PLZ... help me

Member Avatar
Member Avatar
+0 forum 3

Hi all, I have a windows apllication project. Last night i saved it. Today i opened it and started to work with it by adding new methods and etc. then i compiled and ran. But it does the previous things not the new ones. Always last night version runs. PLZZZ..help me.

Member Avatar
Member Avatar
+0 forum 2

Hi all, im trying to separate words in a string using whitespace " ". but it gives ArgumentOutOfRangeExeception : Index and length must refer to a location within the string. Parameter name: length it points to this line : if (textBox3.Text.Substring(i,c)==" ") [CODE] if (textBox3.Text != null) { ArrayList arrayKeyword = new ArrayList(); int index = 0; int c = 0; for (int i = 0; i < textBox3.Text.Length;i++ ) { c = i+1 ; if (textBox3.Text.Substring(i,c)==" ") { string word = null; word = textBox3.Text.Substring(0, i); arrayKeyword[index]=word; index = index + 1; } } string pattern = null; for …

Member Avatar
Member Avatar
+0 forum 3

Hi all, In my table i have duplicate rows. i want to get distinct rows. select distinct * from table1 does not work. select distinct col1,col2,col3,col4 from table1 does not work. both say: The text data type cannot be selected as DISTINCT because it is not comparable. select distinct(col1) col2,col3,col4 from table1 is working.But the data of col1 shows under the name of col2. The data which should come under col2 is now showing. PLZ help me to solve this

Member Avatar
Member Avatar
+0 forum 4

Hi all, I want to know how to assin a return value to a variable when calling a regex function. it always returns a bit type of value(its ok). i want that bit type of value tobe cheked whether it is '0' or '1' this is my C# code in case if u need [CODE] namespace SearchBooksLibrary { public partial class SqlRegularExpressions { public static int Like(string text, string pattern) { Match match = Regex.Match(text, pattern); if (match.Value != String.Empty) return 1; else return 0; } } } [/CODE] this is my assembly. [CODE] CREATE ASSEMBLY SqlRegularExpressions1 from 'C:\Users\BJ\Documents\Visual Studio …

Member Avatar
Member Avatar
+0 forum 2

Hi all, Im adding a column after the dataGridView is populated. Then I want to add LinkLables to that column. how to do this. PLZ help me. I've tried this.But it gives me an error. this is my buton click.its ok. [CODE] private void button1_Click(object sender, EventArgs e) { Search ser = new Search(); DataSet drr= ser.GetBookDetail(int.Parse(textBox3.Text)); DataTable myDataTable = drr.Tables["table1"]; dataGridView1.DataSource = myDataTable; DataColumn dc=new DataColumn("Author"); myDataTable.Columns.Add(dc); } [/CODE] But this is not working. [CODE] private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e) { LinkLabel link = new LinkLabel(); dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = link; } [/CODE]

Member Avatar
Member Avatar
+0 forum 2

Hi all, i want to add data manully to a dataGridView.but i get this exception. ArgumentOutOfRangeException. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index PLZ help me to solve this. this is my code. [CODE] int clicks=0; private void button4_Click(object sender, EventArgs e) { dataGridView1.Rows[clicks].Cells["Author_Number"].Value = "Author "+(clicks+1).ToString(); dataGridView1.Rows[clicks].Cells["First_name"].Value = "fname"; dataGridView1.Rows[clicks].Cells["Last_name"].Value = "lname"; clicks++; }[/CODE]

Member Avatar
Member Avatar
+0 forum 1

Hi all, I want to call a button1 click method inside a close button(which is provided by a form) click of a form. But there is no close button click event of a form. There is only From_closing event and Form_closed events.

Member Avatar
Member Avatar
+0 forum 3

Hi all, i made some modifications to my code which i wrote previoustly. But when i run it, the previous code is executing. i showed a msgbox inside button click.Next day i erased & it wrote a different code. when i click it still the msgbox is being appeared. PLZ help me solve this.

Member Avatar
Member Avatar
+0 forum 5

Hi all, I am generating comboboxes in runtime in a for loop. Then, when click ok i want to get the selectedItems. So how would i do this. PLZ help me. this is how i generate comboboxes in th page load. [CODE] NewBookEntry nbe = (NewBookEntry)Application.OpenForms["NewBookEntry"]; int lable = 0; for (int c = 0; c < int.Parse(nbe.TextBox2.Text); c++) { ComboBox ioj = new ComboBox(); ioj.Items.AddRange(new object[] { "Good", "Medium Damaged", "Highly Damaged"}); ioj.SelectedIndex = 0; tableLayoutPanel1.Controls.Add(ioj, 1, c); [/CODE]

Member Avatar
Member Avatar
+0 forum 2

Hi!, I get InvalidCastException. It says "Unable to cast object of type 'HD.MainMenu' to type 'HD.NewBookEntry'" and points to this statment "mpg=(NewBookEntry)fm" Plz help me to solve this. My code is: [CODE] FormCollection fms=Application.OpenForms; foreach(Form fm in fms) { mpg=(NewBookEntry)fm; } mpg.Dispose(); [/CODE]

Member Avatar
Member Avatar
+0 forum 2

Hi all, I want to understand the purpose of .resx file. i konw that Designer.cs is the class for the form. i read that .resx stores resources. 1. But what kind of resorces? 2. where is it used in the form? 3 when i opend it shows only "String1". Why? Plz help me.

Member Avatar
Member Avatar
+0 forum 1

Hi all, when i execute it gives me this exception. I am trying but i coudnt slove. Plz help me. InvalidOperationException ExecuteNonQuery requires an open and available Connection. The connection's current state is closed. it points to this line -> "int executed = com.ExecuteNonQuery();" this is my code: [CODE] try { DateTime dt = DateTime.Now; CN = new SqlConnection(concString); CN.Open(); String qry = "update BookMaster set Cat_code=" + int.Parse(Cat) + " Title='" + title + "' Publisher='" + Pub + "' No_Of_Pages=" + int.Parse(Page) + " No_Of_Cops=" + int.Parse(Copes) + " Date='" + dt.ToString() + "' price=" + int.Parse(Price) + …

Member Avatar
Member Avatar
+0 forum 6

Hi! my code gives me this error. "An object reference is required for the non-static field, method, or property 'HD.RegisterMember.CN'" Plz can anyone help me. This is my code(Class); [CODE] private SqlConnection CN; public static String getLastMemID() { String ID = null; try { CN = new SqlConnection("Data Source=BJ-PC\\SQLEXPRESS;Initial Catalog=DB;Integrated Security=SSPI"); CN.Open(); string sqlQuery = @"SELECT MAX(Mem_ID) FROM MemberMaster"; using (SqlCommand com = new SqlCommand(sqlQuery, CN)) { using (SqlDataReader dr = com.ExecuteReader()) { if (dr.Read()) ID=dr[0].ToString(); } } } catch (SqlException ex) { MessageBox.Show("A SqlException. You must check the Querry parameteres", "Error Message"); MessageBox.Show(ex.ToString()); } finally { CN.Close(); } // …

Member Avatar
Member Avatar
+0 forum 1

Hi! im getting this error. I dont know why. PLZ can anyone help me. this is my code [CODE] public void getLastMemID() { String concString = "Data Source=BJ-PC\\SQLEXPRESS;Initial Catalog=new;Integrated Security=SSPI"; // int ID=0; try { CN = new SqlConnection(concString); CN.Open(); SqlCommand com = new SqlCommand("SELECT MAX(ImageId) FROM ImagesStore", CN); SqlDataReader dr = com.ExecuteReader(); MessageBox.Show("after com"); if (dr.HasRows) { MessageBox.Show("after hasrows"); while (dr.Read()) { MessageBox.Show(dr["ImageId"].ToString()); } } else { MessageBox.Show("No rows"); } } catch (SqlException ex) { MessageBox.Show("A SqlException") MessageBox.Show(ex.ToString()); } finally { CN.Close(); } } [/CODE]

Member Avatar
Member Avatar
+0 forum 4

The End.