222 Archived Topics
Remove Filter Hey Im wondering if various users can a web services at the same time and execute the same code to generate something. Does it do it at the same time on difference threads/objects? Is it FIFO (First in, first out)? Questions like those. Thank you. | |
Hello I feel stupid for actually asking this but how do I ping a IP address in Java? I have this code [code] try { // Google.com if (InetAddress.getByAddress("173.194.35.133".getBytes()).isReachable(1000)==true) { //Boolean variable named network network=true; //Ping works } else { network=false; //Ping doesnt work } } catch (UnknownHostException e3) { … | |
Hey I have this code: This is my main part of my program: [code=Java] import org.apache.commons.pool.ObjectPool; import org.apache.commons.pool.impl.GenericObjectPool; import Fecha; public class someclass { private GenericObjectPool<Fecha> fechapool; public boolean somefunction() { System.out.println("Im going to set set actives"); fechapool.setMaxActive(5); System.out.println("set actives sets"); } { [/code] It doest get to the "set … | |
Hey I wanted to make a thread for not only myself but for others to give a "thank you" to anyone who has helped them. In my case, without some suggestions here, I would have been stuck for days on a single thing and not be able to advance further. … | |
Hey I want to "reset" a array....What would be the correct way to do it? Code A: [code] for (int i=0;i<=somearray.length;i++) { somearray[i]=0; } [/code] or Code B: [code] somearray=null; [/code] Thank you | |
Hey All of a suddent my Apache Tomcat server has broken. Very strange but I try going to [url]http://localhost:8080[/url] and I get a HTTP 400 error. How do I fix this as it is very strange that this suddenly appears. Using MyEclipse. Note, I believe I installed NetBeans which installed … | |
What is the best way to start/stop/restart Apache Tomcat using Java code? If it cant be platform dependent (or complicated or I have to do a "IF" for each), then only for Windows. Thanks | |
Hey I am having problems making a exact copy of a file. It seems that it changes the headers of the file. I tried using the Apache fileutils copyfile method but it seems to change the header completely. The rest of the file looks pretty much OK. I think it … | |
Hey I have a FTP server with this [url]ftp://192.168.100.2/folder/[/url] And I have something like anotherfolder: afolderinsidethatone: file1.bin file2.bin file.txt I want to pass all of that to the ftp server so it takes this form: [url]ftp://192.168.100.2/folder/anotherfolder/[/url] [url]ftp://192.168.100.2/folder/anotherfolder/afolderinsidethatone/[/url] [url]ftp://192.168.100.2/folder/anotherfolder/afolderinsidethatone/file1.bin[/url] [url]ftp://192.168.100.2/folder/anotherfolder/afolderinsidethatone/file2.bin[/url] [url]ftp://192.168.100.2/folder/anotherfolder/file.txt[/url] I have this code: [code] public void subidaftp(String ip, String … | |
Hey I have this code [code] FileUtils.forceDelete(new File(nombreprograma+".zip"); FileUtils.forceDelete(new File(nombreprograma+"/"+nombrebmp+".bmp")); [/code] Deleting the zip inside of the root works perfect but for some reason the BMP inside of a folder, doesnt. The error it gives is that it cannot delete the file, nothing else. Any tips? | |
Hey I want to get the date and time with miliseconds in a format such as: 2012-02-09 12:41:52.982 or 2012-02-09 16:41:52.129 How can I do this in Java? (If I can get a localized version of "Tuesday" as "Tues" as well even better but if not, I dont mind. Something … | |
Hey I want to use something like Dreamweaver to design a HTML page. (Excluding all the links to pictures and such) how do I get Java to get all that and convert it to a well designed PDF document like I was seeing in Dreamweaver? Thanks | |
Hey I have a folder in my current working path and I want to make a copy of a file inside it to the the current working path. Its kind of a dumb question, I know, but how do it do it? Thank you. | |
Hey I have this following code: [code] try { // Connection props Properties props = new Properties(); props.setProperty("mail.smtp.host", host); props.setProperty("mail.smtp.starttls.enable", "true"); props.setProperty("mail.smtp.port", "25"); props.setProperty("mail.smtp.user", usuario); props.setProperty("mail.smtp.auth", "true"); // Prepare the session Session session = Session.getDefaultInstance(props); // Constuct the message MimeMessage message = new MimeMessage(session); /*Test*/ message.setHeader("Content-Type", "multipart/mixed"); message.setFrom(new InternetAddress(CorreoOrigen)); message.addRecipient(Message.RecipientType.TO,new … | |
Hey I want to control a textbox to only allow numbers, backspace and a certain length. Ive tried with the IsNumeric function but I cant seem to get it to work. Thanks. | |
Hey I would like to do a ".bat' type of command in C#: Something automated. Im trying to run a program that is sort of shell itself so it just need to input certain words/letters into the command line box. Lets see if I can explain it better with a … | |
Hey I would like to do a ".bat' type of command in Java: Something automated. Im trying to run a program that is sort of shell itself so it just need to input certain words/letters into the command line box. Lets see if I can explain it better with a … | |
Hey Im going to use some federated tables that I need but I know that the engine does not support foreign keys. Im thinking of alternatives and this is the one so far: Tables from the remote side and related related with a foreign key on the local side. Its … | |
If I go to [url]http://localhost/somefolder/somepicture.bmp[/url] I cant see if in my navigator. Now If I go to C:/somefolder/somepicture.bmp It works perfectly. This is completely driving me crazy. I really have no other methods that I could try to get this to work. Ask questions and Ill try to give answers..... … | |
Hello Using MySQL, I have DB 1 with table T1 on Server 1 and DB 2 with table T1 on Server 2. Not on the same network and T1 contain the same columns with the same datatypes. I want to create a trigger on DB 1 so when there is … | |
Hey How do I make Apache Tomcat allow to interpret PHP as well? Allowing something like: [code] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html><head><meta http-equiv='pragma' content='no-cache' /><title>Hello</title></head><body>"); out.println("<?php echo 'Hello'; ?>"); out.println("</body></html>"); out.flush(); out.close(); } [/code] Thanks! | |
Why does IE still cache pages even if I tell it not to using "Cache-Control","no-cache" (Im doing this in a servlet so Im sending "no-cache" to "Cache-Control". In order words: Cache-Control=no-cache) "cache", "no-cache" Firefox, Chrome, Safari, my Android browser (Chrome), ALL of them dont cache the page expect IE. Why??? | |
I have this code: [code] <html><head><title></title></head><body><form id='formulario' action='index.html' method='post'><label>Ancho </label><input type='text' name='ancho' id='ancho'><br ><label>Alto </label><input type='text' name='alto' id='alto'><br ><label>Izquierda </label><input type='text' name='izquierda' id='izquierda'><br ><label>Horizontales </label><input type='text' name='horizontal' id='horizontal'<br ><label>Verticales</label><input type='text' name='vertical' id='vertical'><br ><label>Crucero </label><input type='text' name='cruzero' id='cruzero'><br ><label>Marco </label><input type='checkbox' name='marco' id='marco'><br ><label><input type='radio' name='RadioGroup1' value='1' id='piezas'>Piezas</label><br><label><input type='radio' name='RadioGroup1' value='0' … | |
(This has to be a Java question as it simply works in a txt with a HTML extension....) I have this code: [code] <html><head><title></title></head><body> <form id='formulario' action='index.html' method='post'> <label>Ancho </label><input type='text' name='ancho' id='ancho'><br > <label>Alto </label><input type='text' name='alto' id='alto'><br > <label>Izquierda </label><input type='text' name='izquierda' id='izquierda'><br > <label>Horizontales </label><input type='text' name='horizontal' … | |
Hey Putting this code: [code] System.out.println("Hello"); BufferedImage bufferedImage = new BufferedImage(620, 420, BufferedImage.TYPE_INT_RGB); System.out.println("Bye"); Graphics2D g2d = bufferedImage.createGraphics(); g2d.setColor(Color.black); g2d.fillRect(0, 0, 620,420); g2d.setColor(Color.yellow); [/code] It throws a java.lang.OutOfMemoryError: Java heap space error not displaying the bye. I dont understand as my BufferedImage is nothing at all (simple 620 by 420). … | |
Hello Im trying to generate a image from a servlet and display it with browser. Lets say I want to do something like this: [code] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { BufferedImage bufferedImage = new BufferedImage(620, 420, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bufferedImage.createGraphics(); g2d.setColor(Color.black); g2d.fillRect(0, 0, 620,420); … | |
My index.html is: [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> </head> <body> <form action="index.php" method="post" name="uandp"> <input type="text" name="user"><br > <input type="password" name="password"> <input type="submit" value="Go"> </form> </body> </html> [/code] My index.php is: [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <?php session_start(); ?> … | |
Hello The instructions for installing the Android SDK on Eclipse are different than on MyEclipse (following Google). Any step by step? Thank you | |
Hey Lets see if I can explain myself correctly...... I have 2 projects, one a program and another a library. First project is basically this, more or less (obviously it is more complicated) [code] //This is the main project //Inside com.stuct: //Global.java package com.stuct; public class Global { public static … | |
Hey I want to create a JAR library but not sure how to in MyEclipse. Im currently doing it manually using jar command but I cant seem to get it correctly The library code is: [code] public class LibAdd { public static int addtwonumbers (int a,int b) { return a+b; … | |
Hello I'm tring to declare a BinaryOut type of object in a Java web project but it doesn't seem to work. I've imported the same libraries I used in a standard Java project so I don't know what's wrong. Any tips???? | |
Hey Is it possible to run a Java Servlet that loads a .html page that has a bunch of JS scripts in it? I know how to load a normal .html page (I believe it is correct) but not sure if it works if it has Javascript as well. Thanks. | |
Hello Im trying the ini4j library but I seem to be having problems writing a Unicode file (no problems reading I believe) Is this a Java issue or ini4j? Thank you | |
Hey AFAIK, you have to pay for Mono for Android so you cant write C# applications that run on Android. Is there any alternative? | |
Hey I was wondering how I could write a binary file in Java with code in C++ using the reinterpret_cast function. If I remember the line correctly (not currently at work) it was: [CODE] file.write=reinterpret_cast<char *(&x)>,sizeof x; [/CODE] with x being a variable. How can I do that in Java? … | |
As some of you have read, Ive been working with JNI for these days. Ive found that JNA may be easier to manage and also allows some other things. I have this very simple program: The .cpp: [code] #include <stdio.h> #include "PruebasDeJNA.h" int suma(int a,int b) { return a+b; } … | |
Hey Ive been given a JavaScript program (with embedded in a HTML) with several (from what Ive seen) free libraries. For example: excanvas.js jquery-1.6.4.min.js prototype.js colorpicker.js This JavaScript program (using those and other free libraries) to draw something like this: [img]http://img339.imageshack.us/img339/3997/dibujoajyu.jpg[/img] As you see the dots, beside having a X … | |
(So continues the JNI saga....) I currently have this (in C++, this being my native code in C++): (x is a jstring passed thru the header) [code] jdouble res; if (x=="*") { res=a*b; } else if (x=="+") { res=a+b; } else if (x=="-") { res=a-b; } else if (x=="/") { … | |
Hey Im currently working on a application server written in Java but to use information from a C++ program. The company seems to agree that rewriting thousands of lines of code would be time consuming and simply making libraries of key functions of the C++ program and then passing them … | |
Hey Lets say I have 2 columns in table1 Id Value Id is obviously primary but I want Value to be unique.... I tried "NOT EXISTS" with a subquery but I cant really seem to get it to work. It would be something like [CODE]INSERT INTO table1(value) WHERE VALUES('3'); [/CODE] … | |
Hello Ive been searching around Google and while I have found some answers, Im not sure how to implant them correctly. I wish to disable the Close (X) button on a Windows Form. I read about ControlBox (I think that the property) but I perfer to do it another way. … | |
Hello I have a form with a textfield simply named 'textfield' on one page and a table with a recordset on another page. It has a dynamic field/text with this code [code] SELECT codas FROM t WHERE user = colname [/code] and colname is [code] $_POST['textfield'] [/code] I manually replace … | |
Hello I seem to have a problem with a UPDATE that just does not want to work. Im simpled it down to the most simple UPDATE possible and it simply does not want to work. Here is the simple version: [CODE]public static string CambiarDatosUsuarios(string usuario,string contr,string pregunta,string respuesta,string correo) { … | |
(I know this is the C++ section but since Im not sure where to put this...) I have a movie clip that with ActionScript I would like to do a gotoandStop on (for example) frame 3 of Layer 1 but I would like to keep playing Layer 2. How do … | |
Hey How can I send mail thru C#? It seems that it can be sent only thru Smtp (from Googling) but there has to be a way to do it thru POP3 as Windows Live Hotmail supports it and AFAIK VB.NET also supports it. If someone can give me a … | |
Hey This might sound like a dumb question but I simply dont know how to do it. Not only that but for some reason I do not know, my professor refuses to teach me how to use debugging and watch variables. He wants the "change, try, and test" method.... I … | |
Hey Im having a hard trouble drawing in a Java window so if there is a plugin that shows the coordinates in a Java window when I hover my mouse over that spot it would make my coordinate easier. | |
Hello I want to use a CustomValidator using ASP.NET/C# to make sure a textbox isnt empty (no spaces, no blanks, no nulls, etc) How do I do it? Thanks | |
Im wondering how do I correctly generate a random number in Java. Sometimes it gives me a negative, positive, very small range ,etc. Id like a simple formula that can give me some examples to control this better. Thank you very much. | |
Hey Ive been hearing about Netbeans but Id like alternatives. Any out there? If the program is not written in Java (ironic I know) I would perfer it. Thanks |
The End.