- Upvotes Received
- 7
- Posts with Upvotes
- 7
- Upvoting Members
- 7
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
55 Posted Topics
Make a simple email client in java(this is intermeddiate), and you will have to use the javaMail API for the mail part.
Hello all, I am trying to take input from user using scanner. The problem is, when the loop starts, it skips taking input for the first iteration. Here is the code: import java.util.Scanner; public class TrigTriangles{ public static void main(String[] args){ int N; double a,b,c; double A,B,C; Scanner s = …
Hello all, I was wondering on how I would extract a number out of a String after a specified character. For example, if String s = "22+5+35" , how can I extract and store the numbers 22,5, and 35 in a ArrayList?
Do you mean how can you learn Java? There are many ways to learn Java. You could go to a class, and be taught Java, you could read books to learn Java programming, or you could watch videos online. There is one online video resource I would reccomend, http://thenewboston.org/ . …
Hello all, I am trying to find all occurences of a letter in a word. If the letter is present in the word, then I save it to a String. For example here is the text: Hello World, my name is godzab. I search the text, and if there is …
Hello all, I have a Dell Studio XPS 8100. I was playing crysis 2 eariler today, and after an hour I quit the game. I left the computer standing for 15 mintues, and then was trying to open up google chrome. The problem was my computer was freezing, so I …
Use a thread do to this, it will do multiple at a time. ex. class OpenPDFs implements Runnable{ public void run(){ //do the task you did in main in here } public void main(String[] args){ OpenPDFs open = new OpenPDFs(); // this is just an example OpenPDFs open1 = new …
Did you try to make any attempt to do it yet?
Hello, I am trying to encrypt a String using Symmetric Key Cryptography. When I try to encrypt the string, on runtime it gives me this error: input text: Hello World Exception in thread "main" javax.crypto.IllegalBlockSizeException: data not block size aligned at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source) at javax.crypto.Cipher.doFinal(DashoA13*..) at SimpleSymmetricExample.main(SimpleSymmetricExample.java:25) I know it …
Hello, I have started picking up on encrytion, and I seem to have an error when I run the program. Here is the error: Exception in thread "main" java.security.NoSuchAlgorithmException: Cannot find any provider supporting ES/ECB/PKCS5Padding at javax.crypto.Cipher.getInstance(Cipher.java:453) at GenerateKey.encrypt(GenerateKey.java:41) at GenerateKey.<init>(GenerateKey.java:24) at GenerateKey.main(GenerateKey.java:71) Here is my GenerateKey class: import java.io.IOException; …
What is the problem, is it a compile-time error, or a run time error?
I am trying make a linkedlist remove() method. It only works half way. When I try to remove a number, it removes the whole right side. For example here is the output: ` before remove: 8,7,3,5,2, after remove: 8,7,` How do I get it so only the three is removed? …
So im guessing this method is supposed to create a new Date() object through the method right?
Hello, I have tried making a merge sort method, but I am getting an `Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 .` How do I fix this error, I have tried but I can not find the error: public class MergeSort{ public static int[] merge_sort(int[] b){ if(b.length <= 1){ return b; …
I am trying to write a selection sort, but I am getting a outofbounds error. How do I fix this? public class SelectionSort{ public static void selectSort(int[] arr){ int least = 0; for(int i = 1; i < arr.length - 1; i++){ for(int j = i + 1 ; i …
If you don't mind me asking, what is the exploit?
Well here is one solution: public class IsItAnInt { public static boolean isInt(String number){ try{ int a = Integer.parseInt(number); return true; } catch(Exception evt){ return false; } } public static void main(String[] args){ System.out.println("is 12 an int? : " + isInt("12")); System.out.println("is 1234fd an int?: " + isInt("1234fd")); } } …
I am just trying to submit two input fields, username and password. I am not able to do that because my code won't submit my data to the PHP database. The code is below, also please note I am trying to use ajax: getData.php <?php $db = mysql_connect('localhost', 'wont tell', …
I am not sure how to explain this so I will give an example. If I were to have two arrayList like the one listed below: ArrayList<String> java = new ArrayList<String>(); java.add("1"); java.add("2"); java.add("2"); java.add("4"); ArrayList<String> lava = new ArrayList<String>(); lava.add("0"); lava.add("2"); lava.add("5"); lava.add("4"); how would i remove the duplicates, …
It just started today, a random Homegroup icon came to my desktop, and after a while my desktop background changed. I don't even have a homegroup setup, is this a virus?
Here use this website for jQuery tourtials: [Click Here](http://w3schools.com/jquery/default.asp). jQuery is a very easy library to learn, it will probably take you 2-3 days.
Here is my form.html <html> <head> <script type="text/javascript"> function ajax() { var aj; if(window.XMLHttpRequest) { aj = new XMLHttpRequest(); } else { aj = new ActiveXObject("Microsoft.XMLHTTP"); } aj.onreadystate = function() { if(aj.ready == 4) { document.getElementById("text").innerHTML = aj.responseText; } }; var param = document.forms["fo"]["text"].value; aj.open("GET", "try.php" , true); aj.send(); } …
As jkon said, just use a cookie or a session. So lets say this is page1.php: <?php $var1 = 55; setcookie('var1', $var1, time() * 60*60*24*7); //this cookie will expire in one week ?> then in page2.php, if you want to access $var1 then: <?php $varFromAnotherPage = $_COOKIE['var1']; //now we will …
As the title said, how would I get text from a input tag and show it dynamicly. So whenever i press a, it shows up in a p tag. How would I do this in jQuery? EDIT: Here is what I have but its not working: <html> <head> <title>update text …
As Squidge said you have a incomplete form, so end your form with a </form> tag. Also show us the test.php
Are you asking how to make a .jar more secure? So people won't decompile your code?
Just play around with the code. Make you own projects, like make your own calculator, or even make your own e-mail client(using javamail api). Practice makes perfect.
I have been programming in java for 1 year, but I would like to contribute to an open source program. The problem is its to compicated for me to join a open source program. Is there any recommendations you guys have for any open source projects I can join?
If you wanna upload the code,use [pastebin.com](http://pastebin.com/) and post the link here. You also have to hurry up becuase you don't have much time left.
I am just starting to load ajax. Whats supposed to happen is when you click on the submit button, the contents of a php file will be put in the paragraph. The problem is that it ouputs undefined. Here is the code: ajax.php <html> <head> <title>Welcome to our ajax page</title> …
<html> <head> <title>Hell WOrld</title> </head> <body> <form method = "get" action = "index.html"> <input type = "text" name = "username" /> <input type = "submit" value = "submit"> </form> <script type = "text/javascript"> document.getElementByName("username").onsubmit = alert("Hello World"); </script> </body> </html> In the code, when ever you click the submit button, …
The difference between using refrences(&var), and pointers(*var) is that using refrences is more efficent because you do not have to derefernce the object. Am I right, and if I am why use pointers then? Take this code for example: #include<iostream> //function prototype void rFunc(int &rNum); void pFunc(int *rNum); //main method …
I have been trying to setup swt in eclipse Juno, but it keeps on giving me errors. Here is the error list: Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-win32-4233 in java.library.path no swt-win32 in java.library.path Can't load library: C:\Users\DeoFamily\.swt\lib\win32\x86_64\swt-win32-4233.dll Can't load library: C:\Users\DeoFamily\.swt\lib\win32\x86_64\swt-win32.dll at …
I am new to Linux, and C++. Usually when I used Java, I could just use javac Something.java and run it using java Something. How do I compile my own c++ code without the help of an IDE? Also I am using Linux Ubuntu 12.04
Try using System.load(".dll name"); like this: static { System.loadLibrary("somedll"); }
Why can't I use inline functions with my setter method in c++. Here is the code: Main.cpp #include <iostream> #include "Employee.h" using namespace std; int main() { Employee h; h.setAge(30); h.setSalary(70000); h.setyearsOfService(5); h.printAllInfo(); return 0; } Employee.h #ifndef EMPLOYEE_H #define EMPLOYEE_H class Employee { public: inline int getAge(); int setAge(int …
The reason why your code is wrong is because: a) you say `boolean presents = fullOfBool();` , you can't do that becuase fullOfBool does not return anything. b)`public boolean fullOfBool(parameters){...}`, this method does not return anything, so just call it void. c)`if(suprises.contains(true))`, no,no,no you can't do this becuase it's not …
I have made a simple web browswer in java. The problem is it's to simple. How would I add things like HTML5 support in my web browser?
I would like to keep on checking a JTextField until the field equals ten digits. When the JTextField equals ten digits then an event will happen. I want to do this without a button. Here is what i tried to do: JTextField get = new JTextField(10); String a; public className(String …
First of all, on the if statement you say `agentType[] != null` What are you trying to do, if you are just checking the first element do this: if(agentType[0] != null) Now for the second part in the if statement. replace agentType[].length !=0 To this: agentType.length != -1 So in …
As the title said, how to send text messages from a java program?
Linux Ubuntu 12.04, it works fine for me.
For lines 63 and 64 try this: add (fieldPanel1, BorderLayout.NORTH); add (fieldPanel2, BorderLayout.SOUTH); > ieldPanel1.add (fieldPanel1, BorderLayout.NORTH); > fieldPanel1.add (fieldPanel2
I reccomend you try this website called [CodingBat](http://codingbat.com/)
Its like a main menu in a movie. ex. Scanner s = new Scanner(System.in); System.out.print("Would you like to \n 1.Eat\n 2.Poop\n 3.or sleep"); // This is the menu-driven part String input = s.nextLine(); switch(input) //you can only switch strings in JDK7 { //code goes here }
I have two differnt classes' that extend from the JFrame class. I have a button on one frame that should go to the next Frame, but how would I do that?
Here is the code first: People.cpp #include "People.h" #include "Birthday.h" #include<string> #include<iostream> using namespace std; People::People(string x, Birthday bo) : name(x), birth(bo) { } void People::People() { cout << name << "was born on" << birth.printDate(); } People.h #ifndef PEOPLE_H #define PEOPLE_H #include<string> #include "Birthday.h" class People { public: People(string …
Well to take input from the keyboard you could use java.util.Scanner and store the input to the string. Ex. Scanner s = new Scanner(System.in); //Defining the scanner object(Remember to import java.util.Scanner) System.out.println("Enter string");//asking for input String name = s.nextLine();//Taking in the input and storing it into a string
The End.