Member Avatar

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 pdfFileName,String myString) throws FileNotFoundException{ Document doc = new Document() ; PdfWriter docwriter = null; try{ docwriter = PdfWriter.getInstance(doc, new FileOutputStream("C:\\Users\\hp430\\Desktop\\barcodes\\"+pdfFileName)); doc.addAuthor("Saboor Siddique"); doc.addCreationDate(); doc.addProducer(); doc.addCreator("SunSoftTechnologies"); doc.addTitle("Barcode Test"); doc.setPageSize(PageSize.LETTER); doc.open(); PdfContentByte cb= docwriter.getDirectContent(); Barcode128 code128 = new Barcode128(); code128.setCode(myString.trim()); code128.setCodeType(Barcode128.CODE128); code128.setBarHeight(5f); code128.setX(0.1f); Image code128Image = code128.createImageWithBarcode(cb, null, null); code128Image.setAbsolutePosition(10, 700); code128Image.scalePercent(125); …

Member Avatar
+1 forum 2
Member Avatar

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
+0 forum 1
Member Avatar

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 banks and coins =",(l))

Member Avatar
+0 forum 2
Member Avatar

hi there i have some python coding which i need to convert to java can ne1 help me please email me back if you can help then i will show you the coding much appriciated

Member Avatar
+0 forum 10
Member Avatar

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 am trying to run a cron job which will run a loader application every n days. <#@ parameter type="System.String" name="LoadName" #> <#@ parameter type="System.String" name="LoadTime" #> <#@ parameter type="System.String" name="SchemaName" #> <# //generate header information String description = "Schedule a cron job for the Loader to run periodically. "; PLSQLHeader …

+0 forum 0
Member Avatar

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 problems that programmers typically run into in their fields, and what sorts of user stories could be useful for an entry level programmer to pursue in their development career. I have an example; Recently I rode in a cab. While in this cab we had to wait for a truant …

Member Avatar
+0 forum 3
Member Avatar

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 = 0 while n <= 10: print(math.log(n)) n = n + 1

Member Avatar
+0 forum 2
Member Avatar

Hi, Mr Dani Horrowitz, Founder Java NetBeans 'random' numbers between 1 and 100 using the U set for myself, I'm single and multiple 10 to choose a number you want to create an array. I want to get these numbers from the output via single and multiple array and random. I would appreciate if you help me. I wish you good work.

Member Avatar
+0 forum 1
Member Avatar

Hi all, I'm having some issues with the Scanner not waiting for input from the keyboard. The first method processChoice takes the userChoice and the idea is that in the switch statement there is a call to a method getUserInputForProcessing that takes the action and there scanner takes an input but it's not passing the control to the keyboard, it goes directly to the Exception because nextLine is empty, not entirely sure why. Is that because it's inside a switch statement? public void processChoice(int userChoice, BookManager bookManager) { switch(userChoice) { case 0: System.out.println("Goodbye."); System.exit(0); break; case 1: System.out.println("You chose READ"); …

Member Avatar
+0 forum 9
Member Avatar

# Class 1 # import java.awt.Canvas; import java.awt.Color; import java.awt.image.BufferStrategy; import java.awt.Graphics; import java.lang.Runnable; import java.lang.Thread; import javax.swing.JFrame; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import java.io.IOException; public class Game extends JFrame implements Runnable{ private Canvas canvas = new Canvas(); private RenderHandler renderer; private BufferedImage testImage; private Rectangle testRectangle = new Rectangle(30, 90, 100, 100); public Game() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(0,0, 1000, 800); setLocationRelativeTo(null); add(canvas); setVisible(true); canvas.createBufferStrategy(3); renderer = new RenderHandler(getWidth(), getHeight()); BufferedImage testImage = loadImage("Grass.jpg"); testRectangle.generateGraphics(12234); } private BufferedImage loadImage(String path){ try{ BufferedImage loadedImage = ImageIO.read(Game.class.getResource(path)); BufferedImage formattedImage = new BufferedImage(loadedImage.getWidth(), loadedImage.getHeight(), BufferedImage.TYPE_INT_RGB); formattedImage.getGraphics().drawImage(loadedImage, 0, 0, null); return formattedImage; } catch(IOException exception){ exception.printStackTrace(); …

Member Avatar
+0 forum 3
Member Avatar

Hi All i am having a python code i have to convert this to java i have placed the code below import boto3 import sys import re import json def get_kv_map(file_name): with open(file_name, 'rb') as file: img_test = file.read() bytes_test = bytearray(img_test) print('Image loaded', file_name) # process using image bytes client = boto3.client('textract') response = client.analyze_document(Document={'Bytes': bytes_test}, FeatureTypes=['FORMS']) # Get the text blocks blocks=response['Blocks'] # get key and value maps key_map = {} value_map = {} block_map = {} for block in blocks: block_id = block['Id'] block_map[block_id] = block if block['BlockType'] == "KEY_VALUE_SET": if 'KEY' in block['EntityTypes']: key_map[block_id] = block …

Member Avatar
+0 forum 1
Member Avatar

hi, In my android studio build gradle is failed i dont know how so then i check the log and i saw this error Error:Could not find method compile() for arguments [com.android.support:recyclerview-v7:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Please install the Android Support Repository from the Android SDK Manager. Open Android SDK Manager then i check it but android support respository is already installed version 47.0.0 i restart android studio but it shows same error how i solve this error from android studio please help me to solve this problem?

Member Avatar
+0 forum 2
Member Avatar

What are all num referring to ? class Sample { int num; void method() { num = 1; int num = num = 2; num = 3; } }

Member Avatar
+0 forum 4
Member Avatar

# Find minimum integer coefficients for a chemical reaction like # A * NaOH + B * H2SO4 -> C * Na2SO4 + D * H20 import sympy import re # match a single element and optional count, like Na2 ELEMENT_CLAUSE = re.compile("([A-Z][a-z]?)([0-9]*)") def parse_compound(compound): """ Given a chemical compound like Na2SO4, return a dict of element counts like {"Na":2, "S":1, "O":4} """ assert "(" not in compound, "This parser doesn't grok subclauses" return {el: (int(num) if num else 1) for el, num in ELEMENT_CLAUSE.findall(compound)} def main(): print("\nPlease enter left-hand list of compounds, separated by spaces:") lhs_strings = input().split() lhs_compounds …

Member Avatar
+0 forum 2
Member Avatar

Is there a way to solve for a system of multiple equations with multiple variables and variables on both sides in java Lets say im given three (or more) equations in an array list or array like so... 4A=1C 10A=2D 2B=2C+1D and im allowed to set one variable equal to 1 (lets say A) is there a java function or quick/simple aproach to get the values of each variable as whole numbers. (please help)

Member Avatar
+0 forum 3
Member Avatar

How can I minify my code in here, I am giving each 23 total imageview a eventhandler. code works, but I like to make the code shorter. I tried to use for loops to shorten the code. here is a example what I tried to do: for (int i = 0 ; i < imgArrayList.size() ; i++) { imgArrayList.get(i).setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { selectedTile = i; } }); } but it can't because, the "i" inside the handle method is final. I can't pass the "i" inside the handle method. my goal is, that a specific …

Member Avatar
+1 forum 4
Member Avatar

when i am trying to insert date into the datefield of the oracle then date value are stored in to database but each date value are same like DOB 01-JAN-70 01-JAN-70 01-JAN-70 public class practicdate { JDateChooser dateChooser,dateChooser1; practicdate(){ dateChooser = new JDateChooser(); dateChooser.setBounds(200, 200, 150, 20); getContentPane().add(dateChooser); public void actionPerformed(ActionEvent e) { java.util.Date utilDate=(java.util.Date) dateChooser.getDate(); java.sql.Date sqlDate=new java.sql.Date(utilDate.getDate()); try { java.sql.PreparedStatement ps=con.prepareStatement("insert into examdate values(?)"); ps.setDate(1,new java.sql.Date(sqlDate.getDate())); ps.executeUpdate(); ps.close(); con.close(); }

Member Avatar
+0 forum 1
Member Avatar

package de.extrema.java; import java.util.Scanner; public class Pogramm { public static void main(String arrg[]) { try (Scanner scanner = new Scanner(System.in)) { double a , b , r , A , h; int number2; int number; System.out.println("Körper: "); System.out.println("Deine Wahl: "); number = scanner.nextInt(); number2 = scanner.nextInt(); switch(number) { case 1:{ switch(number) { System.out.println("Viereck: 1 Kreis: 2 Dreieck: 3 Trapez: 4 "); case 1:{ System.out.println("a: "); a = scanner.nextDouble(); System.out.println("b(a): "); b = scanner.nextDouble(); A = a * b; System.out.println("Fläche des Vierecks= " + A); break; } case 2:{ System.out.println("r: "); r = scanner.nextDouble(); A = Math.PI * r * r; …

Member Avatar
+0 forum 5
Member Avatar

I'm writing a VERY simple clock to run on an old tablet using Android Studio - it displays the current time and day (I'm retired and regularly forget what day it is). I want to add the first calendar event for the current day to the display so it goes something like: 7.30 Tuesday 10.30 Discussion Group Like a lot of functions in Andriod, doing something really simple still means digging into all sorts additional layers of code, plug-ins, permissions and so on and I haven't been able to find a worked example of how I read the calendar (on …

Member Avatar
+0 forum 1
Member Avatar

Hi. I was wondering if anyone could help me with checking for a valid move in Othello. I was thinking about hard=coding everything but that takes too long. this is what i have so far: 1. Check which direction is valid (adjacent piece is different from piece being placed) 2. Go in that direction(s) and if: 1. hit the end, or hit a empty space return false 2. hit another piece, keep going 3. hit my own piece, stop

Member Avatar
+0 forum 9
Member Avatar

1/Write a TeachArithmeticFrame class that teaches children arithmetic. The frame uses a JLabel for a problem and a JTextField for the user answer. When the user presses the Enter key (while the JTextField object is active) or clicks the OK button, display a message stating whether the user’s answer is correct. When the Next button is clicked, display a new problem. The numbers are limited to two digits. Consider using a larger font for the JLabel and JTextField text. You can change the color of text by calling the setForeground method, for example. questionLbl.setForeground(Color.RED); 2/Extend the TeachArithmeticFrame class so that …

Member Avatar
+0 forum 1
Member Avatar

Help me this everyone.I don't know where to start.

Member Avatar
+0 forum 1
Member Avatar

# Class 1 # import java.awt.Canvas; import java.awt.Color; import java.awt.image.BufferStrategy; import java.awt.Graphics; import java.lang.Runnable; import java.lang.Thread; import javax.swing.JFrame; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import java.io.IOException; public class Game extends JFrame implements Runnable{ private Canvas canvas = new Canvas(); private RenderHandler renderer; private BufferedImage testImage; private Rectangle testRectangle = new Rectangle(30, 90, 100, 100); public Game() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(0,0, 1000, 800); setLocationRelativeTo(null); add(canvas); setVisible(true); canvas.createBufferStrategy(3); renderer = new RenderHandler(getWidth(), getHeight()); BufferedImage testImage = loadImage("Grass.jpg"); testRectangle.generateGraphics(12234); } private BufferedImage loadImage(String path){ try{ BufferedImage loadedImage = ImageIO.read(Game.class.getResource(path)); BufferedImage formattedImage = new BufferedImage(loadedImage.getWidth(), loadedImage.getHeight(), BufferedImage.TYPE_INT_RGB); formattedImage.getGraphics().drawImage(loadedImage, 0, 0, null); return formattedImage; } catch(IOException exception){ exception.printStackTrace(); …

Member Avatar
+0 forum 1
Member Avatar

.

Member Avatar
+0 forum 1
Member Avatar

I have developed a game for android mobiles ["Rise Up Air Balloon"](https://play.google.com/store/apps/details?id=com.abacus.riseup). I want to updatte it. Kindly suggest me something if it is better to update https://lh3.googleusercontent.com/rB-fPEBiaGzT_ubSzCtSfftC4pKkIm5buAS2_DhQz4_exYFCrjbcN2T1NhkmM0A3Jj0=s180-rw

Member Avatar
+2 forum 3
Member Avatar

Hello everyone, I am Bastian, i would be very grateful if anyone could help me on this one. I want to self-study about creating a Hotel Management program in Netbeans but i am afraid that i just have a basic knowledge in Java. I studied Programming but unfortunately i have to stop due to my financial issues. So i am thinking if anyone could give me some tips and tricks in order for me to create a program. I want to learn by my own but i have no idea where to start. Thank you very much.

Member Avatar
+0 forum 1
Member Avatar

It's not showing the image in the terminal window or the jframe. import java.awt.Canvas; import java.awt.Color; import java.awt.image.BufferStrategy; import java.awt.Graphics; import java.lang.Runnable; import java.lang.Thread; import javax.swing.JFrame; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import java.io.IOException; public class Game extends JFrame implements Runnable{ import java.awt.Graphics; import java.awt.image.BufferedImage; import java.awt.image.DataBufferInt; public class RenderHandler{ private BufferedImage view; private Rectangle camera; private int[] pixels; public RenderHandler(int width, int height) { //Create a BufferedImage that will represent our view. view = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); camera = new Rectangle(0, 0, width, height); camera.x = -100; camera.y = -30; //Create an array for pixels pixels = ((DataBufferInt) view.getRaster().getDataBuffer()).getData(); } …

Member Avatar
+0 forum 1
Member Avatar

I made this game equivalent to tictactoe but with a slight twist called find the X between two players using socket programming with Java. Don't know where I went wrong in trying to find the X but for some odd reason my count variable never updates allowing the victory message to never pop up. Basically the game is as follows, the dealer starts by placing the X then the spotter has to guess where it is by placing the O. Still quite new to Java and socket programming, I followed a few Java socket programming examples which is what led …

Member Avatar
+0 forum 5
Member Avatar

Hello I'm writing a program that reads in data from a file to create an array of clients and stocks. I completed my client class and stock class. I'm stuck on my driver. ![Screen_Shot_2019-12-02_at_11_53_13_PM.png](/attachments/large/4/0ceae90458b69aa4d08f7e5937ba4a6e.png) This is what I have it prints the text file but where would I include the array its part of the project? I would love any feedback.

Member Avatar
+0 forum 1
Member Avatar

I am trying to get a program to work that asks for a user input to count by that number and display 10 numbers per line. I can not get it to display 10 numbers per line. If anyone can explain to me what I am doing wrong? public static void main(String[] args) { //final int START = 5; final int STOP = 500; int NUMBER_PER_LINE = 10; Scanner val = new Scanner(System.in); System.out.println("Enter your value "); int START =val.nextInt(); for(int i = START; i <= STOP; i +=START) { System.out.print(i + " "); if(i % NUMBER_PER_LINE == 0) System.out.println(); …

Member Avatar
+0 forum 10

The End.