DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Coding Topics

article thumbnail
New IE10 Platform Preview: Now With More HTML5
It has often been remarked that IE is a headache for developers -- in part because Microsoft tends to prefer its own versions of web standards. With IE10, take advantage of the evolution of web standards with even more HTML5 access and features. The Retirement of Internet Explorer On the other hand, quite a few 'modern' web technologies -- including XHR -- were originally Microsoft innovations, only later adopted by..well, everyone else. Today, Microsoft has a brand new version, known as Microsoft Edge, as Internet Explorer 11 is set to be retired on June 15th, 2022, meaning there will no longer be support provided for users or developers alike. While in some fundamental ways, IE9 actually handled what it was meant to handle fairly well -- Chakra, for example, shows that IE9 uses less CPU time and RAM than Chrome, under Windows. Even today, Microsoft Edge clocks in at using around 600-800 MB of RAM compared to Google Chrome's 1.4 GB just for one browser window. Of course, in terms of support for emerging web standards, IE9 lagged well behind its competitors. IE9 may have done some things well, but it did not do as many things as other browsers do (even if it did some cool things, like pinned sites that other browsers don't). Advantages of Using IE10 While using Internet Explorer has not been in style for more than a decade, it is still used by many people from around the world, especially those who do not have access to updated software or hardware. Even if IE10 is not your preferred browser to work in, ensuring any website or software application that is programmed is compatible with Internet Explorer 10 is essential. Some of the advantages of using IE10 include: Speed: IE10 has been updated for improved performance and speed. With Internet Explorer 10, you can enjoy fast loading speeds when browsing and when developing projects of your own. User-friendly: Fortunately, the latest version of Internet Explorer is extremely user-friendly with an updated interface for easy and straightforward navigation. Tab implementation: With Internet Explorer 10, you can also use tabs easily and with minimal effort. Tab implementation helps developers to work in various areas with numerous websites open simultaneously without closing another window. Pinned sites: Use the new 'Pinned Sites' feature from Internet Explorer 10 to keep track of favorite websites or websites that are useful for resources and tools while programming. Memory usage: If you are concerned about how much memory your browser is using, IE10 is typically a safe and smaller choice compared to alternative browsers such as Google Chrome. On average, Google Chrome can use anywhere between 300 MB and 1GB of memory just while browsing online. With Internet Explorer 10, you have the ability to cut the memory usage in half in most instances. Flash add-on: There are enhanced add-ons available for Flash with Internet Explorer 10 for those who are interested in loading web pages with Flash or working with Flash during development. Development tools: If you enjoyed Internet Explorer 9's Developer Tools, you will be relieved to know that Internet Explorer 10 has kept the same F12 Developer Tools for quick and easy access. However, keep in mind that it is difficult to test a site that has been hosted on your machine with Internet Explorer 10 without a manual workaround. When using Developer Tools, Internet Explorer 10 automatically switches the pages you are working in into a compatibility mode by default, making it a bit more difficult to test pages locally without uploading them to your own web server(s). Drawbacks of IE10 Unfortunately, as with any piece of software, there are also drawbacks to using Internet Explorer 10, even for those who are truly committed to Microsoft's creations. The most notable drawbacks of using IE10 to program, develop, or browse include: Lack of Flash: With Internet Explorer 10, there is no built-in Flash player or Flash support, which can make it difficult to load websites with Flash players or with Flash animations built-in to the site itself. While Flash is not inherently supported by Internet Explorer 10, it is possible to use and access Flash-based websites and applications with an Internet Explorer 10 add-on designed for enhanced Flash performance. Lack of PDF support: Unfortunately, it is not possible to load previews or entire PDFs when using Internet Explorer, even when you are using the most updated version of the browser. There is no PDF reader with IE10 available, which can make it difficult to access a variety of documents, for work or for personal use. Outdated: Now that Internet Explorer 10 is being retired, it is considered an outdated piece of software. With little to no future updates being rolled out by Microsoft, Internet Explorer 10 will no longer provide additional features, add-ons, or plugins that may be relevant to the development or working with HTML5. IE10: Now With More HTML5 But Microsoft promised big changes for IE10, and made available a developer preview to prove it. Diving into HTML5 can provide an array of new features for developers and designers alike. This preview includes considerably expanded HTML5 support, and (most impressive to me) leverages hardware acceleration (ala Chakra) to speed up graphical technologies (e.g., SVG, CSS3 transforms) -- check out the embedded video in the full announcement. Microsoft highlighted a few specific HTML5 features, newly available in this developer preview: Cross-Origin Resource Sharing (CORS) for safe use of XMLHttpRequest across domains. File API Writer support for blobBuilder allowing manipulation of large binary objects in script in the browser. Support for JavaScript typed arrays for efficient storage and manipulation of typed data. CSS user-select property to control how end-users select elements in a Web page or application. Support for HTML5 video text captioning, including time-code, placement, and captioning file formats. Great operating system integration for various operating systems available today A Metro mode is also available for those working from touchscreen smartphones and tablet devices to browse and/or to develop Additional HTML 5 features supported by IE10 include: File reader API Forms validation Drag and drop solutions IFrame support for sandbox attributes CSS3 gradients Flexbox Improvements that have been made to the IE10 browser that are beneficial to developers include: The ability to run script (Web Workers API) in the background with frontend impact JavaScript 5 support (adds the method JSON.parse to objects) The browser's Flash player is no longer a plugin, but is a built-in element of the browser itself. The "Do Not Track" feature is automatically enabled by default, which can prevent ad trackers from harnessing web browsing data from users. The full documentation of IE10's HTML5 support is here, and the rest of the developer documentation here. While it seems like just yesterday, on October 26th, 2012, Microsoft released Internet Explorer 10, it's time for support has come to an end. It is important to keep in mind that further support will no longer be available for any versions of Microsoft's Internet Explorer following the official retirement of the browser on June 15th, 2022.
July 24, 2022
by John Esposito
· 8,995 Views · 1 Like
article thumbnail
JDev Flies on NetBeans
You can put JDev files on NetBeans for brand-new creations.
July 24, 2022
by Jesper Wijngaardt
· 9,471 Views · 1 Like
article thumbnail
CSS3 Transitions vs. jQuery Animate: Performance
Animation Brings a Whole New World to Life Where would we be without animators helping us see the world in a whole new light? It seems that we easily forget the hard work that these people do, and that is truly a tragedy. There are so many people helping us see the world for the way that it truly is, and we should be thankful and respectful of the hard work that they are doing. That is why we also have to ask ourselves if we should be using CSS3 Transitions or jQuery Animate when looking for the right program to do our animation work in. You might think that animation is just something used to create children's movies and television shows, but that isn’t quite right. It has a wide range of uses in our world today (more on this later), and we are increasingly coming to rely on it to make critical decisions about how we move forward on some of the most important decisions that we have to make to keep our world moving forward the way that we want it to. Take some time to step back and recognize all that animation has brought us, and this will help you better understand why there are a lot of people who are pushing to figure out which software programs can bring them the best animation outcomes. Rich Bradshaw has written a detailed tutorial series on CSS Transitions, Transforms, and Animation. That alone is worth reading; but in case you weren't convinced, Rich also put together a little (and maybe a little unfair) performance comparison: A head to head comparison of CSS transitions and jQuery's animate. Rather than setting a timer to run repeatedly, transitions are handled natively by the browser. In my rather unscientific testing, transitions are always quicker, running with a higher frame rate, especially with high numbers of elements. They also have the advantage that colours can be animated easily, rather than having to rely on plugins. Putting it All to the Test The best way to compare the two programs against one another is to put them through a series of simulated tests that allow each program to prove what it has going for it. Believe it or not, that is exactly what some people have done. They work with the two programs to see how they adapt and react when put under various testing conditions. By doing exactly that, the programs must prove themselves in the sense that they are forced to show that they can keep up with rapid changes and shifts in the dynamics of the work thrown at them. These tests can all be sped up by using computer simulations to run the tests instead of putting actual work done by a human being through the testing period. You will find that there is a lot to be gained by going through all of this and figuring out just how much each system can potentially get through. You don't want to use something that is sub-par compared to the other programs on offer out there, and that is why we are all so grateful that there are people who are willing to work with both programs to test them and see what the ultimate outcome really is for each. Unsurprising Results You should not be shocked to learn that CSS3 Transitions is the better program to use. It has a more seamless transition from image to image, and the speed with which it can process all of that data is truly amazing as well. The fact that there are multiple programs available for us to choose from is a great thing, but there is really no competition between CSS3 Transitions and jQuery Animate. The CSS3 Transitions program has been around for a lot longer, and it has the ability to get results from its users much more easily. The results probably won't surprise you, and the conclusion is inevitable ('use CSS3 for animation when you can') but Rich's analysis (scroll down), using the Timeline view in the Webkit Inspector, is pretty neat: (Actually, the Timeline is pretty neat, period. I didn't know about it until now..sweet.) So check out Rich's test and performance discussion, and maybe use Webkit Inspector's Timeline for performance fine-tuning in the future. Animation Into the Future The tools that are used in the world of animation are going to continue to be called upon to help creators do the challenging work that they do. The demand for animated films and television series has not ceased, but the usefulness of animation goes far beyond being entertained. There are uses for animation in simulations of all kinds. Even the military uses animation to simulate certain battlefield conditions and other concerns that they know are relevant to their operations. It is something that has helped them sort out how they can best move forward with their plan of action whenever the need arises. Put another way, the military uses animation to make sure they are never caught off guard. Courtrooms are seeing an increasing amount of animation used in presentations put on both by prosecutors and defense counsel alike. They make reenactments of various aspects of an alleged crime using animation to help a jury see how they claim that things happened from their point of view. There are a lot of reasons why this helps juries to understand their point of view more completely. CSS3 technology is helping to make the use of animation more widespread and available to a larger number of people across all walks of life. It appears likely that this trend will continue, and there are many people who are counting on using CSS3 technology for several projects that they have in the works at this time. We should all celebrate the fact that such technology is making animation more accessible. Using the Best Programs Doesn’t Have to Be Costly One more thing to keep in mind when you look for the best programs for animation purposes is this: They don’t have to be costly. Many programs are free and/or open-source. Even the ones that you have to pay for aren’t necessarily wildly expensive. They provide a huge ROI when you put them to use, and that alone should get you to understand why they are so important to use. Make sure you consider this and consider the options that are before you when it comes to selecting an animation program that will do the work you need it to do. The last thing in the world that you want to have to happen is to produce lower-quality animation just because you insisted on trying to save a few dollars by going with a less expensive animation program.
July 24, 2022
by John Esposito
· 24,192 Views · 1 Like
article thumbnail
NetBeans Platform Control Application for Testing of Cellular Networks
I'm Stefano Chiappa and I'm from Milan (Italy). I work at Prisma Engineering (http://www.prisma-eng.com/) as Lead Software Engineer of the Simulator User Interface Team. AirMosaic is an application on the NetBeans Platform for controling Prisma's UeSIM, which is a multi mobile simulator. The UeSIM is basically a server with some antennas able to connect to a base station and simulate a population of mobiles doing some basic or complex Test Procedures. These procedures can be "real-world" applications such as HTTP, FTP, Mail, VOIP calls or protocol-dependent procedures such as attachment/detachment to the Core Network. Several mobile technologies are supported: LTE/UMTS/GSM. The images below are taken from LTE version. Why VoIP calls are more popular than ever The AirMosaic technology that is used within the Netbeans system is something that is generating a lot of buzz and helping companies get work done that they must surely have believed would take much longer than it has. One area that AirMosaic has come into play very rapidly is in the realm of VoIP calls. VoIP stands for "Voice over Internet Provider", and this refers to the way that many calls are received in the modern office environment these days. A few reasons why office managers prefer VoIP over other options is because: Prices are lower - Generally speaking, the cost of VoIP calls are lower in total. You don't have to pay some of the additional costs that come with international calls or other types of calls when using a VoIP system. Instead, you receive a lower overall cost because the cost is usually a standard and flat rate. VoIP meshes well with existing and emerging technology - VoIP works well with both existing technologies as well as those that are emerging on the scene at this time. Thus, office managers and anyone else who is involved in the phone purchasing process for an office will often find VoIP causes them the fewest headaches as far as combining it with what they already have or what is soon coming down the line. Excellent call quality - It is hard to beat the call quality that you receive with a VoIP system. The calls are crisper, clearer, and provide the consistency that every office is looking for. You really can't go wrong with a VoIP system like this. In the first step a population of mobiles is created. It is possible to edit a huge amount of parameters related to the mobile device hardware and the user subscription related to the SIM. The following image shows the editing of this mobile database, which is performed inside a NetBeans editor and properties window (click to enlarge the images): Once a Mobile population has been created, it is possible to create a scenario (navigator window) where is described what a single or group of mobiles will do. The available test procedures are collected and grouped inside a navigator window on the left bottom side, where you can see some of the available tests: When the scenario has been created, it is possible run it through the UeSIM hardware. This is displayed in the next image: On the upper left side of the image, AirMosaic displays, through some gears, the currently running test. We used a central editor window to display some counters of the running simulation. It is possible to choose the displayed counters by checking a node of the tree on the left side of the window. On the lower side of the application, there is an output window that displays the sequence of events happening during the simulation. Once a scenario has been completed, the scenario window, on the application's top left, shows a green circle to indicate that the test has been completed successfully, as you can see in the next image: Some plots can be drawn for each counter available. It is possible to put different counters on the same plot or on different plots. This is displayed in the next image: At the end of a test, it is possible to generate a report, save it as a PDF, or send it by mail automatically, as shown in image below: This is basically what the application does. Several features are still in development, of course! AirMosaic Runs Simulations For Phone Testing Purposes Did you know that it is important to test the phone systems within your office on a regular basis? You should do so not only because you need to make sure the phones are working so that customers can call in, but also to make sure there aren't any fraudsters trying to take advantage of a vulnerable phone system. Believe it or not, there are fraud cases in which the criminals will attack a phone system set up by a company for their own malicious purposes. Fraudulent calls can ring up huge expenses for companies that are difficult to repay. Obviously, this is not an ideal situation for anyone, and it is best to avoid such scenarios by testing the phones on a regular basis to make sure that there isn't anyone in the system who shouldn't be there. AirMosaic can run sweeping tests of phone systems to try to detect problems like this. What AirMosaic will do is run their sweeping tests to detect any anomalies within the system and alert you to what is going on. They will even let you know if there are phone calls within the system being placed by people who work for you that shouldn't be placed. It would be incredibly challenging to run all of these tests by yourself, and that is why so many are using AirMosaic instead. They see the value of adding a little extra security to their phone systems, and they realize that the only true way to do so is to run a program like this that can detect any problems. Data is Generated That Can be Scanned Finally, AirMosaic produces a list of data on the phones that it has scanned which you can view on your own time. Look over every piece of information that the system found in order to figure out what is going on with the phones that it has identified as perhaps having a problem. AirMosaic is very good at narrowing down the list for you so you don't waste your time trying to go through all of this information on your own. Instead, you rely on AirMosaic to help you out, and then you simply review the data that it discovered in order to get a better idea of what may be happening within your system. By isolating the phones that appear to have a problem, the AirMosaic system makes it easier for you to see which specific phones you will look at and why they may be having some issues. Users sincerely appreciate this because it means that they can finally receive the data that they require to send in their team of IT experts to fix the problem. It takes a little bit of time and effort, but it is worth the trouble when you identify the problem and get people involved who can help. Save your company from the risk of being vulnerable to attack over the phone system. Use AirMosaic to run some tests today.
Updated July 24, 2022
by Stefano Chiappa
· 10,521 Views · 1 Like
article thumbnail
Neo4j 1.8.M03 - Related Coffee
Released back in 2012, Neo4j 1.8.M03 introduced the RELATE clause, a two-step dance of MATCH or CREATE. Also, new Transaction support in the shell lets you call for a do-over in case you misstep. RELATE, a Subgraph Match-Maker A RELATE clause looks a lot like a MATCH clause — the ASCII-art of graph traversals — but behaves differently when there isn't a satisfying subgraph. When there is no match, RELATE will create the needed Relationships and even intervening Nodes. RELATE ensures that the subgraph exists. So, I just fetched myself a coffee. Let's say I want to keep track of how often I visit 3 Bees Coffee. I could carve notches on my desk, but I've already ruined one Ikea desk that way. Being graph-minded, I immediately realize that I'll be curious about deeper questions regarding all the places I visit. I will, of course, evolve a graph mini-app. Neo4j 1.8.M01 introduced the CREATE clause, so I'll create me and the coffee shop: CREATE me = {name:"Andreas"}, `3bees` = {name: "3 Bees Coffee"} (Note the back ticks around 3bees because the term starts with a number) To record that I have visited 3 Bees Coffee, I could add a relationship at the same time: CREATE me = {name:"Andreas"}, `3bees` = {name: "3 Bees Coffee"}, me-[:VISITS]->`3bees` Of course, I will be re-visiting coffee shops more often than going to newly opened shops. I already know about me, and will usually know about the coffee shop, so what I really want to do is just create the Relationship. START me=node(1), coffee=node(2) CREATE me-[:VISITS]-coffee Easy as pie. Mmm pie. Create a record for me, create a record for a shop, and whenever I visit a shop, create a Relationship. Because I want to keep track of the frequency of my visits, I suddenly have a problem: I don't want to create a Relationship every time, but get one if it exists and just update a property on it. Cypher is declarative. There is no spoon, I mean 'IF'. So we turn to our friendly match-making RELATE clause: START me=node(1), coffee=node(2) RELATE me-[v:VISITS]-coffee return v That'll match the VISITS if it exists, or create one if it doesn't. To update the visits, I can convert the RETURN into a WITH to tack on a SET clause like so: START me=node(1), coffee=node(2) RELATE me-[v:VISITS]-coffee WITH v SET v.visits=(v.visits +1) RETURN v OK, one last detail to adjust: the classic initial condition problem. If RELATE happened to create a new Relationship, it won't yet have a visits Property. We'll use COALESCE to ignore v.visits if it is null, then add 1: START me=node(1), coffee=node(3) RELATE me-[v:VISITS]-coffee WITH v SET v.visits=(coalesce(v.visits?,0)+1) return v Ah, now I have even more motivation to take coffee breaks. The RELATE clause is powerful fun. Get yourself a cup of coffee, then sit down to peruse the Neo4j Manual section on Cypher RELATE to learn more. And, check on my coffee consumption in the Neo4j Live console, where you can play around with RELATE. Transactional Shell Prior to this release, every query issued in the Neo4j shell (whether command-line or in Webadmin) created a transaction when needed. Now, you have control over transactions with some new shell commands: begin transaction, commit, and rollback. These let you practice your new Cypher dance moves without worrying about falling on your face and taking your database down with you. As usual, look to the Neo4j Manual for the details. Now that we’ve looked back in time, let’s see what Neo4j can do better than SQL. SQL is an impressive query language but there are things that Cypher handles so much better. Whereas SQL started as a single table query language, support was added later for geospatial data and for XML and JSON as well. XML is primarily used for displaying documents on web pages. It uses customized markup languages that are user-defined. JSON reads data from web servers in order to display it online. When dealing with relational databases which are built on tables, JOINs make the connections. So how does this relate to Neo4j? Well, Neo4j is designed to handle product recommendation engines as well as supply management and personalizing customer experience. And Cypher’s graph query language allows you to extract data from graphs. It’s essentially SQL for graphs. Cypher is easy to use and understand. It’s designed for graphs. It borrows from other languages such as Python and is a powerful, full-featured modern language perfect for data analysts and subject matter experts who need to extract meaningful data by reading and writing queries themselves if need be. You don’t need to be a developer to get the benefits from Cypher. A feature of graph databases is that their searches are schema-free. Or at least optional. By not having a fixed schema you can develop the relationships, add attribute types and develop your data as you go. This provides extreme levels of flexibility when developing applications. SQL Path Patterns Query Using path patterns which is an advanced feature, you can have a product that points to a list of categories. With a deep hierarchy, one which you don’t know the depth of yet, you can insert a “*” to find arbitrary linked relationships right to the root directory. But you can limit it to a set number of relationships as well as categories. This is all easily achieved in Cypher but requires linking together a chain of queries in SQL. Each level must be spelled out in the query to the limit that is needed. A cumbersome and time-intensive process, especially when you don’t necessarily know how many categories you’re going to end up with anyway. Find All Cycles in a Directed Graph If you wish to find loops, where a loop leads back to the same person or thing over again, path patterns will determine the outcome. Using MATCH path = (p:Person)-[*3..10]-(p), one can look for 5 hops ending with the person you started with. Not only is the data available in a table but it can be generated visually. And that in essence is what you get with Cypher; a powerful much more user-friendly tool that is purpose-built to provide graph queries in a format that the user can manipulate to show relationships without being bogged down in endless hours of programming and validation. Combine Reads and Writes If you’re familiar with SQL, you need to support Reads and Writes by using insert statements or insert from select. Unfortunately, that’s where it ends. Cypher does the heavy lifting and combines reads and writes in a single query. So, you can update the database while simultaneously fetching data. The benefits of Cypher over SQL don’t end there but I’m sure you get the point. Relate Yourself Neo4j 1.8.M03 is available for immediate download in the usual places. Get it now: Download from neo4j.org Bump the versions in your maven pom.xml Provision on heroku with: heroku addons:add neo4j --neo4j-version 1.8.M03 Want to practice Cypher with fellow Graphistas? Join us at a meetup somewhere in the world, or propose a new location and we'll look into visiting your area to buy you a cup of coffee. The content of this article was originally written by Andreas Kolleger over at the Neo4j blog.
Updated July 24, 2022
by Eric Genesky
· 9,650 Views · 1 Like
article thumbnail
My Experiences with Maven in IntelliJ IDEA and NetBeans IDE
With IntelliJ IDEA supporting a fully-functional integration with Maven, you can automate your entire building process. The result is that you can create a new Maven project as well as easily handle multi-module projects. Netbeans IDE on the other hand, simplifies the development of mobile applications as well as web and desktop applications using Java and HTML5. So imagine my surprise when some weeks ago, I saw a colleague fighting IntelliJ's Maven support. A dependency was not detected by IntelliJ's Maven support and to fix it, he had to remove the dependency from the POM, save it, add it back to the POM and save it again. Hmmm... somehow not quite optimal. This was the reason for me to take a look at IntelliJ's Maven support and compare some points with the support provided by NetBeans. Let’s look first at how IntelliJ IDEA can support an integration with Maven that is fully functional. This will assist you in automating the whole build. It doesn’t matter whether you wish to create a totally new Maven project, synchronize with an existing open project or add Maven support to existing IntelliJ IDEA projects. You can also manage projects that are multi-module. Creating New Maven Projects These are the steps I’d follow to create a new Maven Project. If you’re starting from scratch and there’s no project open currently in IntelliJ IDEA, go to the Welcome screen and click on New Project. Alternatively, you can select File and then create a new project for the main menu. Once you’ve created your new project, you must name it and if you require it, change its location. You’ll want to create the Git repository, so select the new project for placement under version control. Just be aware that you can do this at any time later in the build. Don’t forget to tick the box. Your project requires a language selection, so do that as well as add any other languages you may want via plugins. You do this by clicking “App>general add”. Under "build system", select Maven followed by specifying the project’s SDK. Or, you can go with the default or JDK. While it is not necessary, it’s a good idea to have a file with a basic sample code, so tick the “add sample code” box. Don’t neglect to specify Maven’s coordinates, which are included in the pom.xml file. You’ll find these in the advanced settings where a new project package is identified in the Groupid box and the project name is specified via the Artifactid box contents. Maven naming conventions follow Jav’s package name rules. This is in the format of a reversed domain name that you control e.g. org.apache.maven. While the naming conventions are not enforced, you’ll have a hard time getting names that don’t follow the rules in the Maven central repository, especially if it is a single word used for group IDs. When you’ve finished your selections, then click “create”. Handling Maven Projects If you open a Maven project in IntelliJ, IntelliJ still generates a default project folder (".idea") and file (".iml"). This means IntelliJ must always ensure that data in the POM is kept in sync with its proprietary structures. However, IntelliJ only handles one direction. Changes in the POM are recognized and the project settings are in sync most times. But if you change something in the project settings, these changes are not reflected in the POM. So, as my colleague experienced, you have to do it twice. Also, IntelliJ lists the "target" folder and ".idea" project settings folder in the logical project view, which is not useful most of the time. In IntelliJIDEA, the Maven project pom.xml file has a compiler included as well as the target Java version. There’s also a Maven tool window and any dependencies that are required to start work. Just bear in mind that the version of Java that is specified in the pom.xml file will, in all likelihood, override the "JDK for importer" option’s specification version. You can find this in the Maven settings. Configure Maven Settings To make things easier, configure your Maven settings before opening new projects. Configuring IntelliJ IDEA to display the Maven settings prior to opening an existing project that is being opened for the first time in IntelliJ IDEA is done at the application level. Once set, they’ll appear for any new project that you open. On the Welcome screen, “All settings” under the customize option. You can also access it from the main menu by selecting “file”, then “new project setup” followed by “preferences for new projects.” In the “preferences” dialog under settings, choose “build”, then “execution”. Under deployment, select Maven as your option under “build tools.” Now go to the Maven settings dialog and make the selection “Show settings dialog for new Maven projects”. You can then click OK and your changes will be saved for all future projects. What this does is, each time you open new projects, the Maven settings dialog is displayed by IntelliJ IDEA and you can then specify the local Maven repository’s location as well as a user settings file. In contrast, NetBeans uses the POM for pretty much everything. The Maven POM file defines the project, as shown below. If you change something in the project settings, it is directly stored in the POM. Only in rare cases, e.g., if you redefine actions, does NetBeans need to create a specific file. NetBeans only shows important information in the Projects window, as shown above. However, if you do want to see the Maven "target" folder, you can easily switch to the Files tab: Building Maven Projects When you build a Maven project in IntelliJ, with the default IDE commands, Maven is not used for the build process. The same goes for tests. If you are using different profiles for local development and your continuous integration server, you have to use Intellij's Maven integration tab to build and test your project with Maven. This is really ugly because you cannot use all the shortcuts that make life easier. NetBeans uses Maven for all that. You can simply press F11 or use the default toolbar button or menu item to build your applications with Maven. This same action works whether you are using Maven, a plain NetBeans Ant build script, or Gradle. It’s always the same consistent procedure. You can even change the Maven command that is used to build the project via F11. You are completely free to configure what you need: Executing Maven Goals Running Maven goals in IntelliJ displays a dialog with just two text fields and you have to type all the Maven parameters by hand. Hey man, it could be so much easier. Running a custom goal in NetBeans gives you a fantastic dialog with lots of possibilities. You can choose the profile, add properties, and even save everything to run it again later. This saves a lot of work. Conclusion There are many smaller issues that show that NetBeans has a smoother Maven integration than offered by IntelliJ. My impression is that IntelliJ's Maven support is just an extension to its default project management system since It still needs the default IntelliJ project folders and files. Meanwhile, NetBeans provides a much deeper and more complete integration. One more thing. I’m not an IntelliJ user so please forgive me if there is a mistake in my observations. I'm also not trying to start a new IDE war. What I want to do by means of this article is to get readers to think out of the box. If you are familiar with your IDE, that is great. If you are productive with your IDE, that is great. But if you think an IDE needs to be expensive in order to be a good product, you are totally wrong and should definitely give NetBeans a try. Thorsten Marx is a product manager and developer at e-Spirit AG in Germany.
July 24, 2022
by Thorsten Marx
· 17,313 Views · 2 Likes
article thumbnail
From Relational to Really Relational: The RDB2RDF Working Group
While a lot of databases have been created listing information in a table format, the web isn't set up in a tabular style. Neither is plenty of data in a variety of formats that the web uses. However, many databases are still using tables, because many web developers feel that tables handle plenty of data better than any other structure. Others feel that the data tables known as RDB should be converted to RDF, a format used to gather an even wider array of metadata across the worldwide web. The ability to convert to RDF will be extremely beneficial as technology advances to Artificial Intelligence AI and beyond. What is an RDB? RDB stands for a Relational Database. An RDB is a collective set of multiple data sets organized by tables, columns, or records. An RDB establishes a well-defined relationship between database tables. The tables communicate to share information that makes it possible to search for data, organize, and report. RDB is derived from the mathematical function concept of mapping data sets as developed by Edgar R. Codd. RDBs use Structured Query Language, SQL.SQL is a standard user application that provides an easy programming interface for database interaction. RDBs organize data with each table known as a relation which contains columns. Each table row, or record, contains a unique data instance defined for a corresponding column category. The data and record characteristics relate to at least one record to form functional dependencies. RDB performs "select", "project" and "join" database operations, where select is used for data retrieval, identifying data attributes, and combining relations. Those who prefer to use RDBs do so because of the advantages, including easy extensibility or scalability, new technology performance, and data security. What is RDF? RDF is primarily used to provide information or metadata for data available on the Internet. RDF provides the methodology for specifying, structuring, and transferring metadata, and provides the basic XML syntax for software applications to exchange or use that information. The URI/URL provides the location of that data. RDF stands for Resource Description Framework and is a standard for describing web resources and data interchange, developed and standardized by the World Wide Web Consortium, W3C with Xtensible Markup Language (XML) and Uniform Resource Identifier (URI) serving as its distribution standards. Typically, RDF provides basic information and attributes about an Internet-based object, such as the name of the author, Web page keywords, object creation or editing data, or the sitemap. While there are many conventional tools for dealing with data and more specifically for dealing with the relationships between data, RDF is the easiest, most expressive, and most powerful standard to date. The overall informational value is much greater because context or intent can be inferred. RDF presents small chunks of information in a form that infers meaning. This can include rules about how the data should be interpreted. Resource Description Framework, RDF, is the standard for encoding metadata and other structured information on the Semantic Web. Semanticization Data With all the semantic standards and database-centered HTML5 APIs and a W3C standard that calls for implementations, this is an exciting time for data on the web. It's time to embrace RDF with the capacity to start pulling relational data into the semantic web! The Purpose of RDBMS The software used to store, manage, query, and retrieve data stored in a relational database is called a Relational Database Management System, or RDBMS. The RDBMS provides an interface between users and applications with the database. It also provides administrative functions for managing data storage, performance, and access. Semanticization, or giving meaning to, all data can be done in two stages. First, construct a web of meanings, not documents -- as Sir Tim Berners-Lee has always wanted, and as the RDF, Resource Description Framework seeks to do. Second, fit all tabular data into the web whether legitimately or not. This second step is less exciting than the first because plenty of tabular data is not ideally tabular. In these cases, the second step is rather backward-looking. However, it is no less necessary than the first for two reasons: Converting everything RDBMS to RDF is not even close to worth it Much data ought not to be converted to RDF All of this data still needs to talk to the web, which means it needs to be translated into a webby structure, ideally RDF. The easiest way to translate without conversion is, of course, just plain mapping. But mapping two rather different structures to one another is no small undertaking or trivial task. That's why there's a whole W3C Working Group devoted to devising a mapping language and actual mapping of relational data to RDF. Sir Tim offers this insight into the RDF-RDBMS relation, cutting through questions that might otherwise be couched in domain-inappropriate terms (like 'is the RDF model an entity-relationship model'): Relational database systems manage RDF data, but in a specialized way. In a table, there are many records with the same set of properties. An individual cell (which corresponds to an RDF property) is not often thought of on its own. SQL queries can join tables and extract data from tables, and the result is generally a table. So, the practical use for which RDB software is used is typically optimized for doing operations with a small number of tables, some of which may have a large number of elements. Because relational databases are species of the genus described by RDF, the basic mapping model is as follows: a record is an RDF node; the field (column) name is RDF propertyType; and the record field (table cell) is a value. So far, so straightforward. Of course, the implementations usually wander pretty far from the original concept. That's why mapping actual RDBMS to RDF takes a bit of dirty work. RDB2RDF Enter RDB2RDF. The RDB2RDF WG is doing the dirty work. Back in 2005, when the Group was still an Incubator, they published a detailed survey of then-current approaches to mapping relational databases to RDF. This survey served as the starting point for typically extensive discussion and debate, which culminated in two Candidate Recommendations: The RDB to RDF mapping language: R2RML The Relational-to-RDF mapping itself Many techniques and tools have been proposed to enable the publication of relational data on the web in RDF. RDB-to-RDF methods are one of the keys to populating the web of data by unlocking the huge amount of data stored in relational databases. Since producing RDF data with sufficiently rich semantics is often important in order to make the data usable, interoperable and linkable, there are various strategies developed to enrich data semantics. Turning RDB to RDF has proven to be of value when dealing with SQL databases. It offers a straightforward and practical system for relational database conversion into RDF. RDB2RDF and the Future Moving forward beyond RDB-to-RDF methods, it will become necessary to find a compromise between the expressiveness of RDB to RDF mapping languages and the need for updating relational data using protocols of the semantic web. Creating, updating, and deleting RDF data should only be made possible in a secure, reliable, trustworthy, and scalable way.
July 24, 2022
by John Esposito
· 10,233 Views · 1 Like
article thumbnail
W3C News Roundup: Annotations and Disability Access
Some of the major announcements from the W3C over the past week on making the web more accessible and powerful as a publishing platform.
Updated July 24, 2022
by Matt Werner
· 3,471 Views · 2 Likes
article thumbnail
GitHub Announces Beta Testing of New Sponsorship Tool
Now you have even more ways to financially support your favorite open-source projects.
Updated July 24, 2022
by Sarah Sinning
· 4,723 Views · 5 Likes
article thumbnail
YAML and Its Usage in Kubernetes
If you've used Kubernetes before, chances are you have come into contact with YAML files. Find out more about what they do here.
Updated July 24, 2022
by Raghavendra Deshpande
· 5,948 Views · 3 Likes
article thumbnail
Kotlin Was Predicted to Overtake Java by December 2018. What Happened?
In 2018, the Realm Report predicted that Kotlin, a cross-platform programming language, would overtake Java by the end of the year. Was the forecast accurate?
Updated July 24, 2022
by Tom Smith DZone Core CORE
· 8,304 Views · 2 Likes
article thumbnail
Java 6 On Mac—Worst Release Ever (And What’s New!)
When Apple finally released Java 6 for Mac OS 10.5.2, the Java community was more than a little upset. Java 6 only supports 64 Bit on Mac No Cocoa Support What to Do About Java 6 on Mac Using Java on Mac in 2022 What’s Changed Since Java 6 Where is Java on Mac Headed? The history of Java releases on Mac has been more than a little problematic. New updates for Java always find their way to Mac a few years too late and they are often more limited than their Linux and Windows counterparts. Let’s see how Java 6 on Mac stacked up and take a look at the latest Java release for mac and see how it compares. Java 6 on Mac Only Supports 64 Bit This means that Java 6 doesn't run on 1-year-old MacBooks or all early adopters of the Intel switch. A huge amount of people can't run 64-bit. Java 6 on Mac requires much more specific technology than Java 6 did on any of its counterparts. We tend to have a lot of opinions about how to code differently with Java, but we can all agree that Java 6 didn’t really work for Mac. Another problem is that it only supports 64-bit applications, Bye-bye applets in Safari. These are huge setbacks for people who were looking forward to Java on Mac, but the problems didn’t stop here. No Cocoa Support Because of the lack of 64-bit libraries for cocoa, it is not possible to use cocoa with Java 6. Nearly every Java application on Macs uses cocoa to make it look better on Mac OS. Some even are 100% cocoa, like Cyberduck. Because of that, only a small percentage of Java applications can run on Java 6. Java 6 really needed more Mac-specific support in order to function like it did on Windows or Linux. In fact, you have a better chance of performance tuning Java on Linux than you did on a Mac. Apple Knows This Apple is well aware of these problems. The update doesn't make Java 6 the default VM. Apple's preferences dialog even warns you if you want to make it the default VM. Having Apple and Java clash like this only made things more difficult for people working with Java on a Mac. So, What To Do Now? Options were limited for working with Java 6 on Mac. What made Java 6 on Mac even worse was the lack of any good workarounds or alternatives. You either had to commit to a limited system or try something a little involved. These are your options. We only have three choices from here: Switch back to Windows / Linux for Java development Use SoyLatte and help them to create the native GUI pipeline Ask Apple to fix these issues In the long term, no. 2 would be the best. A Java implementation by a large community would have faster release times. We can't wait for Apple to fix these issues—we have to do it ourselves. Getting Java 6 to turn on Mac requires some pretty advanced Java tutorials. Now, let’s take a look at what’s changed since Java 6. Using Java on Mac in 2022 In terms of running Java on Mac, so much has changed since Java 6. In fact, it would be just a few years until the release of Java 7 things completely changed for working with Java and working on an Apple computer. We're going to take a look at some of these specific changes and just see how the landscape of using Java on a Mac has changed from Java 6 all the way to Java 17. Using Java has only gotten more developed as the years have gone by. After all, becoming a Java developer starts with getting Java running on your Mac! What’s Changed Since Java 6 on Mac If you were trying to use Java on Mac since Java 6, you were up against a lot of trouble. You'd have to either settle for a Java that didn't perform nearly as well as it did online up to your PC or go through a bunch of complicated workarounds and still be stuck without all the features. What's important to keep in mind is that Java is more important today than it's ever been. While you might hear some people saying that Java is on the way out, Java still has plenty of use and pops up everything from popular applications, to websites, and it is a highly preferred language for programmers the world over. Java Becomes Mac Native All the DIY fixes in the world couldn't get us ahead for making Java work on Mac. However, things would have quickly changed with the release of Java 7. Starting with Java 7, Java releases work with Apple technology as long as the systems are compatible. You can run compatible editions of Java with your Mac laptop or computer. It all depends on whether or not the specs of your Mac match up with the edition of Java you want to run. Here’s where to start to find some familiar limitations for using Java on a Mac. There are Still Limitations (Java, Intel, and Mac) Even though Java runs on Mac after Java 7, there are still some problems with trying to get Java to run on Apple's technology. If you’re looking for the best toolkits, tips, and tricks for Java, you’re going to need to get it running first! Despite all the advances that are made, you're still going to encounter a few problems with trying to get Java to run on a Mac. The first thing that we have to talk about is that Java is designed to work with the Intel processor versions of Mac. Now that Mac is coming out with their own processor chips, we're seeing compatibility issues with Java and plenty of other technology that people rely on. Apple's desire to keep everything proprietary and stay in a closed sandbox is definitely costing them when it comes to reliably working with some of today's most popular technology. There are also issues when it comes to which Mac operating system you're using. There's a good chance that your Java version might not be compatible with the Mac computer that you're working with depending on the operating system that that Mac runs. Where Things Are Headed for Java on Mac There is good news for the future though. As Apple’s processor technology becomes more popular, more software is going to become compatible. Java is likely to follow suit with Adobe and plenty of others working to find ways to work with Mac’s M1 processors.
July 24, 2022
by Bodo Tasche
· 33,806 Views · 1 Like
article thumbnail
Execute a HTTP POST Using PHP CURL
A customer recently brought to me a unique challenge. My customer wants information request form data to be collected in a database.
July 24, 2022
by David Walsh
· 108,050 Views · 2 Likes
article thumbnail
Escape Analysis in Java 6 Update 14 - Some Informal Benchmarks
Sun released update 14 of the Java 6 JDK and JRE. As well as the usual collection of bug fixes, this release includes some experimental new features designed to improve the performance of the JVM (see the release notes). One of these is Escape Analysis. What Is Escape Analysis? Escape analysis is a compiler optimization technique that analyzes an object's access path to determine whether or not it is escaped from its current scope. If an object is not escaped, then the compiler can allocate it on the stack rather than on the heap. This eliminates the need for memory allocation and garbage collection for the object, which can improve performance. Allocating on Heap Vs the Stack To understand the implications of allocating an object on the stack or heap, it is first necessary to understand how these two data structures work. The heap is a pool of memory that is managed by the JVM. When an object is created, it is allocated a space on the heap. The size of this space depends on the object's type and the fields it contains. The stack is a data structure that is used to store local variables and function call information. When a function is called, its parameters and local variables are stored on the stack. When the function returns, these variables are popped off the stack. Allocating an object on the heap requires two operations: The object is allocated a space on the heap. The object's reference (a pointer to its location on the heap) is stored on the stack. Allocating an object on the stack requires only one operation: The object is allocated a space on the stack. Because allocating an object on the heap requires an extra operation, it is generally slower than allocating on the stack. In addition, heap allocation requires the JVM to manage the memory used by the object. This includes finding a free block of memory of the appropriate size and dealing with fragmentation. Stack allocation does not require any memory management, as the stack is managed by the operating system. What Is a Compiler? A compiler is a program that converts code written in one language (usually called the source language) into another language (usually called the target language). The target language can be either machine code or another high-level programming language. In Java 6 Update 14, escape analysis was turned off by default but could be enabled by passing the -XX:+DoEscapeAnalysis flag to the java command. However, now Escape analysis is supported and enabled by default in Java SE 6u23 and later. What Is An Object? In Java, an object is a self-contained unit of functionality that can be created and used independently. A typical object consists of both data and behavior. Data is represented by fields (also called member variables or instance variables), and behavior is represented by methods. You can think of an object as a "thing" that can perform certain actions and contains certain information. For example, a car is an object that can be driven (behavior) and has a color (data). Why Is Escape Analysis Important Today? Escape analysis is important because it can improve performance by eliminating the need for memory allocation and garbage collection for certain objects. When we say "garbage collection", that refers to the process of reclaiming memory that is no longer being used by the program. In general, garbage collection can be a CPU-intensive operation, so eliminating it can improve performance. Any time you can avoid allocating memory and/or doing garbage collection, your program will run faster. What Are Some Examples of Objects That Can Benefit from Escape Analysis? Small objects that are created and used within a single method can often benefit from escape analysis. For example, consider the following code: public static void main(String[] args) { String s = "Hello, world!"; System.out.println(s); } In this code, the String object created on line 3 is not escaped. It is created within the main method and is used only within that method. As a result, the String object can be allocated on the stack rather than on the heap. This eliminates the need for memory allocation and garbage collection for that object. How Does Escape Analysis Work? To determine whether or not an object is escaped, the compiler uses a flow-sensitive, interprocedural analysis. This means that the compiler not only analyzes the code within a single method but also looks at how the object is used in other methods that are called from the current method. If an object is only used within the scope of a single method and is never passed as an argument to another method, then it is not escaped. For example, consider the following code: public class MyClass { public static void main(String[] args) { MyClass obj = new MyClass(); obj.method1(); } public void method1() { int x = 5; method2(x); } public void method2(int y) { int z = y * 2; } } In this code, the MyClass object is created in the main method and passed as an argument to the method1 method. The method1 method then creates a local variable x and passes it as an argument to the method2 method. The MyClass object is therefore escaped because it is used in another method (method2) that is called from the current method (method1). In contrast, the local variable x is not escaped, because it is only used within the scope of the method1 method. When Should I Use Escape Analysis? Escape analysis can be used to improve the performance of any Java application. It helps to reduce the memory footprint. It is most effective when objects are short-lived and are only used within a single method. To see what kind of impact escape analysis might have on my applications, I decided to try it on a couple of my more CPU-intensive Java programs. Escape analysis is turned off by default since it is still experimental. It is enabled using the following command-line option: -XX:+DoEscapeAnalysis Benchmark 1 The first program I tested is a statistical simulation. Basically, it generates millions of random numbers (using Uncommons Maths naturally) and does a few calculations. VM Switches: -server 95 seconds VM Switches: -server -XX:+DoEscapeAnalysis 73 seconds Performance improvement using Escape Analysis: 23% Benchmark 2 The second program I tested is an implementation of non-negative matrix factorisation. VM Switches: -server 22.6 seconds VM Switches: -server -XX:+DoEscapeAnalysis 20.8 seconds Performance improvement using Escape Analysis: 8% In both cases, escape analysis gave a noticeable performance improvement. I was quite surprised by how much of an improvement I saw in the first benchmark. I wasn't expecting to see anything like that. Escape analysis is an important tool in the JVM performance tuner's armory and it's good to see that it is being improved and refined in each new release of the JDK. Are There Other Ways To Reduce Memory Footprint in Java? Yes, there are other ways to reduce the memory footprint in Java. One way is to use object pooling. Object pooling is a technique for reusing objects that have already been created. Another way is to use a generational garbage collector. A generational garbage collector is designed to collect short-lived objects more efficiently than long-lived objects. Finally, you can use a compacting garbage collector. A compacting garbage collector moves objects around in memory so that there are fewer gaps between objects. This can help to reduce memory fragmentation. Conclusions These benchmarks are neither representative nor comprehensive. Nevertheless, for certain types of programs, the addition of escape analysis appears to be another significant step forward in JVM performance. In conclusion, although escape analysis is still experimental, it is definitely worth experimenting with in your own applications. If you are interested in learning more about escape analysis, I highly recommend reading about it further on Dzone.
July 24, 2022
by Dan Dyer
· 32,710 Views · 1 Like
article thumbnail
Optimize Your Links For Print Using CSS: Show The URL
When moving around from page to page in your trusty browser, you get the benefit of hovering over links and viewing the link's target URL in the status bar. When it comes to page printouts, however, this obviously isn't an option. Most website printouts simply show the link as text with an underline. What good is that? Links Should be Printable One of the key elements that many people forget about when they are creating a web page of any kind is the fact that they should be making the links that are inserted printable. You see, there are many people who will want to check out the information and research that you are providing them via the links inserted into your page. Unfortunately, they may not be able to look at those links as completely as they might want to if you are not making it easy and possible for them to print off the links. Making links printable is a matter of getting into the CSS code and looking to make sure that any URLs that you have inserted are truly printable for your audience. It is fully expected that you will take the time to do this for the people who have bothered to show up and read your materials. Truthfully, you owe them a sign of your appreciation for having come to see what you are creating in the first place. Internet Explorer Often Ignores the Code One thing to keep in mind when you begin to mess around with the CSS codes for your URLs is that it is entirely possible that Internet Explorer will ignore the codes that you put in there if you don't get them just right. Internet Explorer is set up in such a way that it will ignore certain lines of code and other materials that people insert into their websites if Internet Explorer feels that the code is not relevant. This is why you must be on top of everything to make sure Internet Explorer does force your code out when you know for a fact that the code that you are using is incredibly important to the usefulness of your website. To provide extra help to your content viewers, you may want to include a snippet of information that lets them know that Internet Explorer may cause some problems when they are trying to print off links in the article. A quick line or two that encourages them to use a different Internet portal such as Firefox or Google Chrome may prove beneficial to all of your readers. They need access to your information, but they may struggle to get it if they are only using Internet Explorer. Sadly, they may not even realize that this is a problem unless you point it out by making it clear that they need to switch browsers in order to print off the information that they require. Take some time to throw in a quick line about why users need to shift over to using a browser other than Internet Explorer to get the information that they require. If you do this, then they will be able to finally get the information you are providing without getting jammed up simply because of the browser they are using. One simple line and you can help fix so many of the problems that they are facing. Providing URLs for links in the print version of your page can be extremely helpful to the reader. Using a small snippet of CSS code, you can get printouts to display link URLs right next to the link text. The CSS Code a:link:after, a:visited:after { content:" [" attr(href) "] "; } The pitfall of this method of displaying links URLs for print is that Internet Explorer ignores this code. If showing link URLs is critical, I'd recommend using a javascript alternative. If not, add this snippet to your print stylesheet to make your page print-outs more informative. Click here for an example! JavaScript Alternatives Can Help There are situations in which JavaScript alternatives can help you get around the auto-blockers that Internet Explorer has put up on some of these codes. You may need to work around the traditional system in order to get the results that you need, but you should have a lot of success getting the code to look just the way you need it to if you use some alternative programs to achieve your results. Sometimes, you just have to think outside of the box like this to get around the barriers that sadly exist within the computing space. We can all hope for a day when there aren't so many layers of protectionism between ourselves and the things that we want to put up on the Internet. If we can just use some of the tools at our disposal as far as JavaScript alternatives and the like are concerned, then we may be able to make some progress in the right direction. It is a challenge to be sure, but there are a lot of ways that we might be able to build a better Internet and a better world in general. Does Printing Still Matter for Links? There are different schools of thought about how important the ability to print something off still is to people, but most land on the assumption that it is better to have printing abilities than to not have them. People sometimes want to print something off so they can view it on their own time and even hand the printed copy off to someone else that they know that they believe might benefit from it as well. Why would you want to deny them the ability to do this? The CSS code that is used on your links will be extremely important to the final ability of someone else to use it to print off what they see on the screen. This is why you should be extra careful to make sure the code is written just right. There are situations in which your viewers may delight in the information that you provide them, but they may not have Internet access everywhere that they go. If they need to pull up your information without access to the Internet, then it is necessary for them to print off the files that they need from you. Thus, you might want to spend some time getting your links into a form that allows them to be printable. Not everyone who visits your website will care about printing something off, but the people that do care about it will notice the steps you took to make this possible for them, and they will surely appreciate what you have done for them.
Updated July 24, 2022
by David Walsh
· 24,174 Views · 1 Like
article thumbnail
Calling JavaFX From Java?
Putting Together the Best of Both Worlds One of the things that people like so much about JavaFx is the fact that it has a suite of powerful tools used by designers and creators to get exactly the kind of look and feel that they desire from their creations. When used properly, JavaFX will change the way that you take care of your biggest technology challenges. That is why it is such a powerful product to use, and that is also why people around the world recommend it for the value that it can add to your work. A few of the features that are included are: WebView Java APIs High-Performance Media Engine Multitouch Support Canvas API These are just a few of the things that JavaFx has going for it. Truly, it is a powerful engine that people use to help make sure their media creations are something that people will stand up for and take note of. The truth is, no matter who you are or what your intentions are for the use of Java in your life, the JavaFX combined with Java itself is the way to go. while experimenting with javafx, remember that java is never far away. in this case, let's call out to : here we go, here's all that's needed, via the scripting api, which is included in the javafx sdk: package calc; import java.io.inputstreamreader; import javax.script.scriptengine; import javax.script.scriptenginemanager; import javax.script.scriptexception; public class calculatorlauncher { public static void main(string[] args) { try { scriptenginemanager manager = new scriptenginemanager(); scriptengine engine = manager.getenginebyextension("fx"); inputstreamreader reader = new inputstreamreader(calculatorlauncher.class.getresourceasstream("calculator.fx")); engine.eval(reader); } catch (scriptexception ex) { } } } and so, here's my whole application, calling jim weaver's calculator demo: What is even better would be to be able to embed that JavaFX stage (or a panel-like part thereof?) into a JFrame. then one would have the best of both worlds: the graphic "oomph" of JavaFX, together with the daily low-level grunt work of java. that, I believe (and hope), is the promise of JavaFX for java developers (and groovy developers), as opposed to designers and similar graphic artists, who seem to be the primary target of JavaFX. Day-to-Day Grind Work One thing that people absolutely love about Java itself is that it allows them to get the day-to-day grunt work done that they need to be done. They are able to see real progress on a daily basis simply by using Java to help propel their best efforts into the world. Yes, there are not as many bells and whistles with Java as there are with JavaFx and other tools, but that just means that there is more to combine with Java to get it to do all that you want it to do. Using JavaFX and Java together can help get more done. This is an innovative approach because it means that they are able to use the bells and whistles of JavaFx incorporated into the practicality of Java itself. Bringing those two things together is a great way for everyday people to achieve results in their work that they would not normally have believed was possible. We do need to recognize the fact that there are many great resources that Java can be used for, but it is also the case that JavaFx simply gives it the extra push that it needs to be a great computing program all around. We would be remiss if we didn’t combine the two things together for optimal use. Does JavaFX Makes Sense For Business Applications? There is still a lot of debate about how much sense it makes to use JavaFX for business applications. On the one hand, there are a lot of people who prefer this as their technology of choice. However, there are some others that say that it is too buggy and can’t handle all of the data that is required for a business operation to run smoothly. What people really like about JavaFx is the fact that it can be used on a “zero installation” basis. This means that it doesn’t need to dig deep into your databases and systems in order to function the way that it is supposed to. That is a pretty big deal because you may find it quite irritating to try to deal with systems that constantly request permissions from you to get deeper and deeper into sensitive data. JavaFX doesn’t do that. However, there is a trade-off. The fact that JavaFX doesn’t need to be as deep into your company’s systems also means that it doesn’t necessarily have the computing power that you may require to fun every operation that you need it to. That means that there could be unnecessary crashes and delays when you attempt to use this system as a standalone program. Does Combining It With Java Help? Some of the issues that are seen with JavaFx may be relieved by the fact that you can also use plain old Java to help make things run a little more smoothly. That’s right, you can combine the Java platform that you are already familiar with to let it latch on to the JavaFx system and generate results that way. You may see fewer system errors and hang-ups when you use this older piece of software to aid the JavaFx system. Regular Java does require more permissions to your data, but that may be a trade-off that you are willing to make if you understand that the upsides are potentially quite enormous for you. Think about your options carefully and then make a decision. Unless you are guarding particularly sensitive data at your company, it probably makes sense to go forward with the plan to get JavaFx and Java combined into the rotation of programs that you use. Innovation Is At Your Fingertips There is plenty of excitement and buzz about the possibilities that JavaFx can bring to the world of business. People are looking at it and starting to realize that there are many ways that it may be used as an innovation machine. They are particularly excited that there are more options than ever available to them and that they can see the ways in which this system may be used to generate outsized business opportunities both for the company that they work for as well as for themselves. If you haven’t had the chance to try the JavaFx system for yourself yet, you need to give it a shot. There are a lot of people who are already benefiting from what it has to offer, and you may fall behind if you don’t try it out as well. Look at what it can do when you get the chance, and then get one for yourself and begin the process of innovation. You won’t regret taking this opportunity to expand your horizons.
July 24, 2022
by Geertjan Wielenga
· 41,079 Views · 3 Likes
article thumbnail
Mixing Swing and Native Components
Bringing Together Various Components There are situations in which it may be to the benefit of a programmer or other computer user to look at bringing together native components of a system with swing components. These are components that they have either created on their own accord or components that they have brought over from another service. Either way, combining the native components that already exist in a system with swing components is a great way to achieve some surprising results. You might want to think about giving this a try if you are thinking about how you can bring your talents up to date for use in the world as it is today. DJ Native Swing is a nice solution to embed native components (Web Browser, Flash Player, etc.). There was still a general issue that this library did not resolve though: the possibility to mix heavyweight and lightweight components with lightweight components on top, to change their Z-order or re-parent them. Fortunately, The release 0.9.3 offers interesting advances in this area. Using these features is as simple as changing some options before instantiating native components, in order to extend their behavior. You can try all the features (including the new options) with the Webstart Demo: http://djproject.sourceforge.net/ns/DJNativeSwingDemo.jnlp The Webstart demo is configured to work on Windows. It also works on Linux (GTK, x86/i386) where XULRunner is installed. Note that this demo is part of the release package. Run Tests on Every Component It is a good idea to run a demo of any components that you think you might want to put together. The reason for this is that you need to make sure those components will work for you as you anticipate that they will. This is far from a guarantee, and that is why you are called upon to pay careful attention to the things that you are running through these systems. It is entirely possible that you might find some errors that you made along the way when you are checking out the system to see where you went wrong. There is nothing bad about looking over something and realizing that you still have some room to grow and figure things out. As a matter of fact, this is a great way to grow as a person and as a programmer. You cannot begin to take steps in the right direction if you don't figure out where you can improve upon the decisions that you have made before. In my opinion, this gets us one step closer to proper native integration. What do you think? Have you got any comments or suggestions? Mixing Things Up for a New Creation Believe it or not, one of the best things that you can do to mix things up and keep your creations fresh is to look at how you can combine native components with the swing components that you bring into the system. It is a way for you to show the people who will ultimately use your creations that you are serious about making something that they stand to benefit from. If that is the kind of thing that you are into, then you need to give it a try right now. After all, there may be a tremendous number of people just waiting to see what you are all about and what you can offer to them. If you provide them with things to get excited about, then they will keep coming back for more. -Christopher
Updated July 24, 2022
by Christopher Deckers
· 20,728 Views · 2 Likes
article thumbnail
Hack OpenJDK with NetBeans IDE
You've come to the right spot if you are trying to hack OpenJDK with NetBeans IDE. This article explains what OpenJDK with NetBeans is and how you can use NetBeans to create OpenJDK. But before we dive in, first things first: What are Hack OpenJDK and NetBeans IDE? Open Java Development Kit (JDK) is an open-source implementation of the Java Platform or Standard Edition. That means anyone can access the source code and GNU General Public license of the OpenJDK. You may also ask, "then what is Netbeans?" NetBeans is also an open-source integrated development environment for developing with Java, PHP, C++, and other programming languages. All THE applications are developed modules in Java. The OpenJDK repository contains a NetBeans project for all C/C++ parts of the OpenJDK, including Hotspot. So, since NetBeans is an Apache project, it is pretty easy to download and hack the code. You can run it on operating systems like Windows, Linux, and macOS. Remember, to use NetBeans for Java programming; you first need to install Java Development Kit (JDK). Can I use NetBeans with OpenJDK? Yes, you can. The latest NetBeans version of NetBeans is at NetBeans IDE 6.0 Beta 1. But keep this in mind, to hack OpenJDK, you'll need only the Java SE version. Which JDK is compatible with NetBeans? The JDK is compatible with JDK 8 features. That includes annotations, compact profiles, lambda expressions, and repeatable. When you use any of those constructs in your code, they will automatically highlight errors and allow you to fix syntax. Review, Hacking, and Develop OpenJDK. You follow these simple: Get OpenJDK, as follows: #hg clone http://hg.openjdk.java.net/jdk8/build jdk_trunk #cd jdk_trunk #sh get_source.sh #mkdir build #cd build #sh ../configure. After you’ve "configured", the step is complete, remember the value assigned to "Boot JDK" and then:#export IDE_ALT_BOOTDIR=jdk_path_found_by_configure #netbeansStart NetBeans IDE (with C++ support) and open projects from "common/nb_native". Just make sure that the project already contains configurations for Solaris, Linux, and macOS. You can do this by switching to the appropriate configuration and enjoying hacking OpenJDK. Next up, navigate inside your NetBeans project directory. Once there, you will find a directory called incubator-Netbeans. This directory contains sufficient NetBeans modules. Is OpenJDK with NetBeans IDE secure? As the emphasis increases, so does the need for security. Hence, you can easily create the Secure Directories. You can do this by choosing File > New Project (Ctrl-Shift-N), selecting Web Application from the Java Web category, and clicking Next. Regression testing verifies that system changes do not interfere with existing features or code structure. They are part of almost every test suite in software development lifecycles. It is common for developers to change or add a code section and unintentionally disrupt something that is working just fine. Visual regression testing functions on the same logic but confines it to the visual aspects of the software. It works by comparing two images and automating complicated scenarios, like when we cannot identify the elements in the DOM tree. However, visual regression can be used on any website. How Does Visual Regression Testing Work? During the first run, the visual comparison tool captures the snapshot called the base image. The subsequent run compares the base image if there is no difference test is passed, and if there is a difference, the test is considered as failed. Visual regression is also called visual comparison testing. In this tutorial, we will discuss automated visual regression using Playwright. Prerequisites for Visual Regression with Playwright Download and install NodeJS Download and install Visual Studio Code (Recommended) Install Playwright NPM module Install @playwright/test module Note Throughout this tutorial, we are using Playwright with JavaScript. Playwright comes with the default visual comparison tool, so there is no need to install additional packages. Create Simple Visual Comparison Tests Using Playwright In your tests folder, create a new JavaScript file example demo.spec.jspage.screenshot() function takes the screenshot, and expect in the @playwright/test module provides the assertion for matching the images that are .toMatchSnapshot(). Inside the newly created JavaScript file, create a new test that performs the visual comparison like below. Visual Comparison in Playwright to Ignore Minor Differences The above comparison technique matches the screenshot pixel by pixel, which means each pixel should match exactly. This behavior can be modified by passing the argument maxDiffPixels = . Example JavaScript const { test, expect } = require('@playwright/test'); test('Visual Comparison Test Demo', async ({ page }) => { await page.goto('https://playwright.dev'); expect(await page.screenshot()).toMatchSnapshot({ maxDiffPixels: 200 }); }); In the above example, we have specified the maxDiffPixels value as 200, which means the maximum pixel difference can be 200. Image Comparison in Playwright With Threshold Option Playwright toMatchSnapshot() accepts threshold, threshold ranges from 0 to 1, default value is 0.2. The threshold is tolerance of image differences. Example Code JavaScript const { test, expect } = require('@playwright/test'); test('Visual Comparison Test Demo', async ({ page }) => { await page.goto('https://playwright.dev'); expect(await page.screenshot()).toMatchSnapshot({threshold:0.5}); }); In the above code, the threshold is mentioned as 0.5. Playwright Visual Comparison Tips and Tricks In Playwright, we can pass the image file name; instead of default comparison, Playwright compares with the specified filename. Example expect(await page.screenshot()).toMatchSnapshot('home.png'); Playwright also allows us to compare element snapshots; we can take a snapshot of DOM elements and compare. Example expect(await page.locator('xpath=//*[@id="__docusaurus']).screenshot()).toMatchSnapshot(); Visual Regression With Playwright Using Percy Percy is a web-based tool for visual testing with a free tier, and it provides both manual and automation capability for visual comparison. Percy supports Playwright integration. Percy is now a part of Browserstack. If you already have a BrowserStack account, you can sign in with BrowserStack or sign up and create one. Using Percy With Playwright Step 1 – Install Percy modules using the following command. npm install --save-dev @percy/cli @percy/playwright Step 2 – Create a new JavaScript Playwright test file like below. JavaScript //demo.spec.ts const { chromium } = require('playwright'); const percySnapshot = require('@percy/playwright'); (async () => { const browser = await chromium.launch(); const page = await browser.newPage(); await page.goto('https://www.browserstack.com/', { waitUntil: 'networkidle' }); await percySnapshot(page, 'Example Site'); await browser.close(); })(); In the above example, we are navigating to https://www.browserstack.com/, and we are taking a snapshot using the percySnapshot() function. Setting Up Percy Step 1 – Login to Percy. If you don’t have an account, create one. Step 2 – Create a new project. Step 3 – Copy Percy token. Step 4 – In your Visual Studio Code Terminal, set the PERCY_TOKEN environment variable using the below commands: Powershell / Visual Studio Code Terminal $env:PERCY_TOKEN = "your_token"
July 24, 2022
by Vladimir Voskresensky
· 16,840 Views · 2 Likes
article thumbnail
Kubernetes Requests and Limits Demystified
We will look at basic resource configuration options and ways to think about tradeoffs between the cost and performance of your containerized apps.
July 24, 2022
by Erwin Daria
· 3,616 Views · 1 Like
article thumbnail
When To Use JSON in Your Database
In this article, you will learn when you should consider adding JSON data types to your tables and when you should avoid them.
July 24, 2022
by Antonello Zanini
· 5,994 Views · 1 Like
  • Previous
  • ...
  • 306
  • 307
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×