5,346 Posted Topics
Re: You can use execv also. [code=cplusplus] #include <iostream> #include <unistd.h> using namespace std; int main() { char *args[3]; args[0]="sample.txt" ; args[1]=NULL; printf("This is before execv \n"); execv("c:\\windows\\notepad.exe", args); return 0; } [/code] Read more about - [URL="http://www.opengroup.org/onlinepubs/000095399/functions/exec.html"]exec[/URL] | |
Re: [QUOTE=hardikpatel;880793]i want to create the xml file and add insert and delete the node , caN YOU SUGGES ME TO THE CODE OR LINK TO HELP ME ,[/QUOTE] DataSet class and classes from namespace, System.Xml - Dom classes are two handy ways to manipulate xml document. | |
Re: Create your color enumerator. [code=java] import java.awt.*; import java.awt.color.*; enum C { red (Color.RED),blue (Color.BLUE),green (Color.GREEN); private final Color color; //Constructor C(Color color) { this.color=color;} public static Color get(String name){ for(C a:C.values()) { if(a.toString().equals(name)) return a.color; } return null; } } class color { public static void main(String []args) { … | |
Re: Umair124, Another post with improper thread title. Here is my answer -[URL="http://ootips.org/uml-hasa.html"]http://ootips.org/uml-hasa.html[/URL] | |
Re: Dear gine_01, Did you ever notice how reputation indicator is converted green to orange? [ATTACH]11209[/ATTACH] Read rule at daniweb. 1.[URL="http://www.daniweb.com/forums/announcement118-2.html"]Homework policy[/URL] 2.[URL="http://www.daniweb.com/forums/announcement118-3.html"]How to post source code?[/URL] Read all posts of a thread carefully and then decide whether your comment is helpful or not? To umair125, My answer depends upon the … | |
Re: I think you need Speech API - [URL="http://en.wikipedia.org/wiki/Speech_Application_Programming_Interface#SAPI_5_API_family"]Speech_Application_Programming_Interface[/URL] [URL="http://blogs.msdn.com/chuckop/"]http://blogs.msdn.com/chuckop/[/URL] | |
Re: Please look at these links. [URL="http://www.daniweb.com/forums/thread676.html"]Random number generator's [/URL] [URL="http://www.daniweb.com/forums/thread1769.html"]C++ Random Numbers [/URL] | |
Re: >how i can develop a servlet that have two pages? No, you can't. Servlet is a java class. Use Java Server Pages (JSP). | |
Re: Welcome belkobot, If window has a focus then it is called active window and if it loose a focus then it is called inactive window. | |
Re: There is no such event for html button action. You have to use getParameter() method of HttpServletRequest class. sample.html [code=html] <html> ..... <body> <form method="post" action="FirstServlet"> .... <input type="submit" name="cmd" value="Update"/> <input type="submit" name="cmd" value="Delete"/> </form> </body> </html> [/code] FirstServlet.java [code=jsp] .... public class FirstServlet extends HttpServlet { protected void … | |
Re: Welcome naresh_4785, To create a date control. 1. Create .ascx page. 2. Add three DropDown controls (day,month, and year). 3. Write a public property which set or get values to/from dropdownlist controls. | |
Re: Use style attribute. [code=html] <a href="" style="text-align:center" .....>A</a> [/code] | |
Re: Use mail.host key instead of mail.smtp.host. [code=jsp] .... Properties props = new Properties(); props.setProperty("mail.host", "smtp.gmail.com"); props.setProperty("mail.smtp.port", "587"); props.setProperty("mail.smtp.auth", "true"); props.setProperty("mail.smtp.starttls.enable", "true"); Authenticator auth = new SMTPAuthenticator(login, password); Session session = Session.getInstance(props, auth); MimeMessage msg = new MimeMessage(session); msg.setText(message); msg.setSubject(subject); msg.setFrom(new InternetAddress(from)); msg.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); Transport.send(msg); ...... [/code] | |
Re: There is not jsp dialog user interface for file selection. It's a input type file html tag. If you want to get filename only in your server side (java) code then use, [code=java] File s=new File("c:\\aa\\b.txt"); System.out.println(s.getName()); [/code] Use following javascript code to get filename. [code=javascript] .... <script type="text/javascript"> function … | |
Re: C# input string not in correct format error - You are trying to convert non-numeric string value into int. Use TryParse method instead of Convert.ToIntXX. [code=c#] int no; string data="100a"; int.TryParse(data, out no); [/code] | |
Re: A very good article on - [URL="http://support.microsoft.com/default.aspx?scid=kb;en-us;180548"]How to validate user credentials on Microsoft operating systems?[/URL] | |
Re: Use FindControl method of GridView to have a reference of Label control. | |
Re: Fields must be initialized with constructor. [code=cplusplus] int main() { Employee a[3]={Employee("A",1,"A","A"),Employee("B",2,"B","B"),Employee("C",3,"C","C")}; for(int i=0;i<3;i++) { cout << "\n" << a[i].getName(); } return 0; } [/code] | |
Re: Google it. - [URL="http://www.google.co.in/search?hl=en&q=+Declare+a+pointer+to+a+function+taking+an+int+argument+and+returning+a+pointer+to+a+function+that+takes+a+char+argument+and+returns+a+float.&meta=&aq=f&oq="]http://www.google.co.in/search?hl=en&q=+Declare+a+pointer+to+a+function+taking+an+int+argument+and+returning+a+pointer+to+a+function+that+takes+a+char+argument+and+returns+a+float.&meta=&aq=f&oq=[/URL] | |
Re: Read this article - [URL="http://www.tutorialized.com/view/tutorial/Implementing-associative-arrays-in-C-C/27414"]http://www.tutorialized.com/view/tutorial/Implementing-associative-arrays-in-C-C/27414[/URL] | |
Re: CreateMonster method is an instance method. Create an instance of CreateMonster and then after you can add it to the list. [code=c#] List<Monster> monsterlist = new List<Monster>(); monsterlist.Add(new Monster()); monsterlist.Add(new Monster()); monsterlist[0].CreateMonster("Goblin", 4, 4, 4, 1); monsterlist[1].CreateMonster("Wolf", 2, 2, 2, 1); [/code] | |
Re: [code=java] class Largest//finds largest value { public void findLargest(){ Scanner input = new Scanner(System.in); int [] counter = new int [10]; int x; int largest; largest = 0; while(largest <10) //loop 10 times { System.out.print("Enter next number");//prompt for next integer .... largest++; } .... [/code] Source code must be surrounded … | |
Re: Question 1 & 2. Read this article - [URL="http://leepoint.net/notes-java/GUI-lowlevel/graphics/15who-calls-paintcomponent.html"]http://leepoint.net/notes-java/GUI-lowlevel/graphics/15who-calls-paintcomponent.html[/URL] ![]() | |
Re: Try to search or manipulate data in datasource object (DataTable) instead of ViewControls (datagridView). | |
Re: >It only works the first time I click. I have no idea why. INTERNAL is qualified with static modifier. [URL="http://www.javacamp.org/designPattern/"]Look at[/URL] | |
Re: Use typename arguments for compare. [code=cplusplus] #include <iostream> using namespace std; template <typename T,int n> class Array { private: T *p; public: Array() { p=new T[n]; } void set(int i,T v) { *(p+i)=v; } void print(){ for(int i=0;i<n;i++){ cout << "\n" << *(p+i); } } ~Array(){ delete []p; } void … | |
Re: I didn't find any problem with this code. [code=jsp] <%@ page language="java" import="java.io.*"%> <% String news=request.getParameter("news"); String cmd=request.getParameter("cmd"); if(cmd==null) cmd=""; if(cmd.equals("Submit")) { String path=application.getRealPath("news.txt"); PrintWriter pw = new PrintWriter(new FileOutputStream(path)); pw.println(news); pw.flush(); pw.close(); } %> <form method="post" action="page1.jsp"> <textarea col="40" row="5" name="news"></textarea> <input type="submit" name="cmd" value="Submit"/> </form> [/code] | |
Re: DatabaseMetaData interface. [code=java] Connection cn=.... DatabaseMetaData mdt=cn.getMetaData(); ... [/code] | |
Re: Read this article - [URL="http://www.emmet-gray.com/Articles/DataGridView.htm"]DataGridView Tips and Tricks [/URL] | |
Re: static, Same as you work with simple report. | |
Re: main() function int main() { int hoursIn, minsIn,hoursOut, minsOut; .... } Use bb code tags. Source code must be surrounded with code tags. | |
Re: Use loop to retrieve all five scores: [code=c#] StreamReader sr = new StreamReader(@"input_file_path"); int no = 0; int cnt = 0; while (sr.Peek() > 0) { no = no + Convert.ToInt32(sr.ReadLine()); cnt++; } decimal avg = (decimal)no / cnt; StreamWriter wr = new StreamWriter(@"output_file_path"); wr.Write("{0}", avg); wr.Flush(); wr.Close(); [/code] | |
Re: >we can use objects of javafx classes within java programs but when I tried it, I didn't get how to? Show us your code. Example, [code=javafx] function run() { println("Hi"); } public class Test{ } public static class Best{ } [/code] | |
Re: lolwtf , Read this article - [URL="http://en.wikipedia.org/wiki/Middleware"]http://en.wikipedia.org/wiki/Middleware[/URL] | |
Re: Use api of concern mailserver. | |
Re: Welcome, Read this [URL="http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/7968dde1-874f-4167-a11c-32f899775398"]FAQ[/URL] | |
Re: To fetch data from database and to update a database - Use DataAdapter (provider classes) and DataSet (relational) classes. | |
Re: Use [B]net [/B]command. [code] >net user [/code] | |
Re: Create a formula field with following code: [code=CrystalScript] if {TableName.Field}=0 then 'Cash' else 'Cheque' [/code] | |
Re: Read this article - [URL="http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/e31b8ce2-3934-4768-af3a-61e77da7880f/"]http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/e31b8ce2-3934-4768-af3a-61e77da7880f/[/URL] | |
Re: Change the relational expression of for loop, [code=java] for( int intCurrentLine = currentLine; intCurrentLine < lineNum + currentLine; intCurrentLine++) { lnr.readLine(); } [/code] | |
Re: Here is a link - [URL="http://www.codeproject.com/KB/GDI-plus/colormatrix.aspx"]http://www.codeproject.com/KB/GDI-plus/colormatrix.aspx[/URL] | |
Re: Its require parameterized query. [code=c#] da = new OleDbDataAdapter("select * from tabname",con); da.InsertCommand = new OledBCommand("insert into tablename values (?,?)",con); da.InsertCommand.Parameters.Add(....); ..... [/code] | |
Re: Try it, [code=cplusplus] const_cast<string &>(findlocator1->first) = "fourth"; [/code] | |
Re: Please read this [URL="http://answers.google.com/answers/threadview/id/488746.html"]FAQ[/URL] | |
Re: Good point @nmaillet. Use boolean (volatile) instance variable to control a thread. [code=c#] public class Best { volatile bool flag=true ; Thread thread; public Best() { thread=new Thread(new ThreadStart(Run)); thread.Start(); } public void Stop() { flag = false; } public void Run() { while (flag) { Console.WriteLine("{0}", DateTime.Now.ToShortTimeString()); } } … |
The End.