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

Latest Articles - DZone

article thumbnail
Grails 1.0 Released!
This article was originally published on February 5, 2008. When a new piece of coding material comes out, the entire coding community tends to get pretty excited about it. They care because they know that it means that there are new applications that they can play around with, and it is entirely possible that there will be some incredible new creations that come out of all of this as well. Thus, there has been a lot of buzz around the Grails 1.0 release, and we are so excited to share with you some of the reasons why this is exciting. Web Development Is More Complicated Than It Needs To Be One universal truth about website development as it stands today is the fact that it is more complex than it honestly needs to be. There are many tools that one may use to work their way through some of it, but few things simplify it down enough for the average person to hop on and feel good about what they are creating. People will tell you that they feel shaky at best about their creations, and that is really saying something. Java is what most people use when they are coding, and it is likely to remain the dominant player for a very long time to come. That said, there are tools like Grail 1.0 that seek to help users get a better sense of what is going on within the coding that they are doing. The hope is that by explaining what is happening, users of Grail 1.0 can get a firmer grip on the concepts that they are working with. What Makes Grail Different? There are plenty of coding languages out there, so what makes Grail so different, and why should people honestly care about it at all? It turns out that the main reason we need to care about it is that it works with Java and leverages Spring to make things even more straightforward and easy to understand. Grail has typically been used for web applications in the past, but the role that it has is now expanding to desktop applications as well. There are different types of people looking to access it at this time, and it seems that allowing them to view it over as wide of a scope as possible is a great way to make sure everyone gets a crack at it even if they don't yet realize that this is something that they want in their lives. Is Grail Catching On? You could say that Grail 1.0 has made quite the splash in the coding community. This is not just some niche product. The makers of this program anticipate that they will see between 5,000 to 10,000 downloads of it per month as it gets kicked off. That is a lot of interest to be circulating around a single product in the coding world. It means that they are expecting an explosion of users to want to hop on and check out what it is all about. If they are right in their projects, then this download could prove to be something very big indeed. It may even become a must-have product in coding. When you have something that catches on with that big of a segment of the population, it is often the case that it has struck some kind of chord with them, and it means that there is a lot to be excited about on the product development side. It is a huge deal that things have gotten as far as they have, and we must recognize that there is still room to grow this project out even more, but it is exciting that it is doing as well as it is already. Graeme Rocher just announced on the Grails mailing list the release of Grails 1.0. I'm very happy to announce this news here on Groovy Zone since more than 2 years ago I stood at the cradle of Grails together with Graeme, Guillaume La Forge and Dierk Koenig. Grails, Groovy and the entire Java community has gone a long way since then. Grails has seen the rise of many competitors since its inception. JRuby on Rails has become a reality. Seam is going strong. Yet the popularity of Groovy and Grails is undeniable, as the traffic on Groovy Zone indicates. Thanks to the Grails development team for all the hard work. Grails went through quite a few refactorings. Out of this came ExpandoMetaClass which helped to re-write the Meta-Object Protocol in Groovy 1.5. I also like BeanBuilder, a Groovy builder for configuring a Spring ApplicationContext. For me Grails is the ultimate rapid prototyping platform for Java. I've built numerous applications by dropping in existing Hibernate-configured classes and generating scaffolding views. It gets you started really quickly and helps you to focus on the application you're building. GSP and the Grails tag libraries are amazing, they're so much better than JSP tags. And let's not forget the numerous Grails plugins. The Search plugin is terrific, it instantly adds search functionality to your application. Check out all the Grails plugins for your needs. Download Grails 1.0 here. Read the user guide here. Watch the screen casts here. Check out the Grails and Groovy books here. An Open Source Product As with many things these days, Grail 1.0 is an open-source product. That is a huge deal simply for the fact that it means that you can access the Grail 1.0 program that you need without having to pay a penny for it. It also means that people are constantly adding more features to the program as time goes on. You will want to check in on this regularly because it means that there may be some interesting updates that are added to it from time to time. You certainly don't want to let those pass you by. There is a whole world of developers out there who are adding their own personal touches to projects like this. You will discover that many of them are extremely well-versed and great at what they do. You may even learn a thing or two about how you need to structure your own coding projects in the future. There may be some critical information that you learn from other coders and discover that you can tweak your own codes to make them even more functional. Add it to Your List of Tools You may love Grail 1.0, or you may feel more uncertain about it. At the end of the day, it doesn't matter all that much. What is ultimately important is if you can use it as part of your overall routine for getting more information out into the world. You likely have tools that can help the rest of humanity, and you need to just add it to the other tools that you have for coding. It might come in handy someday, and it is unclear when that day will be. Think about this and make sure you throw it in there with everything else that you have going for you. It could prove to be extremely useful at some point in time.
Updated July 24, 2022
by Steven Devijver
· 20,764 Views · 1 Like
article thumbnail
Automated Deployment with Mule Management Console and Maven
Automated deployment doesn't have to be difficult. Learn how to use the Mule management console and Maven to achieve automated deployment.
Updated July 24, 2022
by $$anonymous$$
· 19,348 Views · 4 Likes
article thumbnail
Android ListView – Fixing Missing/Blank Dividers
Working With ListViews in Android Development Putting up a list of elements that people can see and work with is a very common tactic when working on mobile applications. It is something that developers are called upon to do all the time, and it is a good thing we have them working on these things because otherwise the apps that we all use on a regular basis simply wouldn't hold up to the workout that we put them through when using them. That is to say that they wouldn't look nearly as good as we are used to them looking at this point. Most developers will look at ListView in Android at some point in their developing career. It is a typical thing for developers to do, and you might as well get used to using this application if you intend on working in the field for very long. It will come to be expected of you. A Full View Of Information A primary reason to use ListViewer when developing a new app is simply to allow users of that app to see everything that they need to see as they are scrolling through it. They may want to spend some extra time on certain elements of what you have created, and that is all possible when you provide them with the list or "table of contents" for your application. You may be surprised to learn just how much people appreciate this and how much it truly benefits them. Funny as it might sound, these are the types of things that make a difference in the lives of people who are just trying to figure out what kind of apps they will use. The ListViewer app allows developers to provide their users with precisely what they are looking for as far as the information they need to access right when they need to access it. No more hunting around trying to find a specific aspect of the app that you are currently using. It is all right there when the developer has taken the time to use ListViewer to make it easier to scan. Accessibility is the Name of the Game Have you ever used an app that you weren't quite sure how to find everything in? There are many people who have put themselves in this unfortunate predicament before, and the results can be devastating. That is to say that they are not app with the outcome because they end up getting lost in the maze of the app and are unable to truly enjoy its benefits. Creating lists within the app makes it a lot easier for anyone to take a look at what is going on within the app and try to figure out which steps they need to take next to get to the information that they actually desire. As you might imagine, this is a very big deal when working with apps that contain valuable information within them. If you are working with something like that, then you definitely want to get to the root of what you are looking for right away. The ability for users to discover what they are looking for always begins at the development stage. When developers are working to create apps that people will actually use, they need to think carefully about the way that the average user is likely to approach the app. How is that user going to view the material that is accessible in the app, and where are they most likely to click? Those are the type of questions that developers should always ask themselves if they are serious about creating something that is going to stand the test of time. A post with code in it. Because it’s been a long time since the last one. If you work with ListViews in Android, as all Android developers will do at some point, you may notice that if you set your list items to be non-selectable the dividers that are drawn between each cell disappear. In the Holo Light theme you would normally get a thin light gray dividing line between cells. Depending on how you’ve implemented your adapter, you may find that these dividers become white/transparent when the cells are not selectable. According to Android framework engineer Romain Guy, this is the intended behavior. As Haythem Souissi points out in this Stack Overflow answer, you can work around this by ensuring that the areAllItemsEnabled method returns true, even though all items are not enabled (maybe none of them are). The isEnabled method will take care of actually disabling the cells and the dividers will be drawn between each of them. All very straightforward so far but it all goes wrong again when you try to add a non-selectable header view to the list. The way that ListView deals with headers and footers is that it creates its own adapter to wrap/decorate yours and insert the header/footer views in the appropriate places. This is fine but it’s not delegating the areAllItemsEnabled method, so our above fix no longer works. Fortunately, and unusually for Android, everything we need to resolve this issue is part of the public API. The adapter decorator class is android.widget.HeaderViewListAdapter. We just need to create our own instance, wrapping our own adapter, and override areAllItemsEnabled as above. There’s a slight complication in that we have to wrap the header view in an instance of ListView.FixedViewInfo and this is a non-static inner class of ListView, but we can reach into our bag of obscure Java tricks to create an instance from outside the enclosing class. // I assume you know how get a reference to the ListView and create your own adapter. ListView listView = (ListView) view.findViewById(android.R.id.list); CustomAdapter adapter = new CustomAdapter(context, listOfItems); // You can create any view you like for the header. TextView listHeader = (TextView) inflater.inflate(R.layout.list_header, null); listHeader.setText("My Header Text"); // This is how you create an instance of the non-static nested class, providing // it with a reference to an instance of the containing class (ListView). ListView.FixedViewInfo headerInfo = listView.new FixedViewInfo(); headerInfo.view = listHeader; headerInfo.isSelectable = false; // HeaderViewListAdapter insists on concrete ArrayLists. ArrayList headers = new ArrayList(1); headerInfoList.add(headerInfo); ArrayList footers = new ArrayList(0); HeaderViewListAdapter wrapper = new HeaderViewListAdapter(headers, footers, adapter) { @Override public boolean areAllItemsEnabled() { return true; } }; listView.setAdapter(wrapper); Create Something Unique for Android? Here is another thing that people sometimes forget about. They may want to consider creating something unique for the Android system. There are plenty of Android users out there, and it is a great platform on which to launch your application to get it started. If you discover that the ListViewer and every other piece of code you have placed into your app works out well on the Android platform, then there is a good chance that it will do great on other platforms as well. Thus, you may bring it over to those other platforms after you have given it a chance on the Android system. See what Android users love and hate about what you have created, and then fix the problems and move on to the next challenge. You may find that you have created something that users truly love and that you can market to other users on different operating devices (such as Apple iOS). The best thing to do is to figure out the issues that you may need to clean up while putting your material out to a large audience. The Android platform is a large enough audience that you should be in great shape if you begin there. They are also helpful in that they will provide you with the feedback that you may need to make your app just right. Don't Create Too Many Lists Finally, we leave you with the reminder that you shouldn't create too many lists within your app. Yes, you want people to come and check out what you are all about, but you do not want to give them the impression that they have to continue to click through sub-list after sub-list just to get to the materials that they are actually attempting to view. If you put them in a position like that, then they may feel that you are making things too challenging for them, and this is likely to upset some users. Get away from that by only using lists when they are truly necessary within your app. Otherwise, try to cut them out and keep a clean and crisp look to what you have created. At the end of the day, users want two things. The first is that they want an app that can help them solve whatever issue your app seeks to solve. The second is an app that has a user-friendly and clean look to it. You can give them both of those things if you just work with what you have created to make it as smooth and seamless as possible. It is not as challenging as you may at first believe. Give it a try, and discover a whole new world of possibilities.
July 24, 2022
by Dan Dyer
· 14,978 Views · 1 Like
article thumbnail
NetBeans Platform Offshore
Netbeans Platform Offshore has received an increased amount of attention given the massive amount of attention placed on the supply chain crisis that has occurred all throughout the world in recent years. Modern ships rely on NetBeans Platform Offshore and similar technologies to help guide them where they need to go. Thus, the world's reliance on Netbeans Platform Offshore could not be more obvious at this time. Better Software Systems Onboard Ships Make Them More Reliable Cargo ships and other naval vessels are very delicate pieces of equipment that can be easily disrupted by a malfunctioning piece of software equipment. If something goes wrong with the Netbeans system onboard, then a ship can be routed in the completely wrong direction from where it was intended to go. Obviously, the world of global commerce simply cannot allow for this to happen, and companies are responding to the need. Software Can Help Maintain Crew Safety Netbeans is being relied upon more than ever for crew safety at this point. After a review of all known marine system models, the Netbeans system was built to incorporate all of the best parts from each system to help promote safe passage and crew safety while on board the ship. At the same time, developers had to ensure that the enhanced security features would not hinder the ship from going where it needed to go. After all, the world of commerce moves faster than ever before these days, and there is no way that slowing the ship too much would be permitted by the companies that own and operate these vessels. They care about their profits and bottom line, and they wouldn't want to give those up too much. Modern ships and rigs have advanced computer systems for dynamic positioning, power generation and distribution, and drilling operations. Software errors in these systems lead to delays and non-productive time, and compromise safety. Marine Cybernetics performs independent testing and verification of computer system software to detect and eliminate such errors and weaknesses using Hardware-In-the-Loop (HIL) testing technology. Centralized Control and Overrides Two important things about the Netbeans system is that it provides both centralized control over the vessel and also allows for human overrides as necessary. If there is ever a situation in which the software program is incorrect in its assumptions or makes an error, humans can jump in and make the necessary corrections to get things right. It is wonderful to see the two things working in tandem, and it provides strong evidence that this is the way forward. Based on our extensive library of marine system models, we build applications and user interfaces for our testers and customers, based on the NetBeans Platform. The modular nature of our simulators and the diversity of test programs and vessel configurations make the NetBeans Platform a natural choice. Coupled with Maven, Hudson and an agile approach to software development, the NetBeans Platform enables us to quickly roll out new applications and adapt to the changing offshore industry. The screenshot above is taken from a Power Plant HIL Simulator, but we also make HIL simulators for Dynamic Positioning, Steering, Propulsion, Thrusters, Drilling Systems, Cranes and other systems. Our database of test programs and procedures is also powered by a NetBeans Platform application. Independently Verified Finally, one more reason to rest easy with the Netbeans system on board is the fact that it has been independently tested and verified. A third-party has been brought in to help ensure that the system is working as designed. That is clearly a very big deal because not every company would be so willing to work with outside auditors to ensure that everything was working as designed, but the makers of Netbeans are perfectly fine with doing exactly that. They want to make sure their systems are the safest and most tested on the planet, and they are not afraid to let another party poke around those systems to discover if this is the case. Continue to check out what Netbeans comes up with next as they are sure to provide the world with very interesting and useful equipment. Could More Useful Onboard Technology Help Supply Chain Issues? Unless you have had your head under a rock for the last several years, you are well aware of the fact that there have been some major supply chain issues that have caused trouble for seaports all throughout the world. Instead of getting things to customers right when they require them, many shipping companies have been woefully behind on getting their shipments to customers as designed. Thus, people are starting to ask if it might be possible to use onboard technology to help get the cargo from ships to where it needs to go much more quickly. Indeed, it does feel like there is some hope that some of the technologies that Netbeans has produced could help prevent some of the hang-ups at ports. This is not to suggest that Netbeans can do it all by itself, but there are plenty of people working on the problem, and it feels like a little extra guidance technology may be exactly what is called for to get the job done. Yes, there are going to need to be even more people hired to keep freight moving where it needs to go, but we cannot forget the fact that there are a lot of people counting on crews to bring their supplies to them in a timely fashion. The best way to reach that goal is to use the most up-to-date technologies in the world to make it happen. Navigation is a must for all shipping concerns, and having the best technologies on board means that one can finally get ships where they need to go. Estimates suggest that literally billions of dollars have been wiped off of the economies of the world because of supply chain issues. The fact that some of this can be remedied by just getting ships where they need to go is a wonderful piece of news for all involved. Tracking Shipping Containers and More Expectations are such that Netbeans may have the ability to track shipping containers and provide other valuable insights into what is going on in the world of shipping. If so, the value that they provide will surely skyrocket. The entire world relies on shipments that are brought to them via the ocean, and any system that can help make that process a bit smoother is going to be lauded as the next great thing when it comes to economic growth and stability. Netbeans is here to help bring that next chapter forward, and we all owe them a debt of gratitude for the work that they are actively doing to help all mankind.
Updated July 24, 2022
by Kristian Aaslund
· 13,847 Views · 1 Like
article thumbnail
How to Grab Eclipse Console Output Painlessly
Use this guide to grab eclipse console output effortlessly. After reading it, you'll be able to grab eclipse console output successfully. But before we dive into it, let's start by answering this crucial question: What is the Console in Eclipse? The Console in Eclipse is what will enable you to view the output of the utilities invoked when building a project or the program's output when you run or debug running the application. Typically, you will follow these easy steps to view the output: Click Window > Preferences. Expand C/C++ and Build, then click Console. If you want to display information on the latest project only, use the "Always clear console before building check box" option. Optimize Each Line Of the Eclipse Output In your plugin, if you want to do something with each line of your eclipse output console, for example, write that line to a file or parse it before sending it to your custom eclipse view, you should create a class that implements IConsoleLineTracker, and you should add this extension point to your plugin.xml. [img_assist|nid=1032|title=|desc=The steps are explained well here...|link=none|align=none|width=256|height=192] Now, suppose your class implementing IConsoleLineTracker is this: public class LogTracker implements IConsoleLineTracker { private IConsole m_console; public void dispose() { } public void init(IConsole console) { m_console = console; } public void lineAppended(IRegion region) { try { String line = m_console.getDocument().get(region.getOffset(), region.getLength()); // DO SOMETHING WITH THAT LINE } catch (BadLocationException e) { WrCheck.logError(e); } } } Copy the console output in Eclipse The best method you can use to copy a console is to tell Eclipse to save console output to a file. To do this, you need to go to Run → Debug Configurations on the Eclipse menu. Once you Debug Configurations successfully, then navigate under the Standard Input and Output section, click on the checkbox next to File: and choose the name of the output file to use. Get the full Console in Eclipse Are you trying to get full console in Eclipse? The good news is it's possible to get it. All you need to do is go to Windows --> Preferences --> Run/Debug --> Console and then unchecking "Limit Console Output" which is ON by default. This works on STS any version too. This would help print complete console output. For a Mac, it is Eclipse > Preferences > Run/Debug > Console. View the console log in Eclipse If you want to view the console login to Eclipse: You need to go to Run -> Debug Configurations on the Eclipse menu. Then, under the "Standard Input and Output" section, Click on the checkbox next to "File:", and choose the name of the output file to use. If you check "Append" underneath, console output will be appended to the output file. How do I save data on the console? There will be times when you'll need to save data on the console. To do this, all you need to do is right-click > go to Save button, which is in the Console panel. It will allow you to save the logged messages to a file. In a situation where you have an object logged, then you can use the following steps: Right-click on the object on the console and click Store as a global variable. The output will be visible as "temp1.type in console". Copy (temp1), And paste it to your favorite text editor Install a detached console in Eclipse Want to attach the console to the main eclipse window? Follow these easy steps: Click Window->Perspective-> then go to Reset Perspective to detach it. EFCARDZ TREND REPORTS WEBINARS ZONES DZone > Performance Zone > Remotely Debugging an Eclipse Plugin Upgrade Eclipse Follow the instructions below to upgrade Eclipse: On the toolbar, navigate to Window > Install New Software. Click on Add and add the following URL for the latest build of Eclipse: https://download.eclipse.org/releases/latest. Alternatively, you could add the specific build of Eclipse you want from https://download.eclipse.org/releases/ such as: https://download.eclipse.org/releases/photon/ or go to https://download.eclipse.org/releases/2019-09/. Once the site is added to Eclipse, you can now proceed with the upgrade by navigating to Window > Help > Check for Updates. This basically goes through all the sites under Window > Preferences > Install/Update > Available Software Sites and gathers updated details from the ones that are selected. You should be able to see a pop-up listing the various plugins/tools that require an update. You have the option to select the ones that you need, or you can leave them as is. Then, click Next. Click Next after reviewing the details. You should now see the review license page. Click on the radio button "I accept ...." and click Finish. Remotely Debugging an Eclipse Plugin The Eclipse plugin can be debugged from inside the IDE while in the development phase, but once the plugin is installed in the IDE, we need to debug it remotely for bug resolution. In this quick tutorial, I'm going to explain how to debug an Eclipse plugin remotely. Plugin Project Let's suppose we have developed our simple Hello World plugin and installed it in our IDE. Now, to debug the plugin remotely, please follow the steps below. Step 1 Open the first instance of Eclipse IDE pointing to the workspace where your Hello World plugin project is located. Step 2 Navigate to the eclipse.ini file of your IDE. Here is a screenshot of the location of the file in macOS. Now add the following JVM arguments to the file: 1 -vmargs 2 -Xdebug 3 -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 Step 3 Now, open another instance of the Eclipse IDE (on macOS, use the command open -a -n Eclipse in the terminal). This instance will point to a workspace different from the one which contains the Hello World plugin project. Step 4 Now, in the workspace containing the Hello World plugin project, make the following remote debug configurations/; Navigate Run -> Debug Configurations -> Remote Java Application. Then hit the debug button. Also, do not forget to put break-points in the code of the Hello World plugin to be debugged. Step 5 In the other workspace (which does not contain the Hello World plugin), try to use the Hello World plugin and it will be remotely debugged in the other instance of Eclipse. Conclusion There are Eclipse-based IDEs that have a powerful feature to make ‘variants’ of the same projects. Use the to Build Configurations, which are a powerful feature in Eclipse. They will allow you to make ‘variants’ of a project. The project will share the common things, and you can simply tweak things one way or the other for example to produce a ‘release’ or a ‘debug’ binary of my application without duplicating the project.
Updated July 24, 2022
by Raffaele Gambelli
· 46,666 Views · 1 Like
article thumbnail
Java - Example Very Simple Player (JMF)
If you wonder what a JMF player is, you are in the right spot. We've noticed that many aspiring developers want to try it out but are unsure how it works. Hence, we decided to put together this guide to make things a tad easier for you. package org.jmf.example; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.plaf.metal.MetalLookAndFeel; public class ExampleJMF { public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); try { UIManager.setLookAndFeel(new MetalLookAndFeel()); } catch(UnsupportedLookAndFeelException e) { e.printStackTrace(); } new exampleFrame(); } } But before we dive into it, let's answer this crucial question: What is Java? Java is a high-level language that programmers use to develop projects with few implementation dependencies. Java has transformed the web in many ways. A vast majority of online tools that we use today were built on Java. That includes websites mobile apps and multimedia playback platforms. This programming language has come a long way. This year it will be 27 years since James Gosling developed it. What is a Java Media Framework JMF is an API that enables you to play, process, and capture media audio and video. Whether you want to transmit or receive live media broadcasts and conduct videoconferences, you can easily do it thanks to this API. All thanks to RTP ”Real-time Transport Protocol of the JMF. A JMF is a straightforward player that encapsulates your multimedia component and allows you to control your player. It also offers methods that enable you to acquire necessary resources and query the current state. These are tools you will use to build page objects. For instance, if you want to scan the page and create a class. Here is what Java Media Framework can do: A multifunctional tool A JMF comes in handy, especially if you're looking for a tool that can scan a page and build a class. You can also use it to create prototype code and later build a robust application. Instrumentalization A lot of what you read about the topic of Observability mentions the benefits and potential of analyzing data, but little about how you collect it. This process is called “instrumentation” and broadly involves collecting events in infrastructure and code that include metrics, logs, and traces. There are of course dozens of methods, frameworks, and tools to help you collect the events that are important to you, and this post begins a series looking at some of those. This post focuses on introductory concepts, setting up the dependencies needed, and generating some basic metrics. Later posts will take these concepts further. An Introduction to Metrics Data Different vendors and open source projects created their own ways to represent the event data they collect. While this remains true, there are increased efforts to create portable standards that everyone can use and add their features on top of but retain interoperability. The key project is OpenTelemetry from the Cloud Native Computing Foundation (CNCF). This blog series will use the OpenTelemetry specification and SDKs, but collect and export a variety of the formats it handles. The Application Example The example for this post is an ExpressJS application that serves API endpoints and exports Prometheus-compatible metrics. The tutorial starts by adding basic instrumentation and sending metrics to a Prometheus backend, then adds more, and adds the Chronosphere collector. You can find the full and final code on GitHub. Install and Setup ExpressJS ExpressJS provides a lot of boilerplate for creating a JavaScript application that serves HTTP endpoints, so it is a great starting point. Add it to a new project by following the install steps. Capture media streams Not only does the JMF allows you to play music, but you can use it to capture media content as well. And all this will happen while you process and capture it from a source to a destination. You'll then identify each media stream by its content format. From there, the JMF will present the content of that specific video stream. Each media stream will have at least one or more tracks that you can play. Identify each media stream by location You can either identify your media stream by using uniform resource locators (URLs) or media locators. It doesn't matter how you locate them. What matters most is that you wouldn't struggle to identify each media stream. Process Time Bases and Clocks You can also play time-based media, or capture them at an accurate time. To achieve this, JMF requires time-bases and clocks. So, without a thorough understanding of time bases and clocks, you won't be able to work with JMF. While at it, use the below 1. Eliminate Unused Tables Usually, when you remove or deactivate a plugin, all the database tables remain. This can be a good thing, as you retain all the user information, preferences, and other data. However, in most cases, you’re left with a cumbersome dataset that may bring your server’s performance down. If you’re using WordPress, you can get rid of leftover tables by installing a plugin called Plugins Garbage Collector. It scans your database for any unused tables, and you can delete the ones that you know aren’t needed. A more hands-on approach is finding inactive tables using the UPDATE_TIME string. 2. Create an Execution Plan The execution plan’s main goal is to display the various methods of retrieving data by containing the operation's type and order when creating a query. If you’re not familiar with execution plans, here’s a video going through the basics. The typical execution plan includes the following: Types of operations Order of operations Indexes to use Row count estimates from stats Row count actual from results 3. Use Proper Indexing Indexing allows for faster access to the database and speeds up the queries. If you don’t use indexes at all, then processing the queries becomes painfully slow. Yet, over-indexing your database is also ineffective. Unfortunately, there isn’t a golden rule for optimizing your database the right way. However, with some trial and error, your database benefits from an index system. 4. Avoid Coding Loops A SQL query that runs more than once is inefficient and can cause unnecessary performance issues, which pile up quickly, especially with large datasets. In essence, moving a query outside a loop with the goal of it executing only once is the way to go. There are a couple of nifty solutions to achieve this. Use JOIN and GROUP BY to select data from multiple tables and have the database perform the counting with a single query. This is especially effective for multiple queries, including COUNT and MAX clauses. 5. Get Rid of Correlated Subqueries Correlated subqueries are essentially coding loops. The subquery runs row-by-row until it satisfies the parent statement. This method of processing is useful when the outcome relies on multi-part answer validation. You can avoid the correlated subqueries by using JOIN clauses, which makes the query run more efficiently. Essentially, this method replaces WHERE and removes the necessity to execute the subquery for each row separa 6. Avoid * Queries The ultimate goal of every query is to retrieve relevant data for maximum efficiency. However, it’s relatively common to use SELECT * clauses when creating a query resulting in unnecessary data. While it doesn’t play a massive role in the performance of small datasets, it can leave a significant dent in larger ones. Selecting the data sparingly helps with optimizing the query speed and reduces resource usage. A quick way to turn this issue around is using the LIMIT clause instead of SELECT *. This way, you limit the output of the query results unless you do need the entire dataset retrieved by the query.
Updated July 24, 2022
by Snippets Manager
· 10,217 Views · 1 Like
article thumbnail
Realm Academy Offers Mobile Development Tools That You Need
Realm Academy has free mobile development tools to help you change the world.
Updated July 24, 2022
by Tom Smith DZone Core CORE
· 3,479 Views · 2 Likes
article thumbnail
Collecting Usage Data in Eclipse
Tracking open-source data users is harder than you think, but the Eclipse Foundation is trying to make it happen
Updated July 24, 2022
by Mike Milinkovich
· 18,277 Views · 1 Like
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
· 9,089 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,515 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,396 Views · 1 Like
article thumbnail
Develop Web Apps in F# with WebSharper
A New Programming Language Has Grabbed the Spotlight Programmers universally stand up and take notice when a new programming language takes hold. Sometimes, those programmers are eager to give it a try and see what it is all about. In other cases, they may pan the whole thing as not being the right fit for what they need out of it. Either way, there is no question that programmers will at least take a look at what this new language is about and try to determine on their own if it has real value for them or not. Right now, that programming language is F#. Microsoft bills this as a programming language that may be used to create "robust, and succient" code. They say that it makes things easier on programmers and that the number of applications where this language may prove useful is nearly endless. Indeed, it does seem like there are many upsides to using this particular programming language. F# is a relatively new language for Microsoft's .NET framework that is quickly gaining momentum in the financial and scientific software development communities. IntelliFactory believes that it can forge a new path for F# in the mainstream web application space. In less than two weeks, the company will debut its WebSharper platform for writing web apps in F# that are easily compiled into JavaScript for the client-side. F# is a three-paradigm language that uses imperative, functional, and object-oriented programming (class-based). New programming design approaches that are not easily expressed by just objects are possible with F#. The functional programming capabilities can also lead to some mind-bending code. F# is a strongly typed language that uses a type interface so that data types don't need to be explicitly declared. It includes a functional programming component that supports eager evaluation. The language also uses pattern matching to resolve names into values. In ASP.NET development, F# also offers productivity advantages over VB and C#. F# is different because it is statically checked and type-safe. It addresses weaknesses in ASP.NET development like untyped values, complex form construction, and using strings for IDs and method names that connect markup with code-behind (class-files). Writing a web application in F# on the WebSharper platform can be less time consuming if a developer is not great at writing web apps in JavaScript. Through WebSharper, developers can write a web app using a large subset of F# and .NET core libraries and then just let WebSharper map the code to JavaScript. WebSharper can integrate with ASP.NET applications, but it is different from the standard approach because it builds applications from miniature web pages called "pagelets". The pagelets correspond to functions on the client-side and they are automatically translated into JavaScript. WebSharper supports a wide range of JavaScript libraries, making it easy for developers to optimize their code in whatever way they choose. jQuery, qooxdoo, Flapjax, and Yahoo UI are all supported by WebSharper. The leap from F# to JavaScript is manageable because both are functional languages that support lambda expressions and closures. Another unique part of WebSharper is a "formlet". A formlet is a special pagelet that provides form functionality. Formlets in Web Sharper run and validate on the client, submitting their result to either a client- or a server-side callback. jQuery auto-complete WebSharper will be released on February 8th. Pricing has yet to be determined, but customers will be required to pay for support. WebSharper comes fully integrated into Visual Studio. Want to get ahead of the curve before F# really takes off? DZone's Essential F# refcard can jumpstart your exploration into Microsoft's newest language. The card was authored by Chance Coble and Ted Neward. What People Love About F# F# is still relatively new as far as programming languages are concerned, and this means that there is still a lot to learn about it. That said, there are people from all over who are clamoring for it already. A few of the reasons why they love it include: It is Interactive This coding language responds well to virtually any challenge that you throw at it. It is interactive in the sense that it updates to the latest developments and challenges that you throw its way. It will move along with you as you work through the various steps required to get it working exactly how you want it to. For most people, this is a top benefit. They don't have time or energy to slow down and try to get their programming language to catch up to whatever it is that they are doing. Fortunately, they don't have to worry about this as much because they can simply use the F# system to take giant leaps and bounds in the right direction. It is User-Friendly There are many pieces of programming code that get complex and in the weeds with the programming side of things that they are not efficient tools to work with. Instead, it seems like those programming languages are practicing a bit of gate-keeping in the sense that they don't allow non-programmers to make much progress with them. The last thing in the world that true developers want is for people to feel like they are unable to do their programming. The beauty of programming is that you never know who might create the next big thing. However, this can only happen if the tools they use make sense to them. Fortunately, the F# programming language is adapted for people who are not necessarily programmers themselves. A Flurry of New Apps May Come From WebSharper WebShaper is making it easier for anyone to get involved with creating their own apps for the Internet via their platform. You don't have to have any extensive knowledge of coding or app development in order to get involved. In fact, the entire platform is designed with beginning users in mind. The goal is to make things as simple and straightforward for them as possible. A great way to make this all happen is to use WebSharper to start creating today. People say that it is: Easy to get on and get started Great for beginners Encouraging people with new and interesting ideas In short, the WebSharper platform is exactly what people are looking for when they are first getting started in their app development journey. It gives them the space to be flexible and interesting, but it is also not overly complex. Think of it as the training wheels for app development. You can make a lot of mistakes with training wheels and still be just fine. You are still learning at this time, so it just makes sense that you would want to try out your ideas in an environment where it is safe to do so. WebSharper is that space. If you are still uncertain about how to get started or if app development is right for you, poke around the platform for a while and see what other people are up to. What you may be surprised to find is that there are many people just like yourself who have some basic questions about how things work and what steps they should take next. This should give you some confidence that you are among people at a similar skill level as yourself.
July 24, 2022
by Mitch Pronschinske
· 17,277 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,571 Views · 1 Like
article thumbnail
You Should Never Use Flags For Language Choice
Flag icons are a poor choice when coding
July 24, 2022
by Janko Jovanovic
· 37,116 Views · 2 Likes
article thumbnail
Sun To Push Zmanda Backup for MySQL
Cloud backup is more important than ever, and it needs to be respected and understood.
July 24, 2022
by Maureen O'Gara
· 7,423 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,693 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,453 Views · 2 Likes
article thumbnail
Build an RSS Reader for Windows Phone 7
In this lesson, I will create a simple RSS(Really Simple Syndication) Reader for Windows Phone 7. I will use Linq-To-XML for reading an RSS feed. The user interface will contain a Textbox to enter an URL of an RSS Feed and a ListBox element to display results. Source code RSS Reader source code (.zip) Additional information What is RSS? (Wikipedia) 1. Creating a new project First of all, you need to create a new project. To do so open Visual Studio 2010 -> File -> New Project -> select Windows Phone Application there as it is shown in the picture below. eugenedotnet creating windows phone 7 project 2. Adding a new reference to solution Next, you need to add a reference to Microsoft.Xml.Linq library. You need to right-click on the References directory under your project and select Add Reference there. Under the .NET tab, you will find Microsoft.Xml.Linq, push OK. Check the screenshot below. eugenedotnet add Microsoft.Xml.Linq reference 3. Modifying header This step can be optional, but I have decided to add it to the lesson. In this step, we simply modify the TitleGrid element to specify the title of the application. 4. Modifying ContentGrid ContentGrid will contain all the required UI elements to operate with our application. Basically, there will be three of them: TextBox for user to enter an URL of a RSS Feed Button to trigger an event to read feed ListBox to display results using the Data Binding feature of Silverlight (e.g {Binding Title} ). ListBox will display a title and a link to each of the results. NB! Pay attention that click event is added to a button in XAML. Also, notice the new InputScope feature of Windows Phone 7 is applied to TextBox making it easier for users to enter URLs into the Textbox element by providing a URL-specific virtual keyboard (SIP) layout by default. 5. Creating a class for a single RSS Feed item Now we simply need to create a new container-class for holding RSS Feed data. public class RSSFeedItem { public string Title { get; set; } public Uri URL { get; set; } } 6. Implementing event functionality Next, we need to write a code for processing the “Read” button click event. It should create a new URI object and pass it to the ReadRss method to begin reading an RSS Feed. private void btnReadFeed_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(tbRSSFeedURL.Text)) { ReadRss(new Uri(tbRSSFeedURL.Text, UriKind.Absolute)); } } 7. Implementing application logic First of all make sure that MainPage.xaml class (codebehind) is using the following references. using System.Xml.Linq; // for reading RSS using Linq-To-XML using System.IO; // for Stream object Next, you need to implement a ReadRss method that takes URI (URL) as an input parameter. If the request is successful then the application will process the results of reading an RSS feed (but only 10 first according to. Take(10) line in code) and add them using ForEach to a listbox. ListBox will display results according to the Data Binding specified above. public void ReadRss(Uri rssUri) { WebClient wclient = new WebClient(); wclient.OpenReadCompleted += (sender, e) => { if (e.Error != null) return; Stream str = e.Result; XDocument xdoc = XDocument.Load(str); // take 10 first results List rssFeedItems = (from item in xdoc.Descendants("item") select new RSSFeedItem() { Title = item.Element("title").Value, URL = new Uri(item.Element("link").Value, UriKind.Absolute), }).Take(10).ToList(); // close str.Close(); // add results to listbox listboxRSSFeedItems.Items.Clear(); rssFeedItems.ForEach(item => listboxRSSFeedItems.Items.Add(item)); }; wclient.OpenReadAsync(rssUri); } The Origins of Windows Phone 7 Windows Phone 7 is the first iteration of a mobile client operating system that Microsoft released for worldwide distribution in October 2010. Over the years, there have been various iterations of Microsoft’s mobile operating system, culminating in Windows 10 Mobile. However, the operating system and Microsoft mobile phones never really took off and, despite features like the RSS feed functionality described above, January 2020 saw the end of life with the final cumulative update issued officially by Microsoft. Windows 10 Build 15251.603 was rolled out to the Lumia 950 and HP Elite x3 without much fanfare and lacking a detailed changelog. Clearly, the company was cutting its losses and moving on. For those with the Windows Mobile 10 OS, the final update included some security fixes as well as a few general improvements. None of which was much to write home about. Indications are that the security bugs that were fixed are related to the Windows Kernel, Input, and Composition as well as a few additional components. For those who were unlucky enough to own the Windows Phone, Microsoft confirmed in 2020 that they would no longer support the phone. If it’s still working, you can still use the phone, but apps such as WhatsApp may no longer function. Device Backups But all was not lost as you could still backup your device. Your settings and data were safe until March 2020, at which time Microsoft abandoned their customers and scrapped the ability to access backups too. They back-pedaled a bit by informing everyone that the photo uploads and a few other features would still be available for a further 12 months and that it really was a good idea to make other arrangements to retrieve and store any valuable or sentimental data, voice, and image files. Support for Office Apps It's not unexpected that Microsoft didn’t treat Office Mobile apps for Windows 10 as an urgent priority. The support for Office apps ended in January 2021 with a trickle of security updates coming through during the course of 2021. Microsoft’s Advice - Switch to Android or iOS For those customers still looking for alternatives, Samsung and Apple were obvious alternatives. These Android and iOS-supported devices were on Microsoft’s list of mobile platforms to receive updated apps. The expectation is that the customers who were let down in the past were likely to continue to support the company that failed them in the past. Time will tell whether this is the case or not. For those users who are still interested in RSS feeds, there are various options in both the Google Play Store and the Apple store. Although RSS feeds have largely been replaced by followers joining mailing lists of their favorite brand or blogger, there are still a few diehard holdouts who are comfortable receiving an aggregated service via RSS feeds.
July 24, 2022
by Jevgeni Tšaikin
· 19,762 Views · 1 Like
article thumbnail
Dependencies: It’s Not Just Your Code You Need to Secure
Developers must not only check our code for vulnerabilities but also our dependencies to make our applications more secure.
Updated July 24, 2022
by Nando Delgado
· 5,488 Views · 4 Likes
article thumbnail
5-minute Observable.FromAsyncPattern sample for Windows Phone 7
If you are looking to create code that models the observable.fromAsyncPattern, you can get started with some basic key types. You’ll need to be able to develop your own implementations from IObserver or IObservable. Here you can develop the sequences you want with the data that you want. Learn the basic elements of observable sequences, how to get values into them, and how to select the values you want from them. We can look to Windows Phone 7 as an example. As we have already noted, the Windows 7 mobile platform is galaxies ahead of Windows 6.5 and the market reports and brand love indicate a strong concurrence with that. Not many developers know that Windows Phone 7 SDK comes pre-bundled with Reactive Extensions (Rx) that dramatically simplify work with asynchronous calls. Despite Windows mobile sales falling four percent last year, this is worth a look. In this article, I am going to focus particularly on Observable.FromAsyncPattern that allows developers to combine two Begin/End calls. For example, when working on reading streams. Developers can do this, by working into a single asynchronous call. If you are familiar with basic function composition, this won't be too hard of a topic to understand. What is the Observable.FromAsyncPattern? When you want to code Observable.FromAsyncPatterns it can be easy to feel overwhelmed. You’re putting the cart before the horse if you think this way. Like every coding project, you need to take this one at the one sequence at a time rate. Microsoft’s coder describes his passion for the development process of this Windows experience as evangelism. It’s difficult not to get excited about it, but you need to take it one concept at a time. You simply need to understand Rx coding and the basics of getting started. Observable sequences are the key here. It’s all about what values you are selecting. You can use LINQ as well in order to understand your Rx coding. It’s about going back to the basics of functional programming. Each group of query operators will have its own function. These will form dependencies of sorts wherein other operators can glean from them or be constructed from them. Deconstruct the code yourself and you will see how it works. The deconstruction should show you some insight into the intricacies of the Rx staircase so to speak, with some queries and functional programming built-in as well. Additionally, you should be able to create custom fields and operators that meet your software’s needs. To develop the sequence you are looking for, the Subscribe method as an Rx extension would be my first recommendation. Use the arrays of IObservables to determine what the Rx sequence would be, and the Rx libraries would indicate that as well. To develop the sequence you are looking for, the Subscribe method as an Rx extension would be my first recommendation. Use the arrays of IObservables to determine what the Rx sequence would be, and the Rx libraries would indicate that as well. The FromASyncPattern is a means of making calls. This coding will wrap one asynchronous call to either start or end an asynchronous method of making calls, actual phone calls. This is an effective tool for Windows Phone 7. A wide range of operators can take many different values and parameters here. Understanding the ToAsync pattern will help with developing the FromAsyncPattern knowledge base but it isn’t necessary. You can use the Rx coding to develop your observable and assign the numbers to your generic functions. The coding for BeginInvoke and EndInvoke are ideal initial parameters. Not lots of developers know that Windows Phone 7 SDK comes pre-bundled with Reactive Extensions (Rx) that dramatically simplify work with asynchronous calls. In this article, I am going to focus particularly on Observable.FromAsyncPattern that allows developers combine two Begin/End calls (for example, when working on reading streams) into a single asynchronous call, and if you are familiar with basic function composition, this won't be too hard of a topic to understand. How Rx Theory Works For now, rather than talk about the theory behind FromAsyncPattern, let's take a look at a specific example - handling a web request. The standard way of doing this would be initializing a HttpWebRequest and asynchronously getting the response via BeginGetResponse (also passing a callback that will handle it). HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://bing.com"); request.Method = "GET"; request.BeginGetResponse(new AsyncCallback(GetResponse), request); So the callback can handle the response the way you want: void GetResponse(IAsyncResult res) { HttpWebRequest request = (HttpWebRequest)res.AsyncState; HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(res); Debug.WriteLine(response.ContentType); } Rx allows you to go around the whole async call in one line. So to say: var n = Observable.FromAsyncPattern(request.BeginGetResponse, request.EndGetResponse)(); If you analyze n, you will see that its type is defined as IObservable. In its core, IObservable might be a new interface to some of the developers that are currently reading this. So let's dive into some theory now. Working With Specified Enumerations Usually, when you work with specific enumerations, there is IEnumerable/IEnumerator that can help you navigate through a generic collection of returned objects. GetEnumerator (caled out of IEnumerable) will get the associated IEnumerator, that will go through each object in the collection (via MoveNext) setting the Current value to the selected object. A pretty simple concept that shows how data can be pulled from a collection. IObservable on the other side is the complete opposite of IEnumerable because it reverses the process - instead of data being retrieved by the program via IEnumerator, it is now pushed back to it by the environment via IObserver, with which the application interacts (talking about the concept of interface duality here). When you need to obtain the data that is being pushed as a result of the call (in this case, in n), you need to use Subscribe and pass a handling method: n.Subscribe(HandleResult); What's done behind the scene here is that an observer is actually created that will be handling the pushed data. It might be a bit confusing as to why the returned type is IDisposable and the answer is simple - so that it will be possible to un-subscribe and dispose the observer once there is no more need to receive pushed data. And then again, you can handle the result as you want: void HandleResult(WebResponse res) { Debug.WriteLine(res.ContentType); } Of course, this entire operation can be unified in one line: Observable.FromAsyncPattern(request.BeginGetResponse, request.EndGetResponse)().Subscribe(HandleResult); Using the Windows Phone 7 Example One thing to remember here is that on Windows Phone 7, the maximum number of passed parameters is 2 (Func) - in a regular application this extends to 29 overloads and 14 possible parameters. Working directly with System.Linq.Observable is currently not possible on the phone and will fail to compile, the issue being "Error 427 'FromAsyncPattern' is not supported by the language". On the device itself, many asynchronous tasks can be simplified by using FromAsyncPattern, since you can combine various asynchronous functions - even the least common ones since there are some overloads present that allow you to pass additional parameters that will be passed to the asynchronous functions. One important consideration to remember is that there should be the starting and end methods (to start the async processing and to end it accordingly). Create Your Sequence Creating the observable sequence is the key here, and Windows Phone 7 has shown us it can be done. It’s an interesting concept and we know Windows brand passion is still there. You want to start with the sequence and then use it for consumption. When you do this, you have the wiggle room to use operators and develop the appropriate queries.
July 24, 2022
by Denzel D.
· 22,687 Views · 1 Like
  • Previous
  • ...
  • 678
  • 679
  • 680
  • 681
  • 682
  • 683
  • 684
  • 685
  • 686
  • 687
  • ...
  • 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
×