Direkt zum Hauptbereich

Posts

Posts mit dem Label "Java" werden angezeigt.

What's wrong with Java3D? Part I

In order to get some distance from my current smart home project, I dealt with Java3D . I wanted to find out if it was possible to develop a 3D game with it. In theory, it should be possible to make a game using a 3D API based on OpenGL, like Java3D is. However, Java3D has a not unimportant catch: its complexity. Perhaps this is also the reason why there are so many beginnings and advances on the internet by some courageous developers who received little or no feedback on their projects. Many questions remained unanswered - on stackoverflow.com . I know Java3D is old. But that is precisely why one would have to find countless answers and examples on the Internet - especially about 3D games. But that is not the case. So why? When I started to investigate whether and how it is possible to develop an FPS, I always found the same examples , but never a coherent project. The basics of three-dimensional computer graphics are difficult to understand at the beginning. In addition, Java3D c

Hacking Sonos Play 1 and Play 3

For several months I have been an enthusiastic owner of a Sonos home sound system. In addition to a brilliant sound and the operation via smartphone and WLAN, this also offers the possibility to implement a control via the SOAP protocol to implement user-defined functions. This means, that it's possible to "hack" the Sonos devices. Free APIs Available Fortunately, some non-proprietary APIs are available on the net or on GitHub: For Java on any machine and OS (by VMichalak) For python on Raspberry Pi SoCo API for Python on Raspberry Pi It has to be said, that the Python APIs not neccessarily run on Windows (at least they didn't run on my machine), but this is not to expect when they are proclaimed as a Raspberry Pi project. Dependency Nightmare Though the API of VMichalak was the one that worked for me, it has a lot of dependecies which need to be downloaded or to be downloaded an build what requires Maven. OKHTTP (okhttp-3.11.0.jar) OKIO (okio-1

Introduction to Design Patterns (1): The Lazy Getter

The Laze Getter pattern Example for Java Example for Lazarus and language hint The term "Lazy Getter" refers to the Java vocabular, where a Getter is a method, that returns a feedback value or object. And lazy means, that the effect of this Getter method is somehow delayed. Some more precise, it is delayed until one need it. But what do we need? An object, of course! So we need an instantiation of an object delayed. or maybe we don't need this object at all and this is, why we are using a Lazy Getter. To save resources, it is inevitable to not create the maybe required object at startup. But of course we need to create it, when it is needed. To reach this, the Lazy Getter method is used as a synonyme for the late created object in the source code. This method does nothing else than looking, if the object is created - if yes, then return it - or not - then create and return it. That's all. A simple basic pattern. Example for Java: // somewhere you have de