5,346 Posted Topics
Re: Dear JamesKox, Your code is itself a trouble. If your stream is buffered or FileStream or ByteArrayStream then you may use available() method to return the count of unread bytes. | |
Re: It's a problem regarding to the API you are using. It's not your fault. | |
Re: Hi! Hope this code will resolve your problem. [CODE] using System.Collections; using Microsoft.Office.Interop.Excel; using System; using System.Reflection; class Sample { static void Main() { string file = @"c:\csnet\jap\ex1\sample1.xls"; Microsoft.Office.Interop.Excel.ApplicationClass ap = new ApplicationClass(); Missing m=Missing.Value; Workbook wb=ap.Workbooks.Open(file, m, m, m, m, m, m, m, m, m, m, m, m, m, … | |
Re: [QUOTE=Duki;872239]I am trying to convert an array of longs to an array of chars. There are 1081 elements in the long array. Each element is 4 digits long. Is there a function in C++ that will convert a long something I can store in the array or could someone point … | |
Re: I think the following code help you to solve your problem. [CODE] char s1[100]="1123#!3344#!948#!20"; char *p; int i=0; do { p=strtok(s1+i,"#!"); i=i+strlen(p)+2; printf("\n%s",p); }while(p!=NULL); [/CODE] [QUOTE] Note: strtok is prototyped in string.h header file. [/QUOTE] | |
Re: [QUOTE=Pramoda.M.A;871830]code is : code is : path = (char*)malloc(100); pname = (char*)malloc(100); path = "ragHu"; strcpy(pname, path); free(path); whats wrong with this?[/QUOTE] [CODE]path = (char*)malloc(100);[/CODE] statement allocates heap and assign base address to the path if allocation is success. (we assume that the allocation is succeed) [CODE]path = "ragHu";[/CODE] - … | |
Re: You may get the solution at [URL="http://www.catenary.com/howto/bmpview.html"]http://www.catenary.com/howto/bmpview.html[/URL] | |
Re: Two functions of dir.h header file namely [B]findfirst [/B] and [B]findnext [/B] are used to access the files/folders. | |
Re: Name property of Button in .aspx file is different then its code behind file. | |
Re: Once you packed XML file into JAR/WAR/EAR use ClassName.class.getResourceAsStream() Method. Here is an example: Std.xml [XML File] [CODE] <?xml version="1.0" ?> <Students> <Std ClassName="1st"> <Roll>10</Roll> <Name>Mr. Raj</Name> </Std> <Std ClassName="3rd"> <Roll>11</Roll> <Name>Mr. Rohan</Name> </Std> </Students> [/CODE] ReadStd.java [CODE] import org.w3c.dom.*; import javax.xml.parsers.*; import java.io.*; public class ReadStd { public static … | |
Re: You may use Dialog (Kind of Form - Windows) windows for the purpose of redering charts/images. | |
I have two integer numbers. I want to find which number is greater than other one without using relational operators. | |
Re: Welcome sneharaveendran, Please read [URL="http://www.daniweb.com/forums/announcement9-3.html"]http://www.daniweb.com/forums/announcement9-3.html[/URL] before to post your problem. I have re-write your code and add comments where it is required. [CODE] public class Test { public static void main(String[] args) { String line=".Raghu"; System.out.println(line); char[] h= line.toCharArray(); // char[] f=null; // it is a cause of an error … | |
![]() | Re: Server resources are precious. Opening a database connection counts you are the user and database create a new thread to serve you. A new thread is alive till user send disconnect command through Close() method. I think you got it. |
Re: Dear, Think about XML. You said that your application is sort of log system; Use JDOM API instead of Java's DOM or SAX. | |
Re: I have changed "actionPerformed" Method : [CODE]import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.*; import javax.swing.table.AbstractTableModel; import java.io.*; import java.util.*; import javax.swing.table.*; import java.awt.*; import java.awt.event.*; import javax.swing.JButton.*; import javax.swing.event.ListSelectionEvent; public class panel extends JFrame { private JTable table; private JButton button; static ArrayList<String[]> rosterList = new ArrayList<String[]>(); … | |
Re: [QUOTE=squinx22;868452]hi, Thanks for the reply, I have no idea about huffman coding. But, i'll try to explain again what I wana do. For example, in a certain webserver, there is a limit of filesize that could be uploaded one at a time and you have a file that is greater … | |
Re: Dear ice_cool, Don't paste your code like you did in this post. please use BB Code. Please read this link [URL="http://www.daniweb.com/forums/announcement9-3.html"]http://www.daniweb.com/forums/announcement9-3.html[/URL] | |
Re: Set KeyPreview=True and Handles KeyDown Event of Form [CODE] private void Form1_Load(object sender, EventArgs e) { int x=10,y=10; for (int i = 1; i <= 3; i++) { x=10; for (int j = 1; j <= 3; j++) { TextBox t1 = new TextBox(); t1.Location = new Point(x, y); t1.Size … | |
Re: [QUOTE=anandarju;867743]I need to know how to access two tables which has some reference values within the table.I need the Java Code to Fetch Both the tables values which are same and have to display it[/QUOTE] Dear, There is no code of Java to fetch data from databases. Obviously, it is … | |
Re: Use BB Code. Please read [URL="http://www.daniweb.com/forums/announcement9-3.html"]http://www.daniweb.com/forums/announcement9-3.html[/URL] | |
Re: A “web service”, is a technology that provides an interface for some functionality to make it accessible from other programs across the web. This functionality might be obtaining data from a database, performing a mathematical calculation, or enabling remote control of a device. Dear sivak, Read MSDN notes for Web-Service. … | |
Re: Use the following code : [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { string s = ""; Sample a = new Sample(); a.Refresh(); // re-paint a form do { s = Console.ReadLine(); a.MyText = s; a.Refresh(); // re-paint a … | |
Re: I think that your main thread get blocked - My suggestion is an example: [CODE] import java.awt.*; import java.io.*; import java.util.StringTokenizer; import javax.swing.*; import java.awt.event.*; public class Test extends JFrame { JButton b1=new JButton("Start"); JTextField t1=new JTextField("",20); public Test() { super("Simple Program"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().setLayout(new FlowLayout()); getContentPane().add(t1); getContentPane().add(b1); b1.addActionListener(new ActionListener() { … | |
Re: [QUOTE=grisha83;867610]Oops sorry, I am using Java. Also, im not sure where i am using it. I was just reading my textbook and the author has noted that i have to select a node after which i want to input new node.[/QUOTE] Mr. Author says that "Where you want to add … | |
Re: [QUOTE=sivak;867666]when we go for webservices in .net ..if any one using webservices can u share that code and explain me ..is there any video learning thing about webservices?thanks in advance plz help me out[/QUOTE] You should read MSDN documentation. | |
Re: A Bean is simply a Java class that follows a set of simple naming and design conventions outlined by the JavaBeans specification. Beans are not required to extend a specific base class or implement a particular interface. If a class follows these Bean conventions, and you treat it like a … | |
Re: [B]Abstract Classes[/B] Sometimes you may want to declare a class and yet not know how to define all of the methods that belong to that class. For example, you may want to declare a class called Writer and include in it a member method called Write. However, you don't know … | |
Re: Yes, you may use classes of [B]System.IO.Ports[/B] namespace to achieve desire result. | |
Re: HunterFish has no idea about Text or XML file. Thanks to Ancient Dragon; Dashing code, Indeed. | |
Re: [QUOTE=raghuprasad;867080]hi, I am able to display a single image from the database on a webpage using the following code: rs1 = st1.executeQuery("select image from pictures where id='5'"); if(rs1.next()){ int len = imgLen.length(); byte [] rb = new byte[len]; InputStream readImg = rs1.getBinaryStream(1); int index=readImg.read(rb, 0, len); System.out.println("index"+index); st1.close(); response.reset(); response.setContentType("image/jpg"); … | |
Re: Simple solution is that remove the references of old dll from your project and add reference of new dll, build it and deploye it. | |
Re: Where is object reference variable: [CODE] class Philosopher extends Thread { int i; int minThinkTime, maxThinkTime, minEatTime, maxEatTime; .... .... @Override public void run() { while(true) { think(); // diningRoom and forks are not declared !!! diningRoom.enter(); forks.take(i); eat(); forks.release(i); diningRoom.exit(); } } } [/CODE] | |
Re: I think your code calls "asdf()" method before the readFile() method. | |
Re: [QUOTE=Mitja Bonca;864174]I have created my own dataset: this.abcTableAdapter.Fill(this.dataSet1.abc); And I created DataGridViewComboBoxColumn called AllGrades: DataGridViewComboBoxColumn AllGrades = new DataGridViewComboBoxColumn(); for (int grade = 5; grade <= 10; grade++) { AllGrades.Items.Add(grade); } AllGrades.DataPropertyName = "Grade"; AllGrades.HeaderText = "Grade"; AllGrades.Width = 60; AllGrades.MaxDropDownItems = 6; AllGrades.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; dataGridView1.Columns.Add(AllGrades); In a dataGridView … | |
Re: [QUOTE=dragonspectrum;74985]I am trying to access a Clientside server file from an HTML file. Can anyone help me with how to code it? :eek: here is what I have: <form method="get" <if true then action=" :?: *****This is were I need to access Client side server ****** " else action= "file:///K:/web-content/Client … | |
Re: [QUOTE=TeCNoYoTTa;865015]hello All I want to make a chat program where people enter a room and chat together :D like IRC i intend to use C# ....but i need to use free server [not ASP server :D] soo how can i do that :D ??[/QUOTE] Which kind of application - web … | |
Re: Dear, Visit the link [URL="http://www.codeproject.com/KB/grid/PrintDataGridView.aspx"]http://www.codeproject.com/KB/grid/PrintDataGridView.aspx[/URL] | |
Re: [QUOTE=Sri_r;865106]I am a junior Developer, working on asp.net,C#. I would require some code guidence in c#. Right now i am working on server controls, as in on click of radio button, data in dropdownlist shld appear. i have done this on javascript but trying do this in c#. Can anyone … | |
Re: [QUOTE=sarita_sree;864568]Can u suggests me some powerfull but understandable java code for encrypting and decrypting password.The password should be encrypted and stored into the database and can be retrived ,decrypted[/QUOTE] Package [B]java.security [/B] has set of classes for your purpose. Especially, java.security.MessageDigest class with SHA or MD5 algorithm are used to … | |
Re: I hope you will add your sql statement. The code snippet show the sql query when you press a button. [CODE] private void button1_Click_1(object sender, EventArgs e) { if (listBox1.SelectedItems.Count == 0) { MessageBox.Show("select items"); return; } string s = ""; for (int i = 0; i < listBox1.SelectedItems.Count; i++) … | |
Re: Sure, you can do this. [CODE] private void Form1_Load(object sender, EventArgs e) { Button b1 = new Button(); b1.Size = new Size(200, 200); Button b2 = new Button(); // Adding event b2.Click += new EventHandler(test); b1.Controls.Add(b2); Controls.Add(b1); } void test(object sender, EventArgs e) { MessageBox.Show("hi"); }[/CODE] | |
Re: [QUOTE=monem;864059]Hello" I want to capture live video from web-cam to view it in a web page to access it using mobile phone and software i'm using is java jdk6,jakarta Tomcat as server and the web page is JSP. Thanks[/QUOTE] Please check this link : [URL="http://www.astahost.com/info.php/introduction-artificial-intelligence_t9807.html%5B/b%5D%5B/b%5D%5Blist=%5D%5B/video-streaming-web-browser-through-java-jsp_t9888.html"]http://www.astahost.com/info.php/introduction-artificial-intelligence_t9807.html%5B/b%5D%5B/b%5D%5Blist=%5D%5B/video-streaming-web-browser-through-java-jsp_t9888.html[/URL] | |
Re: You are attempting to access restricted resource. i.e. you haven't permission to access this resource. | |
Re: DataSet is has a solution of your problem. Consider the following code: [CODE] DataSet ds = new DataSet(); // Read XML File ds.ReadXml(@"c:\test1\WindowsApplication1\a1.xml"); // Assign Reference of Object - DataTable // DataTable dt=ds.Tables["Object"]; dataGridView1.DataSource = ds.Tables["Object"]; dataGridView2.DataSource = ds.Tables["SecondObject"];[/CODE] | |
Re: Here is your code. [CODE]import java.awt.*; import java.io.*; import java.util.StringTokenizer; import javax.swing.*; import java.awt.event.*; public class ex74 extends JFrame { JButton b1=new JButton("OK"); JTextField t1=new JTextField("",20); String output=""; public ex74() { super("Simple Program"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().setLayout(new FlowLayout()); getContentPane().add(t1); getContentPane().add(b1); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { output=""; String sent; StringTokenizer … | |
Re: I think that you are using different version of MailUserBean. | |
Re: [QUOTE=taruj83;863350]Hi, I want to create a web application that will let a user enter name in a text field and the application creates a newtab with datafields for that user to enter, it all must happen on a single page. There has to be one tab for each specific name … | |
Re: Please refere [URL="http://java.sun.com/products/jfc/tsc/articles/painting/index.html"]http://java.sun.com/products/jfc/tsc/articles/painting/index.html[/URL] | |
Re: Dear, please refere this link [URL="http://www.javalobby.org/articles/ultimate-image/"]http://www.javalobby.org/articles/ultimate-image/[/URL] |
The End.