32,199 Topics

Member Avatar for
Member Avatar for Max_26

I have the following Java code snippet: Map<String, List<String>> phones = new HashMap<>(); phones.put("User1", Arrays.asList("0502324547", "0651634767")); phones.put("User2", Arrays.asList("0977634321", "0697654221")); phones.put("User3", Collections.singletonList("0970011223")); Map<String, String> map = phones .entrySet() .stream() .flatMap(e -> e.getValue().stream().map(v -> new AbstractMap.SimpleEntry<>(v, e.getKey()))) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); Using it I'm converting Map<String, List <String>> to Map<String, String> and then passing …

0
211
Member Avatar for Henry Williams

My name is Henry, and I started programming about 10 years ago. I always loved playing video games, even from a young age. That passion eventually turned into something much more. Learning programming languages is very popular at the moment. A lot of people leave their current workplaces to learn …

Member Avatar for JamesCherrill
0
301
Member Avatar for prem2

Hi, In C program Function has three parts, Function Declaration. Function Definition. Function Calling. In java i cannot able to declare a function .Is it possible to declare a function in Java. For example: [code] import java.io.*; import java.util.*; class Fun_example { // show();//Cannot able to Declare a Function ? …

Member Avatar for JamesCherrill
0
4K
Member Avatar for Nightocoder201

Hello, I am working a program that starts at a direction and goes to the destination and reverse. I have reversed the list and used a if statement for the switching the directions from R (Right) and L (Left) but it doesnt want to work properly. My question is how …

0
111
Member Avatar for Rawabi

Hello , in working on java program And i made 4 classes with main So they want me If the class if ( convener ) they want me to enter the id to dsplay the 1-allocate method 2- drop method 3-print report Dont know how to do it

0
101
Member Avatar for shantuli

hi everyone, i am very new in java. can anyone help me to solve the following problem: A school conducts a 100 mark exam for its student and grades them as follows: Grade: Grade A: Marks>75 Grade B: 75>Marks>60 Grade C: 60>Marks>50 Grade D: 50>Marks>40 Write ajava program to calculate …

Member Avatar for zunam
-5
81K
Member Avatar for Joseph_49

how would one convert this to python? var unlockedState = 1000; var lockedState = 2200; var motorPin = 14; var buttonPin = 4 var ledPin = 17 var blynkToken = 'blynk_token_here'; // *** Start code *** // var locked = true //Setup servo var Gpio = require('pigpio').Gpio, motor = new …

Member Avatar for rproffitt
0
579
Member Avatar for Ruba_3

class Node(object): def __init__(self, data): self.data = data self.nextNode = None class Queue(object): def __init__(self): self.head = None self.tail = None self.size = 0 def enqueue(self,data): self.size += 1 newNode = Node(data) if self.head is None: self.head = self.tail = newNode else: newNode.nextNode = self.head self.head = newNode def dequeue(self): …

Member Avatar for rproffitt
0
175
Member Avatar for Lilimae
Member Avatar for arian ahmadi
Member Avatar for AndreRet
0
109
Member Avatar for jeffersonalomia

Hi, Question. How does UserDetailsService catch the username that I have submitted in the custom login page which I have created? TIA :)

0
176
Member Avatar for Saboor880

I have written a code to generate bar codes and saved them to a pdf file . The code executes successfylly but the PDF file does not open saying giving an error whome picture I am uploading. Please see my code and Picture with the error. ![barcodeError.PNG](/attachments/large/4/466b7c7d36a50fd6f88d0a7f157907c8.PNG) public void createPDF(String …

Member Avatar for orichisonic
1
1K
Member Avatar for aaa801

Hi java coder here im converting a program into delphi for a project basicaly ive forgotten my whole delphi maths soo can anyone convert this into delphi [CODE](l1 & 0x2 ^ 0xffffffff) == -3;[/CODE]

Member Avatar for dausmus
0
271
Member Avatar for JluckyStrike

There is a network of tracks (list), tracks are of two types - standard (with one start and one end point) and with a fork ( one start and two end points). These points are called nodes. It is known that each track can only be connected to one other …

Member Avatar for rproffitt
0
214
Member Avatar for BrundyBoy

Hello! This is my first time trying to use Java, and I was trying to learn something with the "Scanner userInput" and ".nextInt()". After I put a bit of code on, it showed me: Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown …

Member Avatar for JamesCherrill
0
244
Member Avatar for Jonathan_41

Im just learning javascript and want to make a code for a prank on my friend. I want it that when i plug in a certain usb it will pop up a fake virus alert after a couple of seconds, and when you exit off it will pull back up …

Member Avatar for Jonathan_41
0
263
Member Avatar for ビナ

Create a Java program that will compute for the average (Final Grade) of three (3) input numbers (Prelim, Midterm, Pre-final). The input grade should ONLY accept values ranges from 70 to 100, and will display a message if the input grade/s is invalid. The program should also be capable of …

Member Avatar for Reverend Jim
1
653
Member Avatar for seb33

Hello I have a abstract class: import javax.swing.JOptionPane; public abstract class Question { static int nQuestions = 0; static int nCorrect = 0; String question; String correctAnswer; abstract String ask(); void check() { nQuestions++; String answer = ask(); if (answer.equals(correctAnswer)) { JOptionPane.showMessageDialog(null,"Correct!"); nCorrect++; } else { JOptionPane.showMessageDialog(null,"Incorrect. The correctanswer is …

Member Avatar for JamesCherrill
0
253
Member Avatar for seb33
Member Avatar for MagnusTheRed90

Does anybody know a good way to break a screen up into multiple sections for filling out lengthy multi section data? I would like something that I can break data inputs up into sections and move onto the next section when I finish filliing out a section prior, sequentially. What …

Member Avatar for rproffitt
0
275
Member Avatar for xxunknown321

I have a program that i need to convert from java to c++... i just need help doing it... heres the java: [code] /* Name: Joseph Coleman Class:CSCI 1302 Assignment: Employee + ProductionWorker Academic Honesty: The integrity of students and their written and oral work is a critical component of …

Member Avatar for jimmichaels29
0
1K
Member Avatar for Vin vin

I made a JavaFX Discord Server for people who like to talk about JavaFX stuff, or need help with certain projects, I really like to work with java, especially with people who are working with JavaFX (: Here is the discord link: https://discord.gg/yZ3Y3Fd or https://discord.gg/AzFaNU

Member Avatar for Vin vin
1
911
Member Avatar for Vin vin

How do I make a cube in javafx that have 6 different textures on each side of the cube? The only way I know how to solve this, is by making 6 imageviews and give them each a specific coordinates that make them look like a cube. Is there a …

Member Avatar for Vin vin
0
2K
Member Avatar for Daron_1

public class HashedClass{ int ticketNumber; // keyfield string purchaserName; Hashtable hashtable = new Hashtable(); insert(); fetch(); delete(); update(); } I started a pseudocode above, but I know it needs more work. Are there any resources that can help guide me to implementing my …

Member Avatar for Icetutor
0
396
Member Avatar for MagnusTheRed90

I am crafting a code generator for something, and I have encountered some things that I do not know yet. Excuse the scambled eggs in this code, but could you please tell me what a job is, and how to get it to run a stored procedure for me? I …

Member Avatar for pritaeas
0
303
Member Avatar for Rohit_43

Does anyone know a good Java machine learning library I can use for a commercial product? Weka and Rapidminer unfortunately do not allow this. I already found Apache Mahout and Java Data Mininng Package. Has anyone experience with them and provide some decision support? The task calls for clustering and …

Member Avatar for rproffitt
0
185
Member Avatar for Rohit_43

Having 4 years of experience in [Machine Learning](https://intellipaat.com/blog/tutorial/machine-learning-tutorial/) and Artificial Intelligence with the background of B.Tech in Computer Science and Robotics. Having this experience took me to another level to training professionals who are looking to skill-up their knowledge in Machine learning and AI and helps to enhance their skills.

Member Avatar for Dani
0
181
Member Avatar for Phummanat

p=int(input("Enter money: ฿ ")) n=int(input("Enter price: -฿ ")) x=p-n print("Change is ฿",(x)) print("Bank 1000 =",(x//1000),('bill/bills')) print("Bank 500 =",(x%1000//500),('bill/bills')) print("Bank 100 =",(x%1000%500//100),('bill/bills')) print("Bank 50 =",(x%1000%500%100//50),('bill/bills')) print("Bank 20 =",(x%1000%500%100%50//20),('bill/bills')) print("Coin 10 =",(x%1000%500%100%50%20//10),('coin/coins')) print("Coin 5 =",(x%1000%500%100%50%20%10//5),('coin/coins')) print("Coin 2 =",(x%1000%500%100%50%20%10%5//2),('coin/coins')) print("Coin 1 =",(x%1000%500%100%50%20%10%5%2//1),('coin/coins')) q=x//1000 w=x%1000//500 e=x%1000%500//100 r=x%1000%500%100//50 t=x%1000%500%100%50//20 y=x%1000%500%100%50%20//10 u=x%1000%500%100%50%20%10//5 i=x%1000%500%100%50%20%10%5//2 o=x%1000%500%100%50%20%10%5%2//1 l=q+w+e+r+t+y+u+i+o print("all …

Member Avatar for wwwalker
0
229
Member Avatar for MagnusTheRed90

So, I am a post grad student in the software development field, and I am not working at the moment, but I have some questions on Business Rules, User Stories, etc. So I was wondering if perhaps we could open up a discussion here on some of the common business …

Member Avatar for MagnusTheRed90
0
315
Member Avatar for abdallah mohamad

hello everybody im trying to compute the log(n) while n in the first time =10 and second time =100 , third =1000 and fourth = 10000 but an error still happenening the error is math domain error can anybody help in this code and error import math import logging n …

Member Avatar for rproffitt
0
299

The End.