- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 10
- Posts with Upvotes
- 8
- Upvoting Members
- 5
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Programming
- PC Specs
- Amazing
37 Posted Topics
Re: So you're using the method `paintComponent(Graphics g)` which paints whatever is within the JPanel. And everytime it repaints, it makes new shapes, because you used a random number gen. If you want to make it so that it doesn't change, you need to somehow save what shapes were drawn which … | |
Hello, I'm trying to connect some C# code to a Microsoft TeamFoundation Server, but I can't seem to find any documentation for Visual Studio 2015 (Typical Microsoft?) But I did find something for Microsoft Visual Studio 2013. https://msdn.microsoft.com/en-us/library/bb286958 It turns out that they have broken the old way (2013 way) … | |
Re: Granted, but you are so clumsy you can't run more than 5 feet without falling I wish I could have a burrito | |
Re: **EDIT**: I don't think you would need any other code than that, I missed your dragging methods You would probably want to use this method (below) and add in some kind of setter for the Human or Dog class (whichever you want to have move) and set an x and … | |
Hi, I'm new to php, but I'm trying to implement a basic user system on my site. I'm having some trouble keeping a PHP session when I change pages (or something like that) where the logged in varible (`id`) isn't showing up as being defined, so a logged-in user doesn't … | |
Re: Try executing it from the commandline with java -jar <filename>.jar or make a .bat file like this @echo off java -jar <filename>.jar pause ::paused so that you can see errors (this is a comment) | |
| |
Hi, I've been trying to send a `BufferedImage` through a socket. I can get it to work once, but when I try to get another screenshot, it fails. The server usually gives me a `java.lang.IndexOutOfBoundsException` at `ImageIO.write(capture, "png", client.getOutputStream());` Server Code: //already told server i'm expecting an image try { … | |
Hi, i'm making a java program, and I started making the gui with a `JTextArea`, and tried to add a font (`Consolas`) and It crashes with a "divide by 0" error. It works fine on windows, and if you comment out the `setFont` line.. import javax.swing.*; import java.awt.Color; import java.awt.Font; … | |
Re: You could make a java console application that reads in the file data, and generates an html file from it. | |
Re: Well you would want to first use some fileIO to get in data ([link](http://docs.oracle.com/javase/tutorial/essential/io/)), then after getting the values of the numbers you convert the string of hex to binary with this code int hex = Integer.parseInt("0x00ff00", 16);//parses integer to base 16 (hexadecimal) String binary = Integer.toBinaryString(i); //converts hex number … | |
Re: Well on a normal linux machine, it comes with a command called `gdb` (or you may have to install it) but you just compile your code with `gcc -g -o <name> <name>.c` and then `gdb ./<name>` you will then be in the gdb console, where you can use `list <linenumber>` … | |
| |
Re: Do you have any code of what you have so far? | |
Hi, i'm trying to use an `AffineTransform` to transform a point to pixels on a 400x400 canvas. What kind of transform would you use? For example: given the points (-1, 1) --transform--> (0, 0) (pixels) (1, 1) --transform--> (400, 0) (pixels) (-1, -1) --transform--> (0, 400) (pixels) (1, -1) --transform--> … | |
Re: This link [http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html](http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html) has a tutorial on actionlisteners. and this link [http://docs.oracle.com/javase/tutorial/2d/printing/dialog.html](http://docs.oracle.com/javase/tutorial/2d/printing/dialog.html) should help with the print dialogue box. By the way, please try to use correct grammar. | |
Re: Use Random like this //up at top import java.util.Random; or java.util.*; Random rand = new Random(); int a = rand.nextInt(3); // will generate 0 - 2 | |
Re: I think that using `%n` instead of `\n` is more OS-friendly. As `\n` specifies a newline character that some operating systems don't have, whereas `%n` uses the local OS newline character | |
Re: Yea, and also try not to use Netbeans GUI Builder. I mean you can, just it makes **very** unreadable code and harder to debug. | |
I made a mini compiler to help compile C code easier on linux machines with bash #!/bin/bash function project_menu { header echo "Edit project: $1" dir echo "1) New file" echo "2) Edit file" echo "3) Compile file" echo "4) Run Project" echo "5) Compile & Run Project" echo "6) … | |
Re: > the number 5 and 8 (or whatever number in their place) will always add up What do you mean "add up"? They don't actually add, but they replace the `%5d` and `%8d` and put in spaces to fill up 5 or 8 characters test it with `System.out.printf("%05d - %08d", … | |
Re: What errors are you getting? | |
Re: Also the ip you are using ("171.76.149.182") is your **External Ip Address** that is the ip used to connect from other computers from outside your network. You would want to use your **Internal Ip Address** for connecting to conputers within your local network. To get the internal ip for windows … | |
| |
Re: Do you have a code example of what you're trying to do? | |
| |
Re: It is hard to understand what you mean, but I think I have it. when you do this: public String setName(holdingName) { name=holdingName; } you want to set a global varible to a new value. Just use `this` like so public String setName(String holdingName) { this.name = holdingName; } | |
Re: Here is something that would help http://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html | |
Re: How are you trying to remove it? | |
Re: What answers do you get exactly? Can you paste the output? In your constructor of the class that solves your equation, why do you make it solve when you create it, but then later on solve it again? public mathey(int aN, int bN, int cN) { int a = aN; … | |
Re: Didn't you allready post this? Also, are you sure that the database 'EMPLOYEE' exists? | |
Re: > by using the code below i got the following exception. What code? Double check and see if netbeans has updated the bin folder with the src folder, it might just be an issue of netbeans not copying the libraies correctly. Also, did you add the .jar libraries into the … | |
Re: I don't exactly understand what you're trying to do here. What do you mean when you say "Genetic algorithm" and what is the purpose of the method `rouletteWheelSelection2(Individual[] aPopulation)`? It is returning the population, but changed. I think you may need to provide more information or more code (It would … | |
Re: I think you're trying to use `str1 == str2` instead of `str1.equals(str2)` like if(username.equals("")) { out.print("error_01"); } else if (password.equals("")) { out.print("error_02"); } | |
Re: I think it gives it the type of edge to use in the graph. In this example it gives it the `DefaultEdge` code instance by accessing `DefaultEdge.class` which is basically a class instance | |
Re: Maybe use [sockets?](http://docs.oracle.com/javase/tutorial/networking/sockets/index.html) then have a client and a server. Ideas: * Parser class that interpets different symbols (like :D as a smiley face icon) * Different commands like: kick, ban, mute, etc. * Admin status? only admins can ban, others have to vote to kick * Different ranks, mod, … |
The End.