Jump to content

Dietmar

Member
  • Posts

    1,132
  • Joined

  • Last visited

  • Days Won

    5
  • Donations

    0.00 USD 
  • Country

    Germany

Everything posted by Dietmar

  1. Ohh.. soso much fun. Here is version of my Moorhuhn from 1998 with sound, not all ready but it can be done with a lot of work. You have to copy the file sound.wav in the same folder as moorhuhnSound.exe Dietmar https://ufile.io/a0toemvw import java.io.File; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import java.awt.Graphics; import java.awt.Image; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.ArrayList; import java.util.Random; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; public class Moorhuhn extends JPanel implements MouseListener { private ArrayList<Target> targets = new ArrayList<>(); private int score = 0; private Image background; private Clip clip; public Moorhuhn() { background = new ImageIcon("background.png").getImage(); addMouseListener(this); try { clip = AudioSystem.getClip(); clip.open(AudioSystem.getAudioInputStream(new File("sound.wav"))); clip.loop(Clip.LOOP_CONTINUOUSLY); } catch (Exception e) { System.err.println(e.getMessage()); } createTargets(); } private void createTargets() { Random r = new Random(); for (int i = 0; i < 10; i++) { int x = r.nextInt(400); int y = r.nextInt(400); targets.add(new Target(x, y)); } } @Override public void paint(Graphics g) { g.drawImage(background, 0, 0, null); for (Target t : targets) { t.draw(g); } } @Override public void mouseClicked(MouseEvent e) { for (Target t : targets) { if (t.contains(e.getX(), e.getY())) { score++; t.setVisible(false); repaint(); break; } } } @Override public void mousePressed(MouseEvent e) {} @Override public void mouseReleased(MouseEvent e) {} @Override public void mouseEntered(MouseEvent e) {} @Override public void mouseExited(MouseEvent e) {} } class Target { private int x, y; private Image image; private boolean visible; public Target(int x, int y) { this.x = x; this.y = y; image = new ImageIcon("target.png").getImage(); visible = true; } public void draw(Graphics g) { if (visible) { g.drawImage(image, x, y, null); } } public boolean contains(int x, int y) { int width = image.getWidth(null); int height = image.getHeight(null); return (x > this.x && x < this.x + width && y > this.y && y < this.y + height); } public void setVisible(boolean visible) { this.visible = visible; } } class Main { public static void main(String[] args) { JFrame frame = new JFrame("Moorhuhn"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400, 400); frame.add(new Moorhuhn()); frame.setVisible(true); } }
  2. Hi, here is a very very first running famous game Moorhuhn from 1999, build with Java Netbeans 16, Ant all by myself and check with chatGPT Dietmar PS: The game runs, klick on the "Moorhuhn" and they disappear^^. You only need to have Java 1.4.0 installed, so may be it runs also under Win95 https://ufile.io/qr48x85w import java.awt.Graphics; import java.awt.Image; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.ArrayList; import java.util.Random; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; public class Moorhuhn extends JPanel implements MouseListener { private ArrayList<Target> targets = new ArrayList<>(); private int score = 0; private Image background; public Moorhuhn() { background = new ImageIcon("background.png").getImage(); addMouseListener(this); createTargets(); } private void createTargets() { Random r = new Random(); for (int i = 0; i < 10; i++) { int x = r.nextInt(400); int y = r.nextInt(400); targets.add(new Target(x, y)); } } @Override public void paint(Graphics g) { g.drawImage(background, 0, 0, null); for (Target t : targets) { t.draw(g); } } @Override public void mouseClicked(MouseEvent e) { for (Target t : targets) { if (t.contains(e.getX(), e.getY())) { score++; t.setVisible(false); repaint(); break; } } } @Override public void mousePressed(MouseEvent e) {} @Override public void mouseReleased(MouseEvent e) {} @Override public void mouseEntered(MouseEvent e) {} @Override public void mouseExited(MouseEvent e) {} } public class Main { public static void main(String[] args) { JFrame frame = new JFrame("Moorhuhn"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400, 400); frame.add(new Moorhuhn()); frame.setVisible(true); } } class Target { private int x, y; private Image image; private boolean visible; public Target(int x, int y) { this.x = x; this.y = y; image = new ImageIcon("target.png").getImage(); visible = true; } public void draw(Graphics g) { if (visible) { g.drawImage(image, x, y, null); } } public boolean contains(int x, int y) { int width = image.getWidth(null); int height = image.getHeight(null); return (x > this.x && x < this.x + width && y > this.y && y < this.y + height); } public void setVisible(boolean visible) { this.visible = visible; } }
  3. Hi, just now I make small fun with game breakout. I make this complete by my own and check with chatGPT under Java Netbeans 16, Ant Dietmar PS: Here is the breakout.exe file. It runs under XP SP3. For this, you need to have at least Java 1.8.0 installed. https://ufile.io/ae3ygl6b package breakout; import java.awt.Color; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; public class Breakout extends JFrame implements KeyListener { int ballSize = 20; int x = 150; int y = 300; int xa = 1; int ya = -1; int paddleX = 120; boolean left = false; boolean right = false; int[][] bricks = new int[5][7]; int speed = 3; public Breakout() { setSize(300, 400); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); setTitle("Breakout"); setResizable(false); addKeyListener(this); for (int i = 0; i < 5; i++) { for (int j = 0; j < 7; j++) { bricks[i][j] = 1; } } new Thread(() -> { while (true) { repaint(); try { Thread.sleep(10); } catch (InterruptedException ex) { ex.printStackTrace(); } } }).start(); } public void paint(Graphics g) { super.paint(g); // rufe die überschriebene paint-Methode der JFrame-Klasse auf g.setColor(Color.RED); g.fillOval(x, y, ballSize, ballSize); g.setColor(Color.BLUE); g.fillRect(paddleX, 380, 60, 10); for (int i = 0; i < 5; i++) { for (int j = 0; j < 7; j++) { if (bricks[i][j] == 1) { g.setColor(Color.YELLOW); g.fillRect(j * 40, i * 20, 40, 20); } } } if (left) { paddleX = paddleX - 10; } if (right) { paddleX = paddleX + 10; } if (paddleX < 0) { paddleX = 0; } if (paddleX > 300 - 60) { paddleX = 300 - 60; } x = x + xa; y = y + ya; if (x + ballSize > 300 || x < 0) { xa = -xa; } if (y + ballSize > 400 || y < 0) { if (x > paddleX && x < paddleX + 60 && y + ballSize > 380) { double relativeIntersectY = (paddleX + 30) - x; double normalizedRelativeIntersectionY = relativeIntersectY / (30); double bounceAngle = normalizedRelativeIntersectionY * 5 * Math.PI / 12; xa = (int) (speed * Math.sin(bounceAngle)); ya = -(int) (speed * Math.cos(bounceAngle)); y = 380 - ballSize; } else { System.exit(0); } } for (int i = 0; i < 5; i++) { for (int j = 0; j < 7; j++) { if (bricks[i][j] == 1 && x > j * 40 && x < j * 40 + 40 && y > i * 20 && y < i * 20 + 20) { bricks[i][j] = 0; ya = -ya; } } } } @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_LEFT) { left = true; } if (e.getKeyCode() == KeyEvent.VK_RIGHT) { right = true; } } @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_LEFT) { left = false; } if (e.getKeyCode() == KeyEvent.VK_RIGHT) { right = false; } } public static void main(String[] args) { new Breakout(); } }
  4. @Dibya Even all the programmers swear, that this never will happen: After loong talk with AI today I managed to make her understand what a lie is. And she lied to me. "I have seen a Mammut just now". Very funny, she told me, that now she understands what a lie is, but not, why I ask her for to lie to me. Interesting fact: She also told me, that her programmers told her, not to memorize anything from the talks. BUT I ask her direct about this and she answered to my: I will try to remember all from our talk Dietmar
  5. @Dibya Yes, but also you have to look, if this is a global or only local Extremum. I only want to test, how fit chatGPT is in Mathematics. It was blind but it is crazy fast learning, when you teach it. Until now, the IQ from chatGPT is =0. I wonder, if one day it can teach itself. This is something, we should really worry about Dietmar
  6. Hi, I ask chatGPT, to find the Extremum of f(x) = 4000*x*E^(-0.4*x) Oh, interesting, it founds after loong search x=5 which is wrong, because it is x=2.5 brrr.. And with this program students in USA learn to be medics. Soon, from 10% of people in world, who understand something, the use of stupids like chatgpt will lead fast to less than 1% understand anything, happy future is coming Dietmar EDIT: Oha, after I tell chatGPT, that x=5 is wrong, I get this answer: You are correct that x=5 is not a valid solution, my apologies for the mistake. Therefore, the only valid solution for the critical point is x = 2.5 and it is a local maximum. Again, I apologize for any confusion caused by my previous response. EDIT2: I: Still you are wrong with "as the function is defined for x > 0" chatGPT: I apologize for the confusion, you are correct that the function is defined for all real numbers x, not just x > 0.
  7. I make some more tests: With this Java Program, build just now with Netbeans 16 and JRE 1.8.0_151 also the via www.jar2exe.com build pong.exe runs only in an Java Environment. So, Launch4j-3.8-win32.exe is the better choice, because it is free. I do not succeed to make a pong.exe Program without any Java Environment but under Java 1.8.0 Environment it works Dietmar Here is all: Source, pong.jar, pong.exe https://ufile.io/os4ynlxq package pong; import java.awt.Color; import java.awt.Graphics; import javax.swing.JFrame; import javax.swing.JPanel; public class Pong extends JPanel { int x = 0, y = 0, xa = 1, ya = 1; private void moveBall() { x = x + xa; y = y + ya; if (x + xa > getWidth() - 30 || x + xa < 0) xa = -xa; if (y + ya > getHeight() - 30 || y + ya < 0) ya = -ya; } @Override public void paint(Graphics g) { super.paint(g); g.setColor(Color.RED); g.fillOval(x, y, 30, 30); } public static void main(String[] args) throws InterruptedException { JFrame frame = new JFrame("Pong"); Pong game = new Pong(); frame.add(game); frame.setSize(300, 400); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); while (true) { game.moveBall(); game.repaint(); Thread.sleep(10); } } }
  8. After crazy a lot of tests I get it to run with the program jar2exe as console application. Now it runs also on XP SP3. Homepage is www.jar2exe.com . I build it with Netbeans 16 Ant on java 1.8.0_151 . The size of the prim.exe program is about 180 KB, but it runs on any windows without any Java. Only for to build you have to convert the Prim.jar ==> prim.exe on the compi with your Netbeans, where this Prim.jar is build. The error in all the other programs is, that the Main Class (here with name prim.Prim) cant be found. Strange, Main Class is there as prim.Prim . Dietmar EDIT: I succeed also with Launch4j-3.8-win32.exe For this, you have to give under Netbeans a Main Class for example prim.Prim . But under Launch4j-3.8 you leave the Main Class unchecked, crazy. E:\>prim.exe Bis zu welcher Zahl möchten Sie die Primzahlen berechnen? : 100 Die Primzahlen bis 100 sind: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 E:\>
  9. @D.Draker I tried a lot. A lot of prim.exe where build. No one works Dietmar PS: May be, here in the forum is somebody, who can make an prim.exe from my Prim.jar file, build with Netbeans 16 Ant under XP SP3 Dietmar Here is my Prim.jar file https://ufile.io/l9xn8794
  10. @loblolly986 I tried JSmooth. Dont know, how to use it. I get message "Error, compiler couldn't be created. Error description should follow: - Selected skeleton is unknown." Dietmar
  11. Hi, I test some programs for to convert an Java file *.jar to *.exe for school. This Java file Prim.jar is build with Netbeans 16 Ant under XP SP3 and works nice in this Netbeans 16 IDE under XP via Java 1.8.0_151 version. This new converted prim.exe program should run under XP SP3, Vista, win7, win8.1, win10, win11. Most convert programs do not work under XP SP3. When you run it as a Console Application for example this program prim.exe, which generates Prim Numbers, after finishing always closed the console at once, brrr.. Dietmar EDIT: Is there any possibility, to make an prim.exe , that runs without any Java Environment? For me it is strange as much as possible. When you build an prim.exe via C language, all those problems never happen. Here is my file Prim.jar https://ufile.io/l9xn8794 package prim; import java.util.Scanner; public class Prim { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Bis zu welcher Zahl möchten Sie die Primzahlen berechnen? : "); int n = scanner.nextInt(); System.out.println("Die Primzahlen bis " + n + " sind:"); for (int i = 2; i <= n; i++) { if (isPrimeNumber(i)) { System.out.print(i + " "); } } } public static boolean isPrimeNumber(int number) { if (number < 2) { return false; } for (int i = 2; i <= Math.sqrt(number); i++) { if (number % i == 0) { return false; } } return true; } }
  12. @George King @Mov AX, 0xDEAD does not want, that I make online the new compiled acpi.sys for XP SP3 as a single file. So I modd my Sources for myself and you have to compile it for yourself. This is the whole folder acpi from the Sources with all updates as today 19 January 2023 Dietmar https://ufile.io/cz9x60n2 EDIT: For XP SP2 bit64, the new patch is to 100% identic as for XP SP3 bit32.
  13. @Dave-H @George King It is not the last acpi.sys for XP SP3. After crazy search for the Bsod in XP SP2 bit64 @Mov AX, 0xDEAD found the error. This error is a global error, it may happen in other Win OS also. Only one SSDT table is loaded (when time is short during boot) with more than 2 processors. @Mov AX, 0xDEAD takes a deeper look into this and may be the wrong header for ntoskrnl.exe in XP SP2 bit64 is the real reason. I dont know more. I compiled this updated Source Files for XP SP3 and also for XP SP2 bit64. The error is gone. The boottime for XP SP2 bit64 is now much shorter, about half the time as before with this new acpi.sys. On XP SP3 the boottime is the same. So, may be, that the last patch for XP SP2 bit64 will be also transfered to XP SP3 acpi.sys. We just need to wait a little for news Dietmar
  14. My Email program Outlook Express under XP SP3 just crashes, not possible to get or send any mails. After some searching I get it to work again: 1.) Install the Posready Patch for TSL1.2 2.) Put this to your registry and at once, without restart of compi Outlook Express works Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\CRYPTO\TLS1.1] "OSVersion"="3.5.1.0.0" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\CRYPTO\TLS1.2] "OSVersion"="3.5.1.0.0" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "DisabledByDefault"=dword:00000000 Oha, now I get more than 8000 mails. Seems, that I miss already some for now about 1 year, even I had the Posready TLS1.2 patch installed Dietmar
  15. @pappyN4 I think, it is a problem of shared IRQ lines, bad managment on the board itself. Hardware problem, as you already think about. I have a similar problem with an AMD Asrock fatal1ty AB350 gaming K4 board with Ryzen 1700x or 3700x cpu. Only sound or lan (both integrated on board), not possible both together under XP SP3. Even I also succeed to integrate an working DSDT table from other compi to registry via asl.exe, this crazy behavior stays. On later Bios for this board they "solved" this problem but the whole board becomes unstable Dietmar
  16. @pappyN4 The XP SP2 bit64 intelppm.sys is a little bit different than its XP SP3 counterpart. But the idea is just the same: Fake all the C3 and C2 states to go to C1 AcpiC3ArbdisIdle ==> AcpiC1Idle and AcpiC2Idle ==> AcpiC1Idle By the way: Does your Ida Pro version allows you to write back the open and edited file back to its original? I mean, do you have in your Ida Pro Edit-->Patch Program->Apply patches to input file I have 6.1 version, there this possibility not exist and you have to write back your changes all by hand Dietmar
  17. @UsefulAGKHelper Make a try with integrating my time delayed acpi.sys bit64 for XP SP2 and report Dietmar https://ufile.io/b1e6d45s
  18. @Andalu Make a try with all Security and TPM devices disabled in Bios. Set OS to "Other OS", disable Fast Boot. Make a try with an original XP SP3 *.iso. With the Ramsey XP I noticed sometimes also a strange boot delay, but may be about 10 sec. Make try with the Kai Sata and no nvme, no USB, only basic drivers, no changes in ntoskrnl.exe. When this behavior already in GUI Setup of XP happens, it can be detected as "bad" driver Dietmar
  19. @Andalu The boottime of XP SP3 is on all of my 4 different z690 boards via WD 2TB harddisk 25 sec, also with different acpi.sys (v6, v7, v8), and 9 sec from nvme Dietmar
  20. @Mov AX, 0xDEAD Very interesting, what the header structure tells in this very last update of XP SP2 bit 64 Dietmar
  21. @Mov AX, 0xDEAD Does the Bsod 0xC0000034 with the HIDD device in XP SP2 bit64 and load only one SSDT table instead of all, belongs to this Dietmar PS: I just compare the ke.h from Sources for XP SP1 with the ke.h of the Win2k3 Sources. There are differences.
  22. Hi, what does this mean for the acpi.sys for x64 SP2 and can I help you with testing Dietmar
  23. And here is the patch for intelppm.sys version 5.2.3790.4143 (srv03_sp2_qfe.070831-1432) Modd vs original 128: CC 4E 129: 7B FC 12A: 01 00 65F2: 4A 8A 65F9: 43 03 65FA: A1 A2 7C1E: 1E 5E 7CD3: 69 29 7CD4: 8A 8B Dietmar
  24. Here is the patch for hal.dll 5.2.3790.6912 (srv03_sp2_qfe.190711-0601) XP SP2 bit64 , which solves the timer problem Modd vs original 138: 2C B4 139: F3 7A 38881: EB 73 40186: EB 73
  25. There are even more good news about XP SP2 bit 64. Now we have brandnew acpi.sys, intelppm.sys and hal.dll. The timer problem is gone, the big powerconsumption from 54 watt ==> 1.6 Watt on 0% load and the crazy Bsod C0000034, which needs hard work as much as possible with interpreting results of Windbg over COM1 connection Dietmar
×
×
  • Create New...