Java 101?

Is there a simple way to learn how to post my instructable?  I used the simple set up and want to have more (pages, fancy lines, etc.)  Is there a template I can use?  I'll bee Thanks, Gracias, Xie Xie!

Question by jenengjen   |  last reply


More Java problems!

I'm trying to make a simple program that will display a different text, depending on the day selected by the user. When I run it, I get the frame, the label, and the combobox. I don't see the textarea(source attached), but that might just be the way it is. However, the combobox is supposed to determine the textarea's text with a Switch statement. But it doesn't do anything on any of the days. I'm pretty sure it just has something to do with how I'm implementing the textarea, as the rest of it is fairly straightforward.

Topic by metrogdor22   |  last reply


Java Script Links

Ok, I need to know this, but I am sure it will help the members of the community also. Ok, the thing is, my life would be easier if I knew how to look at the coding or something to tell which answer is right on this thing. I was thinking I could somehow get the code and find which one is right by looking at it. Thank You.

Topic by King825   |  last reply


can you program on java ? Answered

I can't find javascript and I was wondering if there is a way to program on java because I have downloaded it about a thousand times

Question by jOker58   |  last reply



i am a java beginner can u help me with a couple of questions plz and if u know any websites to improve my jav?

1.      The company pays “straight time” for the first 40 hours worked by each employee and pays “time-and-a-half” for all hours worked in excess of 40 hours. You’re given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee, and should determine and display the employee's gross pay. This program should allow the user to enter the information of many employees until he/she enters -1.   Sample run: Enter the number of hours worked (-1 to end): 39 Enter hourly rate of the worker: 10 Salary is $390   Enter the number of hours worked (-1 to end): 40 Enter hourly rate of the worker: 10 Salary is $400   Enter the number of hours worked (-1 to end): 41 Enter hourly rate of the worker: 10 Salary is $415.00   Enter the number of hours worked (-1 to end): -1 2. Write a program that reads a series of integers; a positive followed by a negative then by a positive and so on. Once the user enters two successive positive or negatives numbers, the program should stop reading integers and displays the highest and lowest integers entered. (assume the first integer should be positive) Sample run: Enter a series of integers (2 successive negative or 2 successive positive to stop): 56 -896 74 -12 9 -85 319 -202 9584 -5 -96 The lowest integer is: -896 The highest integer is: 9584 3. A number n is called deficient if the sum of its proper divisors is less than n. 8 is a deficient number because the sum of divisors of 8: 1+2+4=7. Write a program that finds all the deficient numbers which are less than or equal 100, display 10 per line. Sample Run: Deficient numbers less than or equal 100: 2 3 4 5 7 8 9 10 11 13 14 15 16 17 19 21 22 23 25 26 27 29 31 32 33 34 35 37 38 39 41 43 44 45 46 47 49 50 51 52 53 55 57 58 59 61 62 63 64 65 67 68 69 71 73 74 75 76 77 79 81 82 83 85 86 87 89 91 92 93 94 95 97 98 99 4. Write a program that keeps prompting the user to enter a character different than a digit. The first digit entered by the user stops the input and the program should then display the number of punctuations characters entered (one of this list ! . , ; ?). When none is found, display a message “Characters entered without punctuation”. Sample run1: Enter any character (a digit 0-9 to stop): a B , R x u ! @ . C W 2 The list you entered contains 3 punctuations signs. Sample run2: Enter any character (a digit 0-9 to stop): r T 0 No punctuation. 5. Write a program that prompts the user to enter two digits (d1 and d2) between 1 and 9. Your program should then generate an integer (n) starting with the smallest digit between d1 and d2 and containing all digits in between till reaching the maximum among them two. Hint: if the integers d1 and d2 are 5 and 2, 2 is min and 5 is max, the integer n can be generated as follow: 2-->2 * 10 -->20 + 3 = 23-->23*10-->230+4-->234*10-->2340+5-->2345 Sample run1: Enter first digit between 1 and 9: 5 Enter second digit between 1 and 9: 2 Integer generated is 2345 Sample run2: Enter first digit: 4 Enter second digit: 9 Integer generated is 456789  

Question by gougi88   |  last reply


Best way to learn JAVA?

I already know a very small smidge(really not enough to say "know". More like I can read a Java program's source, and understand the difference between the methods, the classes, etc. and how they are used.)However, I don't know enough to write my own. I have a couple of books(Java for Dummies, and Sams Teach Yourself Java in 24 Hours), but they haven't really been much help to this point. Does anyone else know of a good book for learning Java?

Topic by metrogdor22   |  last reply



you probably can't post here at the moment but whats with the java error?? is it just me?

Java error...... I can't read posts not even this one!!

Topic by chaoscampbell   |  last reply


chatbot in sql?

Hi everyone my name is hanoo i'm eng. student i hope i am in right place to ask and Consult about my project first i want explain my idea i want make database for "GYM management system" and i want make interface by using php and html also when any  one open this side appears for user  small app. chatbot and this chatbot ask the user "hello in my side i am here to answer your q ,any Q do you have it you know about activity that is available here? than if the user say no the bot answer "ok,I'll tell you about 1>>>so on . the bots take information from the database so it work like quere . my Q is how i can link between those ? what is best language for make this kind of chatbots as you knew there is many language for build chatbots take ur acount i am engineer student and this project for 4 courses (database,Artificial Intelligence,html,php) this is my idea i hope it's clearly and still i have 2 week to present my project can any one help me and give me any project smiler this and any information or website I'm waiting for your advice and help thank you

Question by a7la nono   |  last reply


Java: install, and use an API? (SIGAR)

I downloaded the Sigar API for Java(http://support.hyperic.com/display/SIGAR/Home). I want to use it in Java, but I don't know how. After I've downloaded it, where do I put it? Is there a certain folder in my java JDK I need to put it?

Topic by metrogdor22   |  last reply


Communicating between a calendar file and Java?

Currently, I am trying to make a Java program that displays a daily school schedule based on user-defined courses and input from a calendar (an outlook/ical/google docs calendar with an event on every day corresponding to what day in the school's schedule it is) to determine what day of the school's rotating schedule it is. I have everything working except for the calendar input, which I am unsure of how to incorporate into Java. I found this: http://www.moyosoft.com/joc/, which would work, but it costs $289 for a basic version. Are there any cheaper versions of something like it, or any other ways to incorporate a calendar into Java?

Question by ALogan97 


Can you fix my Java code?

I have this. import javax.swing.JLabel; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import javax.swing.JFrame; public class WebViewer {   public static void main(String[] argv) throws Exception    {     URL url = new URL("http://www.youtube.com");     BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));     String str;     while ((str = in.readLine()) != null)     {       System.out.println(str);       JLabel textLabel = new JLabel(str); }     }   } I'm getting an error that says Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.youtube.com     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1313)     at java.net.URL.openStream(URL.java:1010)     at WebViewer.main(WebViewer.java:15) The code should be getting a url's content and printing it to the screen. I'm using youtube as a test. Can you help me?

Question by 4lifenerdfighter 


How can I have my Java program access a USB webcam?

I'm trying to develop a system that needs video input through USB. I don't know how to do this. I've seen OpenCV and Xuggler, but I don't know how to actually use them. I'd vastly prefer OpenCV. Or heck, maybe it's possible in "standard" Java. If anyone knows how to do this, that would be awesome.

Topic by 4lifenerdfighter   |  last reply


How come I can't get Java to install an old (necessary) version on my computer?

I have Windows XP on my laptop and subscribe to Pogo games. It came up with a "either you don't have java or it's not working" error message so I went and got 6u11 from Java, and that didn't work either. Their tech people told me to try and get java 6u7 on there instead because that works better with their games. I can't get my computer to open the file I downloaded for that version because it doesn't recognize the extension. Have tried to get their download manager to help and no luck. I'm furious and frustrated. Anyone who can help, please do get in touch. Thanks.

Question by jussa   |  last reply


Programming

Just looking for some good Tech Resource books that go from basics to beyond.... Any help would be greatly appreciated.

Topic by Cheshir_monkee   |  last reply


What's wrong with my Android code?

I'm trying to write a simple Android app for my own personal use that gets basic Cpu and Memory information, but I'm only getting 1 error at the end that I can't figure out. The code is attached below, so if someone could be so kind as to show me what's wrong? I get the following error: Multiple markers at this line - Syntax error on token "+", delete this token - Syntax error on token(s), misplaced construct(s) On the last line: System.out.println(cpuInfo + memInfo);

Topic by metrogdor22   |  last reply


Error message received on Newly installed Android Studio 2.3.2? See below.

I just opened an instructable tutorial on " How To: Create an Android App With Android Studio to Control LED " and with a new install of Android Studio. I ran the build (make project) but I received this error message below: Error:A problem occurred configuring project ':app'. > failed to find Build Tools revision 21.1.2 Can you help me solve this error message as I am finding very little on the internet concerning this particular error message. Thanks David Lee

Question by dmenefee 


How To: Create an Android App With Android Studio to Control LED?

In this tutorial here: https://www.instructables.com/id/Android-Bluetooth-Control-LED-Part-2/#step1 it says to "Import the followings packages:" in the DeviceList class. My question is, HOW DO YOU IMPORT these packages? Does it mean to copy and paste somewhere the two code snippets: #1 import android.widget.Button; and #2 import android.widget.ListView; into the DeviceList class, it doesn't say.  While I am new to instructables I do have some background in C#,  C++,  and other languages and I certainly am familiar with the "importing" feature in many programs but I never heard of "importing" directly into code. Can you please help me understand what it means to "import" in the tutorial. Thanks David Lee

Question by dmenefee   |  last reply


HI! could someone please tell me how to make this code run?

Import javax.swing.*; import java.awt.event.*;     public class project9AlexandruMandache extends JFrame { private JPanel panel; private JLabel messageLable; private JTextField nameTextField; private JTextField addressTextField; private JTextField dateTextField; private JTextField rentTextField; private JButton calcButton; private final int WINDOW_WIDTH=500; private final int WINDOW_HEIGHT=400; public project9AlexandruMandache(){   setTitle(" Input tenants information");   setSize(WINDOW_WIDTH, WINDOW_HEIGHT);   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);   buildPanel();   add(panel);   setVisible(true); }    private void buildPanel() {    messageLable=new JLabel("Enter name of tenant:");    nameTextField=new JTextField (25);    messageLable=new JLabel("Enter proprety address:");    addressTextField=new JTextField (25);    messageLable=new JLabel(" Enter Date:");    dateTextField=new JTextField (25);    messageLable=new JLabel(" Enter rent:");    rentTextField=new JTextField (25);    calcButton=new JButton(" Save to file ");    calcButton.addActionListener(new CalcButtonListener ());    panel=new JPanel();    panel.add(messageLable);    panel.add(nameTextField);    panel.add(addressTextField);    panel.add(dateTextField);    panel.add(dateTextField);    panel.add(calcButton);   }     private class CalcButtonListener implements ActionListener{     public void actionPerformed (ActionEvent e){         String input;                  input=nameTextField.getText();                  input=addressTextField.getText();                  input=dateTextField.getText();                  input=rentTextField.getText();     JOptionPane.showMessageDialog(null, input);    }   }      public static void main(String[]args){      new project9AlexandruMandache(); } }

Question by alexman027   |  last reply


Are there any third-party Java tools for the Blackberry?

Is/are there any third-party Java SDKs or "compilers" that can be installed on a Blackberry; so BB source can be debugged/edited directly on the Blackberry? Thanks in advance.

Question by    |  last reply


Favourite Java-based mobile applications?

Having just got a Java-enabled semi-smart phone, I would like some (free) and good apps to go with it.. It is touchscreen (with no keyboard) so that might effect your app choice.. Something cool, maybe even useful. A media player would be good.. and a fun game.

Question by JavaNut13   |  last reply


Installing Java on a Tom Tom One GPS.

Hello, many of you will be familiar with the Tom Tom One GPS. I wish to run a program on the device that is written in Processing (which, I'm given to understand compiles to Java). My question therefore, is how would one go about getting the Tom Tom to run programs that are written in Java. Thanks in advance.

Question by alexhalford   |  last reply


Simple Java-based mobile phone text editor.?

Does anyone know where I can get a simple .txt file editor for a Java enabled mobile phone? Nothing fancy, just write text and save it. If I can find one.. Instructable coming soon. Note: this is not for an iPnone or Android, just a bog-standard java mobile phone.

Question by JavaNut13   |  last reply


Program or script to change volume...? Answered

Another question that is way out of my league (woe is me).  I need (or rather want) a program, in either Java or VBs (if there's a better one like Python or something, that would be alright too) to change the volume of a Windows computer.  It would also be a good showcase of your skills to make it able to change the volume of a specific program or application.  The way I intend to use it is as if it were a function, rather than a program. So a different script will activate it (perhaps by writing it, which in Java I don't think is possible) and then set the volume and the program to change the volume of. If that can't be achieved, could it be made to read a text file (or something else) with two lines on it; the first the program, the second the volume. If the first line says something like none, It would change the volume of the whole computer. Hopefully I've given you a good enough description to make it clear exactly what to do. Thank you in advance.

Question by Prof. Pickle   |  last reply


Javascript help?

After figuring out how to use arrays and turning them into strings, I now need to do floating point operations with the variable. To first I created an array:      var = array1 = [];      var = array1value = 0; then, I add tack in numbers and operations when the right button is pressed, satisfying the corresponding if statement. if ( condition_1 = true){     array1.push(1); } if ( condition_2 = true){     array1.push(2); } if ( condition_3 = true){     array1.push(3); } //(you get the idea) if ( condition_A = true){     array1.push("+"); } if ( condition_B = true){     array1.push("-"); } if ( condition_C = true){     array1.push("*"); } if ( condition_D = true){     array1.push("/"); } (did you notice I had to add quotes to the operators? otherwise I get errors.) Anyway, then I proceed to take the data inside the array, and 'compress'  it into one string of characters. if (array1.length === 1){     array1value = array1[0].toString(); } if (array1.length === 2){     array1value = array1[0].toString() +                            array1[1].toString(); } if (array1.length === 3){     array1value = array1[0].toString() +                            array1[1].toString() +                            array1[2].toString(); } etc. you can see the pattern (also can anyone tell me how to convert all this redundant code into a nice for loop? I couldn't figure it out, so I just did the above all the way up to array.length === 13) Then finally, I make this appear as text on a output, and I can see the final value after pressing buttons and stuff, say, 534+902/21. So I would expect that if I save this in a new variable, that it will perform the math operation: except the new variable just returns the same exact thing: 534+902/21 var newVariable = array1value So I tried adding and subtracting some numbers from array1value, and the output of the newVariable is an error. I believe this is because although as text, array1value appears as 534+902/21, in actuality, it is *really*   534 + "+" + 902 + "/" +21. or maybe as "534+902/21." How do I force javascript to convert this back to 534+902/21? Also, please don't tell me to google it, or find java tutorials, I have already searched for half the day and don't want to watch 2 hour long videos on programming. 

Question by -max-   |  last reply


Importing JARs in Eclipse

I am trying to import a .jar into an Eclipse Java project for use with the import command. Once again, me and my problem-solving-skill derived self can't seem to figure out how to do it. I've done it before, but i just forgot.UPDATE:What feels like 2 seconds after posting this, I discovered I just had a Referenced Archive to the Build Path. I do really weird things sometimes.

Topic by puffyfluff   |  last reply


is it possible to program my BS microcontroler with python? what else can python do?

My computer science teacher was wanting to buy a set of robots. the boe-bot and the scribbler bot. All of us are really skilled in java. could they be programmed with that? He's more or less appointed me as his adviser to this venture, and i'd like to hear frome someone who's had some experience I'm also an arduino freak and i was wondering if python could have anything to do with that.

Question by mikemmcmeans   |  last reply


If I want to convert the number 2, 5, 7 into 257, and also do the inverse (257 to 2, 5, 7)? how do I do that in code?

If I want to convert the number 2, 5, 7 into 257, and also do the inverse (257 to 2, 5, 7)? how do I do that in code? I have considered using math to do this: 2, 5, 7;   2*100 + 5*10 + 7 = 257; but This will only work with numbers with X number of digits. I need to to work with a variable amount of numbers in an array or stored in separate variables. Also, I need to do the reverse, so how would I go about doing that? particularly in C, arduino, and Javascript.  If anyone wants to know why I need to do this, I am trying to program a simple calculator app in java, and I would find this useful with the arduino too. I am learning programming here, and this is currently the calculator app: https://www.khanacademy.org/cs/calculator/5724205359824896. It is not finished, but I got over 200 lines of code to draw out the buttons and screen, and make them interactive. I need a way to capture the presses of the buttons and store them in arrays that when an operator is pressed,  a new array is created with more numbers inside it and those numbers are joined together. 

Question by -max-   |  last reply


My Windows won't run Java or Minecraft?!?

Whenever I run Minecraft it will come up with an error message saying bad video driver and OpenGl and such. I deleted my .minecraft and got a fresh new folder without any mods and it didn't fix the problem. Also, when doing the Java check it won't run and when going on a game on Pogo it won't run and says I need to install Java. However that is only for Google Chrome but it WILL work on Internet Explorer. I have Java enabled as a plugin as well. Please help I have one more thing to say: Before this laptop was Windows Vista Home Premium. Now I upgraded it to Windows 7 Ultimate x32 bit and I did it for free from YouTube, Lol ikr. All was required was to mount the Ultimate to a virtual drive using PowerISO and to install Windows 7 and then to use a program called Windows 7 Loader by DAZ v.2.2 or something like that which would activate the key and before I activated it, it was already saying it was activated. Lol long story short, HOW CAN I FIX THIS? (Also my video driver crashes once in a while like 4 times a day in use and recovers XD). Please reply! :)

Question by knexpert1700   |  last reply


How to get open source Java implementation of a Iris detection algorithm for mobile phone?

Hello, I have to develop a software for my project work in college, that is Iris recognition system on mobile phone. So please can anyone help me to find open source Java implementation of a Iris detection algorithm!!!

Question by myanimation   |  last reply


Which cheap mobile?

Hi, I am interested in getting a 'smart' (ish) phone, wifi, java etc.. I have found two, and wondered, 1. Which one would you pick? (of the two below) 2. Why? 3. Do you know where to get any other cheap <$100 phones? http://www.dealextreme.com/details.dx/sku.31634 http://www.dealextreme.com/details.dx/sku.39625

Question by JavaNut13   |  last reply


Is there any free software for making and designing your own OS?any suggestions?

Hey, i would really like to make my own OS(everyone does), but i am finding the correct way to do so! i now how to program in java, and i think thats enough for writing the program of the operating system but still i dont know the way how to do it and the tools to use and from were to start ! if somebody knows please tell me, thanks very much.

Topic by SCRIPTmaster   |  last reply


In Java, how do you check if a command line argument is equal to a string? Answered

I'm learning the Java programming language and I have come to a rut in the road. Below is the simple "Hello Rusty" program, I want it do its usual thing, but if the argument is a certain word/number (42 in this case) it says something totally different. There are no errors while compiling the code, just when I type "java hello 42" the outcome  is "Hello 42" Instead of the expected  "You have greeted the answer to life, the universe, and everything, you deserve some cake." I am almost certain the problem is in line 2, line 5 or both.  1  class hello{ 2   public static void main (String args[]){ 3    /*Now let us say Hello*/ 4    if (args.length > 0) { 5       if (args[0] == "42") { 6      System.out.println("You have greeted the answer to life, the universe, and everything,"); 7      System.out.println("you deserve some cake."); 8     } 9     else{ 10     System.out.println("Hello " + args[0] + "!"); 11    } 12   } 13   else{ 14    System.out.println("Hello whoever you are!"); 15   } 16  } 17} Thank you in advance for the help

Question by GenAap   |  last reply


view source code of website?

I am developing a browser, i want to show source code(not html code) if user wants and also store it as txt file, help using any language is appreciated, i am using c#, but any language is fine. thank you

Question by pranay2696   |  last reply


How do I create one array or variable after another in a loop in javascript?

I am currently designing a calculator (https://www.khanacademy.org/cs/calculator/5724205359824896) and I need to create a new array every time an operator (+, - *, /, ^, etc) is pressed. I want the naming to be: var array1[]; var array2[]; var array3[]; var array4[]... etc; and more will be created as I add up the values inside. 

Question by -max-   |  last reply


Which mobile Java browser can read HTML files off my phone?

I have tried Bolt and Opera Mini, both have their own 'mini html' file types - .blt and .obml - but I want to be able to read .html files, so I can have a downloaded version of Wikipedia on my phone. So, basically, which browser can read html files off my phone?

Question by JavaNut13 


Javascript Tic Tac Toe?

Hey guys... heres my code: var gameOver = false; var numMoves = 0; var xTurn = true; var computerTurn = false; function squareClicked(square) { if(gameOver) { alert("The game is already over."); return; } var status = document.getElementById('status'); var value = square.value; if(value != 'X' && value != 'O') { if(xTurn) { numMoves++; square.value = 'X'; xTurn = false; computerTurn = true; status.innerHTML = 'O\'s turn'; makeComputerMove(); } else if(computerTurn == true) { status.innerHTML = 'X\'s turn'; xTurn = true; computerTurn = false; numMoves++; square.value = 'O'; } } else { alert('That square has already been played.'); } var winner = checkWin(); if(winner == true) { if(numMoves == 9) { status.innerHTML = 'Tie Game!'; } else { gameOver = true; } } } function makeComputerMove() { var a0 = document.getElementById("0_0"); var a1 = document.getElementById("0_1"); var a2 = document.getElementById("0_2"); var a0 = document.getElementById("1_0"); var a1 = document.getElementById("1_1"); var a2 = document.getElementById("1_2"); var a0 = document.getElementById("2_0"); var a1 = document.getElementById("2_1"); var a2 = document.getElementById("2_2"); var got = false; while(got == false) { var n = Math.floor(Math.random()*9) switch(n) { case 0: { if(a0.value == " ") { squareClicked("0_0"); got = true; } break; } case 1: { if(a1.value == " ") { squareClicked("0_1"); got = true; } break; } case 2: { if(a2.value == " ") { squareClicked("0_2"); got = true; } break; } case 3: { if(b0.value == " ") { squareClicked("1_0"); got = true; } break; } case 4: { if(b1.value == " ") { squareClicked("1_1"); got = true; } break; } case 5: { if(b2.value == " ") { squareClicked("1_2"); got = true; } break; } case 6: { if(c0.value == " ") { squareClicked("2_0"); got = true; } break; } case 7: { if(c1.value == " ") { squareClicked("2_1"); got = true; } break; } case 8: { if(c2.value == " ") { squareClicked("2_2"); got = true; } break; } } } computerTurn = false; } function newgame() { var status = document.getElementById('status'); xTurn = true; status.innerHTML = 'X\'s turn'; gameOver = false; computerTurn = false; for(var x = 0; x < 3; x++) { for(var y = 0; y < 3; y++) { document.getElementById(x + '_' + y).value = ' '; } } } function checkWin() { var status = document.getElementById('status'); var val0; var val1; var val2; // check columns for(var y = 0; y < 3; y++) { val0 = document.getElementById('0_'+y).value; val1 = document.getElementById('1_'+y).value; val2 = document.getElementById('2_'+y).value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerHTML = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerHTML = "O WINS!"; return true; } } // check rows for(var x = 0; x < 3; x++) { val0 = document.getElementById(x + '_0').value; val1 = document.getElementById(x + '_1').value; val2 = document.getElementById(x + '_2').value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerHTML = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerHTML = "O WINS!"; return true; } } // check top left to lower right diagonal val0 = document.getElementById('0_0').value; val1 = document.getElementById('1_1').value; val2 = document.getElementById('2_2').value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerHTML = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerHTML = "O WINS!"; return true; } // check lower left to top right diagonal val0 = document.getElementById('2_0').value; val1 = document.getElementById('1_1').value; val2 = document.getElementById('0_2').value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerHTML = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerHTML = "O WINS!"; return true; } // no winner yet return false; } X's turn Any ideas on how to make it work? I think it has to do with the makeComputerMove function... so... yeah. I need your ideas on how to fix this. :)

Question by sci4me   |  last reply


What is wrong with my MineCraft Mod JavaScript?

I've been working on a BattleTech minecraft mod, and I need some help with my coding. I need to make a special set of armor to actually use the 'Mechs, but when I recompiled the code, I got 36 errors. A screenshot of the code is included. I am using MCP and ModLoader for MineCraft 1.0.0 Because it is hard to read in the photo, here is the actual code: __________________________________ package net.minecraft.src; import java.util.Random; public class mod_mechsuit extends BaseMod { public static Item helmet = (New ItemArmor(5000, 1, 5, 0).setItemName("asdf")); public static Item chest = (New ItemArmor(5001, 9, 5, 2).setItemName("asdf")); public mod_mechsuit() {   body.iconIndex = ModLoader.addOveride("/gui/items.png", "medvest.png")   helmet.iconIndex = ModLoader.addOveride("/gui/items.png", "neurohelmet.png")     ModLoader.AddRecipe(new ItemStack(body, 1), new Object[]{   "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone   });   ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{   " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone   });     ModLoader.AddName(body, "MedVest")   ModLoader.AddName(helmet, "NeuroHelmet")   } } public String Version() {   return "3.14159265"; } } ____________________ EDIT: The Terminal error report is as follows: ________________________ ******-*******-MacBook-Pro:mcp50 ************$ bash recompile.sh == MCP v5.0 == > Recompiling client... javac -g -source 1.6 -target 1.6 -classpath "lib/:lib/*:jars/bin/minecraft.jar:jars/bin/jinput.jar:jars/bin/lwjgl.jar:jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft/net/minecraft/client/*.java src/minecraft/net/minecraft/src/*.java  conf/patches/*.java failed. Return code : 1 == ERRORS FOUND == src/minecraft/net/minecraft/src/mod_mechsuit.java:6: ')' expected public static Item helmet = (New ItemArmor(5000, 1, 5, 0).setItemName("asdf")); ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:6: ';' expected public static Item helmet = (New ItemArmor(5000, 1, 5, 0).setItemName("asdf")); ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:7: ')' expected public static Item chest = (New ItemArmor(5001, 9, 5, 2).setItemName("asdf")); ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:7: ';' expected public static Item chest = (New ItemArmor(5001, 9, 5, 2).setItemName("asdf")); ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:11: ';' expected body.iconIndex = ModLoader.addOveride("/gui/items.png", "medvest.png") ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:12: ';' expected helmet.iconIndex = ModLoader.addOveride("/gui/items.png", "neurohelmet.png") ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:15: '}' expected "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:15: ';' expected "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:15: ';' expected "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:15: ';' expected "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:15: not a statement "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:15: ';' expected "L L","RLR","LRL" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:16: illegal start of type }); ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: illegal start of type ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: ')' expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: ';' expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: illegal start of type ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: ';' expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:17: expected ModLoader.AddRecipe(new ItemStack(helmet, 1), new Object[]{ ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: illegal start of type " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: expected " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: ';' expected " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: illegal start of type " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: expected " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: ';' expected " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: illegal start of type " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: illegal start of type " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:18: ';' expected " R ","RLR","L L" Character.valueOf ("L"), item.leather Character.valueOf ("R"),  item.redstone ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:19: class, interface, or enum expected }); ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:21: class, interface, or enum expected ModLoader.AddName(body, "MedVest") ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:26: class, interface, or enum expected public String Version() ^ src/minecraft/net/minecraft/src/mod_mechsuit.java:29: class, interface, or enum expected } ^ 36 errors ================== > Done in 3.43 seconds > Recompiling server... !! Can not find server sources !! _________________________ What am I doing wrong? Link to official page: http://www.minecraftforum.net/topic/852900-battletech-mod/ Thanks in advance!

Question by AlternateLives   |  last reply


how do you load a Java script Variable from a webpage into a VB program?

I would like to have the Visual Basic progam to load the user logged into Habbo via the variable habboName and make the title in the title bar (HabboName - HabbOS.)           Code: document.habboLoggedIn = true; var habboName = "Habboname"; var habboId = 25724911; var facebookUser = false; var habboReqPath = ""; var habboStaticFilePath = "http://images.habbo.com/habboweb/50_e3801d20ad745cc86660598ea0c4bdf4/15/web-gallery"; var habboImagerUrl = "/habbo-imaging/"; var habboPartner = ""; var habboDefaultClientPopupUrl = "http://www.habbo.com/client"; window.name = "060fd7869028127ca5d9aa2f02167c8f4e70651d"; if (typeof HabboClient != "undefined") { HabboClient.windowName = "060fd7869028127ca5d9aa2f02167c8f4e70651d"; }  

Question by drmjj55 


Conversions

So here's the deal, I am totally stuck. I've been looking all over and can't find what i need.  my church has 3 projectors for one stage, two on the sides and one in the center, we are planning on buying a couple rgb panels and playing some video loops on them, what I need to happen is for a vga or dmi signal to go to the arduino then convert to rgb and then to dmx to control the panel's.  I have little experience in arduino programming so any help would be great.

Topic by evan.stoddard   |  last reply


How makey "wrap around" bg/banner in blogger? Answered

I'm having a bit of trouble trying to figure out how to do an awesome background/header in Blogger that rolls beyond the width of the columns and doesn't get off-center/out-of-line with the blog content when the browser is resized.  You can see the problem here:  http://dangerplants.blogspot.com/ The blog isn't done or anything.  It's just an example of what happens the browser is resized, and it bothers me a lot. I don't know if the column code needs to be adjust or the background code needs to be changed or what.  I'm not good at CSS, and I don't know JavaScript, which blogger allows. I'm attaching a rough idea of what I'd like to be able to do.  Les sigh.

Question by AngryRedhead   |  last reply


Is it possible to make a worldwide chat room?

Is it possible to make a worldwide (not local) chat room out of batch or java script? if not, is there a simple exe? Requirements: multiple people can join easy interface shows who has joined/leaft, and when they say something it says their name maybe admin permissions (ie ban, kick, or delte message?

Question by Orange Shadow   |  last reply


What are all the components one needs to download onto their laptop to begin Java programming?

I've been trying to get the basic Java program 'Hello World' to work, but I can't process it, I have a sleu of texteditors, and typed the command properly but it won't function. Can somone list everything that I need to do on my laptop, including components and steps, I have a microsoft Dell inspiron? Thanks.

Question by    |  last reply



How to Create Mobile App?

Am quite familiar with java and android platforms , however am still lacking with where to start develop the mobile application.

Question by danial32   |  last reply


Is it possible to control an Arduino with a computer? Answered

Hello, I'd like to know if it's possible to create a computer program in whatever language - like C, Java or Python - that controls an Arduino. For example, the program would have a GUI and if you clicked a button, Arduino would light up an LED. Or you would click another button and Arduino would do something with some servo motors. etc etc etc Is it possible? Thanks. :)

Question by pedrotome   |  last reply


Programing languages

Hey guys its me again, i have been hacking for a 2/3 years now but only physically as for code i only memorize certain commands like ipconfig, (otherwise i use you tube) and some other commands that are basic. Today is a new day and i have chosen to learn a computer language for the purpose of hacking and making programs and my first thought to help with this delema was Google but it didn't help so i am depending on you instructable members. What is the best program for hacking and writing programs?? please respond

Topic by HOMEPIE64   |  last reply


Biggest number ever? See for yourself! :P

Alright guys, I got bored, so I decided to make a stupid little thing that I origionally used to do with my calculator in math class. :) Actually, now I have to tell this crazy story.. :P Alright, so I used to do 1+1 a bazillion times in school to see how high i could get my calc to in 1 period of class. Then (since im a MAJOR geek) I got this AMAZING idea. I decided to hook the = button to a microcontroller with a reed relay from radio shack. So I went home, and did just that. I wish I had a picture of it. It was so cool. I let it go and go. :) Anyway, now to the stupid project I made in html/javascript. So, I made this just to "prove" that there is no "biggest number". Now, it doesnt actually find proof so it "could" be wring, but its not. :P Anyway, heres the link: http://bignumbers.co.cc/numbers.html Lol. Thats all I have 2 say. Look at the source code LOL! :P KFSDAGJK  its soooo funny. (to a geek) Anyway, thanks. Later guys! :) p.s., I am at 85,000 on mine.. :)

Topic by sci4me   |  last reply


Interfacing a parallel port and L293D motor drive( PWM)?

I have interfaced a L293D directly with the lpt port of my desktop. A java code in the cpu generates an output of either +5 or 0V. There is no other connection between the parallel port and the l293d. These voltages from the lpt are inputs directly to the motor drive, and the motor rotates when the code runs. My question is: Can you perform pulse width modulation, without using a micro controller? Is there a java code that can do this?

Question by gregarious1987   |  last reply