35,618 Topics
![]() | |
Hello friends, I'm trying to remove all tags from a Wikipedia entry, leaving a simple text file. I have downloaded an HTML file from Wikipedia and hunted through my program. But the tags are not removed properly. Instead, only nonsense comes out of it. Where is my thinker? Java: import … | |
I have written a formal Deadlock prevention code but I'm having trouble implementing this algorithm. Any help is appreciated. I have represented the algorithm below, **Formal algorithm description** Data structures at a process i: (It is the initial value in the parentheses.) • OUTi: set of integer, the set of … | |
i just want to write a code for simple fare calculator using conditional statements in JAVA. whose out should be: Enter the distance covered: 22.6 First 5 KM : 50 Rs. Next 15 KM @12 Rs: 180 Rs. Next 2.6 KM @14 Rs. :36.4 Rs. | |
Well, I've been learning Java and I managed to create an FTP client that uploads and downloads files from a server. Oddly, the thing I can't figure out is how to do an FTP delete. Can anyone help me on that? I don't want to use an API or someone … | |
Spring Batch exception records inserting in database Hi, I am currently working on project wherein I am reading, validating and then inserting records in database. Now, 1. While validating, if some erroneous record comes up, I have to update its status in db and continue processing next record. 2. If … | |
I am trying to use the getParent method of the File library. Here is the code I am working with, but I am getting a null string: public class MyCode { public static void main (String[] args) { File f = new File(""); String name = f.getParent(); System.out.println(name); } } … | |
I am developing a new android app, and I've run into a bit of a snag. While everything else works, I want to have it so that when you click on the screen, it exits the program, same as if you click the back button. How do I get around … | |
hello i want to create two arrays i have the index for them and the size and have the dot product of a and b and create a third array that is c[i]=a[i]*b[i] however i tried to do it but the output doesn't come the correct :( import java.util.Scanner; public … | |
Hello everybody, so I am haveing two tables (GUI is used), each has name and number colums, and I want to sum numerical columns only (which I have done) and want to use jtextfield to show user after a button is pressed, strings like "greater, less, equal to". So the … | |
Hey guys this is my first time using this site. Im having trouble creating a grading scale that averages out grades. Whenever I enter the grades in from the console I get some odd answers that make no sense. Can someone give me some pointers in the right direction? public … | |
Hello, I would like to develop a sprite editor. Therefore I have programmed a software like paint. As you can see on the picture, on the right, there is a canvas with a grid on it. I use a GridBagLayout to manage every widgets inside my window. The canvas is … | |
Hi.. Am actually trying to write my final year project on how to use Android phone as remote control for pc.. Pls can anybody put me through on what to do and how to start it because am a newbie trying to build an android app.. Thanks | |
I feel hard to understand how the LayoutManager work even the GUI is quite simple. I trying to make the button place below the Tel No JTextField, but it placed beside Address JTextField , not below TelNo JTextField. package gui; import java.awt.BorderLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import javax.swing.Box; … | |
Hello. I am new to Android Programming, and am using Android Studio to practice with. Right now, I am trying to learn how to create a new Activity and transition from it to my main Activity. So far, I have my MainActivity up and running. The code is: package com.example.cory2.thezoo3; … | |
Hi, I am a newbie to Java and I want some help with designing a simple search engine in java. The program would read from a text file and would display the results. If I searched for some keyword say "star" it should show me something like the following: Star … | |
i want to show my graph values but its show null output. i show you in image output also // JavaScript Document $(document).ready(function(){ $.ajax({ url: "data.php", method: "GET", success: function(data) { console.log(data); var playerid = []; var score = []; for(var i in data) { playerid.push("Player " + data[i].playerid); score.push(data[i].score); … | |
import java.util.ArrayList; import java.io.*; import java.util.*; import java.util.Graph; public class Graph { public int[][] adjMatrix;//Edges will be represented as adjacency Matrix int size; } public Graph(int size) { adjMat = new boolean[size][size]; for (int i=0; i < adjMat.length; i++) { for (int j=0; j < adjMat.length; j++) { adjMat[i][j] = … | |
What are Similarities and differences, written in concise form? Thanks! | |
public class Graph { boolean[][] adjMat; // In the adjacency matrix representation of a Graph, // if adjMat[i][j] == true, then you can move from // node i to node j. // i.e. j is a neighbour of i. // The constructor builds the adjacency matrix, // with initially all … | |
Gud day geeks! This is intended for my thesis! We are creating our own Computer laboratory management with network monitoring system from the computer laboratory users. I would like to know is there other references aside with the wireshark? I've been searching for a month now, the other sources does … | |
I am trying to learn Volatile keyword in Multi Threading and I came across this statement: *Volatile is preferred in cases when one thread reads and writes a shared variable and other threads just read the same. Whereas if there are more than 2 threads performing read and write both … | |
I want to store multiple checkboxe values in my sql database. I am using jsp as front end. | |
Below program in completly executing but no data was inserted through sqlloader. Inline Code Example Here public class CSVDataLoad { public void runSqlldr () throws InterruptedException { String[] stringCommand = { "bash", "-c", "/usr/bin/sqlldr username/password@sid control=/path/to/sample.ctl"}; System.out.println("SQLLDR Started"); Runtime rt = Runtime.getRuntime(); Process proc = null; try { proc = … | |
I am trying to understand the SynchronizedMap and I ran the below code. I get the below Output with an exception. According to my understanding the exception is caused when the get() methods are trying to access the syncmap when a thread is still executing a write on the map … | |
I was wondering what would be the best way to implement an algorythm to figure out what side a circle has collided with a rectangle? After check to make sure a circle has collided with the rectangle im trying to figure out how to know what side of the rectangle … | |
hi everyone I am currently practicing my java skills by doing this program called car rental management system. I am creating a login page where when the user login it should bring up a dashboard. but the problems when the user login and it say "credentials match, the dashboard doesnt … | |
Hai Sir, I am confused while creating Invoice system how to add the products item for Single invoice, and save it in MYSQL data base? Thanks and Regards, S. Hari ari | |
I bought a web site a few months ago thinking that I could go to a community tech school. I have not found the classes that I need. So I don't know how to build it. Help? | |
In the below code about the synchronisation between threads, according to the output generated why is the control being transferred to the execution of the new thread despite the lock being acquired for the same object "dt" in the main method ? public class DemoThread extends Thread { public DemoThread() … | |
I am trying to run the below concurrency code: import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class TestThread { public static void main(final String[] arguments) throws InterruptedException { ExecutorService executor = Executors.newSingleThreadExecutor(); try { executor.submit(new Task()); System.out.println("Shutdown executor"); executor.shutdown(); executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { System.err.println("tasks interrupted"); } finally … |
The End.