Thursday Jan 30, 2014

Internet of Things (IoT) Hackathon in Brazil

SouJava is running a Raspberry Pi and Java hackathon at Campus Party, the week-long technology gathering of geeks, developers, gamers, scientists, and students in Brazil. Sponsored by Oracle Technology Network, the hackathon is designed for enthusiasts who want to create IoT projects with Raspberry Pi and Java. The objectives are for attendees to learn, practice, and innovative while creating an IoT project

Java evangelist Angela Caicedo opened the hackathon with an overview of IoT and Java development. Over two days, participants will build teams, brainstorm, attend training, get a kit from the organizers and hack on their own project. Onsite experts will be available to help participants. They are veteran Java developers of web, enterprise and embedded development. Among them are GlobalCode founder Vinicius Senger, senior developer Rubens Saraiva, SouJava leader Bruno Souza, Java Champion Yara Senger, product manager Bruno Borges and senior mobile developer Ricardo Ogliari 

Learn more about IoT:  
- IoT community page highlighting projects, discussions, hobbyists, and experts

Wednesday Jan 29, 2014

Gamification for User Groups

At the gamification session of the International Oracle User Group Community (IOUC), leaders discussed how to drive membership. Typically, they give away licenses, books and goodies to encourage attendance at monthly meetings. Others have used gamification to get their communities to brainstorm on mascot names, or post pictures and comments on social media. Hackathons also require the use of similar techniques to keep attendees motivated to create applications over several days. SouJava leader Bruno Souza successfully ran hackathons that combined brainstorming, team building, training, hacking sessions and prizes to keep participants engaged.

“Turn life into a game, drive engagement of audiences, make the experience more enjoyable and get users to come back ” are the key advantages of gamification according to user group leader Jim Bethancourt.

The forum platform Stack Overflow is a great example of running a thriving community of developers with its point systems. Contributors get rewarded with points for their useful entries and visitors easily find the most relevant and best-rated entries.

The ArabOUG has implemented a point system to keep its community active. The group gives out points to the members, who contribute applications, articles, and translations. It partnered with training organizations and other services to give its members free training and services in exchange for points. As a result, members don’t have to pay for services using online payments, which governments in many countries in North Africa and the Middle East don’t allow.

In an interview, ArabOUG leader Mohamed Chargui  explains in more detail his experience using gamification.

Thursday Nov 28, 2013

Java Mission Control - Production Time Profiling Out of the Box

By Guest blogger: Marcus Hirt

With the release of 7u40, there is a new kid on the JDK tooling block – Java Mission Control. This article will try to explain why it is worthwhile to take a closer look at this technology, as well as provide pointers on how to get started. 

History

Mission Control is a production time profiling and diagnostics tools suite that originated with the tooling available for the JRockit JVM. 

As part of the development effort of the JRockit JVM we started building tooling for analyzing the runtime performance of the JVM. We needed information about how real production systems were utilizing JRockit. Requests to get customers to lend us their latest top secret trading applications for evaluation in-house were usually, quite understandably, met with telling blank stares calling our sanity into question. It probably wouldn’t have done us much good anyways, since we wanted production data from systems under real loads. Thus we built a tool (the JRockit Runtime Analyzer, which later evolved into the JRockit Flight Recorder) with low enough overhead that we could convince customers to actually use it to collect production time data for us.

Eventually we accidentally solved some customer problems using the tools and customers started asking us if they could license them. The idea was born to spend some more resources on the tooling and make it a commercial tool to pay for its development. JRockit Mission Control was born.

Java Mission Control

After Oracle acquired Sun Microsystems, Oracle suddenly had two of the top three most commonly used general purpose JVMs available on the market. One was the open sourced reference JVM, with a lot of people knowing the source and licensees basing their own ports and versions of JVM off of it. The other JVM, whilst being a quick and pretty little thing, was proprietary with a rather small number of people knowing the code base. Instead of having to support two JVMs, Oracle wanted to pool the available resources into building a best of breed JVM. It was decided that the base would be HotSpot and that the most useful features in JRockit would be ported over – one of them being Mission Control.


In JDK 7u40 the functionality available in HotSpot had reached critical mass, and the very first version of Java Mission Control (unfortunately versioned 5.2.0) was released. It mainly contains equivalents of two of the JRockit Mission Control tools – the JMX Console and the Flight Recorder. There is no on-line heap analyzer yet. There is however a set of quite useful (experimental) plug-ins for JMC, extending Mission Control to do heap dump analysis, targeted analysis for various oracle products or simply extending existing functionality in more (or sometimes less – yes, I’m looking at you Twitter Trigger Action) useful ways .

Getting Started

Starting Java Mission Control is quite easy. Download a recent enough Java 7 JDK (7u40 or later), then simply launch %JDK_HOME%/bin/jmc. The alien thing that now starts is not, as I am sometimes asked, a native application. It’s Java, but it’s built upon Eclipse RCP technology. If you would rather run JMC inside of Eclipse, you can install JMC into your Eclipse from the JMC update site. A word of caution here – because of a bug in Eclipse/SWT, Mission Control performance is horrible in Eclipse 4.x. This bug is slated to be be fixed in Eclipse 4.4, but until then I strongly recommend either using the stand-alone version of JMC, or installing it into an Eclipse 3.8.2. 

The JMX Console

The console in Mission Control can be thought of as a JConsole on steroids. It allows you to monitor JMX data in various ways, to take action when attributes attain certain values and to persist the data and later look at what has been recorded. There are various experimental plug-ins for the console, such as a Coherence plug-in, a plug-in for running JConsole plug-ins and a plug-in for tweeting messages when a action triggers. 

To connect the console to a JVM, simply choose the JVM you want to connect to in the browser tree and select Start JMX Console. If the JVM was started locally or with JDP, then it will automatically appear in the JVM browser. If you have a remote JVM without JDP running, just enable the built in JMXRMI agent as you normally would to be able to connect with JMX clients such as JConsole.

The JMX console is typically used to monitor a small set of critical attributes, such as the CPU load and Java Heap usage, sampled at a relatively low frequency. The console can be configured to take action when undesirable values are reached for an attribute, and one of those actions can be to dump Flight Recorder data. The JMX console also contains special tabs for looking at thread information, such as deadlocked threads, per thread allocation information and per thread profiling information. That said, the JMX console is used for monitoring the runtime. When profiling capabilities or better diagnostic information is needed, the one stop shop is really the Flight Recorder.

The Java Flight Recorder

The Java Flight Recorder can be thought of as of the equivalent to the Data Flight Recorder for an airplane, but for the Java runtime. While it is running It records information about the JVM and its environment. When something “interesting” happens, the data in the Flight Recorder can be dumped, and the information analyzed off-line to gain an understanding of why everything suddenly went from good to “interesting”. Having the Flight Recorder running as an almost unnoticeable impact on the performance of the Java Application running in the JVM. The overhead is usually well below a per cent. This is achieved by having a high performance recording engine built directly into the runtime and collecting data already being tracked by the runtime or as part of an activity where the data is reachable. (As opposed to actively having to do additional work to get the data.) There are a lot of interesting things that can be said about the recording engine implementation, but this being an overview article, I’ll just move on to how to use it, not how it does what it does.

Creating Flight Recordings

The most important difference to how the Flight Recorder worked in JRockit is that in HotSpot two JVM start-up flags must be enabled on the JVM for which you want to do flight recordings:

-XX:+UnlockCommercialFeatures -XX:+FlightRecorder

And that was probably the most important line in this article. 

There are two different types of recordings, and you can have multiple recordings (of different types) running simultaneously:

1. Timed recordings 

These recording run for a pre-configured duration. They are automatically stopped when the time is up. If initiated from JMC, they will be automatically downloaded and opened in the user interface when done. 

2. Continuous recordings 

These recordings have no explicit end time and must be dumped by the end user. 

Now there are three different ways you can do actual recordings, once the parameters are in place:

1. From Mission Control. This is probably the easiest way. Just point and click. 

2. From jcmd. This is a very useful way to control the Flight Recorder from the command line. Quite useful when you can’t access the machine that is running the JVM of interest from Mission Control and you only have access to a shell. 

3. Using command line flags. This is handy when you want to always run with a continuous recording, or when you want to record the start up behaviour of the JVM right from the very start. 

If you want to know more about how to create Flight Recordings, this blog entry is probably a good place to start. 


Analyzing Flight Recordings

There is a lot of useful information in the flight recordings, and there are a lot of different things the information can be used for. For example:

Method profiling. The Flight Recorder will quite happily do method profiling in production systems with a very low overhead. As a matter of fact, it’s even enabled in the continuous template, so go ahead and use it. It will tell you where the hotspots are in your application. In other words, if you have a CPU bound problem, the method profiling information will tell you where to optimize to get things to go faster. 

GC profiling. The GC implementations emit useful events at GC related activity. Information that can be used to check on the live set, semi-refs, GC pauses (and their individual sub-phases) etc. Quite useful for GC tuning, finding out if you’re overusing finalizers and more. 

Allocation profiling. If you do notice a lot of garbage collections, but don’t notice anything strange about the individual GC phases, you may want to kick back a bit on the allocation. Allocation profiling will help you see where all that allocation activity is putting it’s toll on the memory system. 

WebLogic Server analysis. WebLogic is producing its own set of events for the Flight Recorder. They are quite useful in their own right, but can also be good for putting all the other information recorded in a context - “What was really happening during this transaction?”. This article on the Operative Set shows some of the capabilities. 

Latency Profiling. The Flight Recorder has a lot of different events for various thread stalling activities that can occur, such as blocking on monitor enter, parking, waiting etc. I can’t believe I haven’t written a blog post on this yet. Shame on me. This is usually the first place to look if you haven’t got a CPU bound problem, but still performance issues. 

OS information. CPU load, JVM CPU load, environment variables, running processes – there is a lot of operating system information. If you still can’t find what you’re looking for, Mission Control has a D-Trace plug-in for retrieving everything you ever wanted to know, but were too afraid to ask. Note that the overhead from using D-Trace, even with very few probes, is usually more than an order of magnitude worse than just using the Flight Recorder – use with caution. 

There is much more information available from the event providers built into the JVM, such as class loading and compiler events. One way to learn more details about what is available is to take a closer look at the metadata from a recording.

Summary

Since JDK 7u40 there is a new tools suite bundled with the JDK – Java Mission Control. The main focus of the suite is on production time profiling and diagnostics. This has the benefit that the data gathered is quite true to the dynamics of the application being profiled, as the observer effect is kept quite low. In other words, instead of profiling the profiler itself, most of the time is actually spent profiling the application and the runtime. Whilst the main focus of Mission Control is production systems, it can be quite useful in development too. It is also free for use in development, as per the standard Oracle Binary Code License (BCL).

This article provided a brief introduction to Java Mission Control.

Further Information

Java Mission Control Homepage

My Blog

@javamissionctrl;  @hirt


Tuesday Sep 24, 2013

Session Report: JSR 341: Expression Language 3.0

Ed Burns, Consulting Member of Technical Staff, and Kinman Chung, Principle Member of Technical Staff, both at Oracle, presented a session on Monday in which they described new features in JSR 341, Expression Language (EL) 3.0. They discussed the APIs for the use of EL in standalone environments and EL syntax for new operators, plus lambda expressions, and support for collection objects, all the while offering copious code illustrations.

Burns remarked that he was pleased that Java Champion and JavaOne Rock Star Adam Bien had referred to EL 3.0 as “the hidden gem of Java EE”. “I don’t know how hidden it is,” said Burns, “but I think it’s a gem.”

He discussed the origins of EL, which has a long and active history in the Java platform. EL began in 2004 as part of the Java Standard Tag Library (JSTL 1.0), moved to JSP 2.0 in 2006, and became an independent specification with JSR 341 in 2011. It is used in JSF, CDI, and Avatar. Now, 9 years after its inception, it is an independent specification that is heavily used in JSF.   

Burns observed that the presence of EL is the key differentiator between Java server and non-java server stacks. “Java server-based web frameworks are likely to use EL,” said Burns. “When you show someone who is not familiar with EL how easy it is to move things together from disparate parts of your application, it’s very compelling.”

The most important feature that EL 3 brings is lambda expressions – developers do not have to wait until Java SE 8 is released. It all runs on Java EE 7, which requires Java SE 7 -- which means that it is currently available. Burns gave a brief discussion of lambda expressions, which basically behave like an anonymous function -- lambdas in EL are EL expressions. They offer full access to the EL environment within the body of the EL lambda expression, something not available from Java SE lambdas. “You won’t be able to refer to other EL things from a plain old SE lambda expression,” said Burns.

The goal of EL 3 is to provide greater expressive power for applications and to use it outside of Java EE. Burns and Chung provided an overview of collection operations and explained EL’s support for stand-alone environments. EL 3 is easy to use outside of Java EE and provides standard data structures: ELContext; ELResolvers; and local variable and function repositories.

They explained that it enables direct EL operations and has: EL expression evaluation; Bean definition; and Function definition. They emphasized that other key parts of Java EE can also be used standalone, such as: Bean Validation; Persistence (JPA); and Contexts and Dependency Injection (CDI). They encouraged developers to consider the possibilities for cloud deployment in: Defining functions and variables and defining beans.

They spent the rest of the session illustrating their key points with a healthy dose of code.

Links and Downloads:
* JSR 341: http://www.jcp.org/en/jsr/detail?id=341
    Download spec and API javadocs

* Project home: https://java.net/projects/el-spec/
   Report spec bugs or RFE for el.next

* RI: https://java.net/projects/uel/
   Maven artifacts available from Maven Central
   Download source and report RI bugs

* Integrated in Glassfish 4.0: https://glassfish.java.net/

You can listen to this session in early October on Parleys.com.

The Eleventh Annual Java Community Process Program Awards

by Timothy Beneke and Janice J. Heiss

In a festive room teeming with over 200 people, including many celebrated Java luminaries,
along with excellent food and drink, the 9th annual JCP Program Awards were handed out atop the majestic Hilton Hotel on Monday night. As the JCP states, “The Java Community Process (JCP) program celebrates success. Members of the community nominate worthy participants, Spec Leads, and Java Specification Requests (JSRs) in order to cheer on the hard work and creativity that produces ground-breaking results for the community and industry in the Java Standard Edition (SE), Java Enterprise Edition (EE), or Java Micro Edition (ME) platforms.”

The JCP added a new awards category this year for Adopt-a-JSR program participants, bringing the total to four: JCP Member/Participant of the Year, Outstanding Spec Lead, Most Significant JSR, and Outstanding Adopt-a-JSR Participant.

The room was full of good cheer, playful humor, a music band of Java developers, and enthusiastic appreciation of much that has been accomplished on behalf of Java technology in the previous year.

The nominees and winners in their respective categories were:

JCP Member/Participant of the Year

--Azul Systems, Gil Tene

--London Java Community (LJC), Ben Evans, Martijn Verburg, Richard Warburton, Graham Allan

--Mohamed Taman

The winner was Azul System’s Gil Tene. The JCP said, “Gil has worked diligently to provide clear advice on matters of Software Patents, IP and licensing that seeks to benefit both non-profits/individuals etc as well as organizations with vested commercial interests in Java. It's not easy delving into the depths of the legal aspects and the potential impacts of changes to the JCP, but with help from folks like Gil we're hopeful for a solid and fair outcome.”

Tene characterized his approach to the JCP as follows: “I represent Azul Systems on the JCP EC, but I try to apply an approach of ‘do the right thing first’ in my choices and positions. Coming from a small company that depends on Java and its ecosystem for its livelihood, I see my role as representing the interests of an entire sector of non-big-company commercial folks and of individual and professional developers out there, and providing some offset and balance to the normal mix of such boards.”

Outstanding Spec Lead

--Brian Goetz, Oracle

--Jitendra Kotamraju, Oracle

--Anatole Tresch, Credit Suisse

--Chris Vignola, IBM

The winner, Oracle’s Brian Goetz, was recognized, “For tirelessly working away at an incredibly complex JSR - JSR 335, Lambda Expressions for the Java Programming Language. From a community point of view, we've appreciated his willingness to listen and consider ideas from other technologists as well as spending time with groups of developers to understand the impact of Lambdas on Java.”

Goetz offered a statement in response to the award for his leadership in creating Lambda Expressions for the Java Language, which also won for most significant JSR. He said that lambdas, “represent a coordinated co-evolution of the Java SE platform, including the VM, language, and core libraries to provide developers with a powerful upgrade -- quite likely the largest ever -- to the Java SE programming model. We started this JSR in early 2010, but the topic of closures-in-Java had already been in play in the community for many years prior, and, of course, there was a broad diversity of opinions as to what direction, how far, and how fast to evolve the Java programming model. In the end, the most significant dimension of the challenge turned out to be: how do we integrate these new features in the language and libraries without them feeling grafted on after-the-fact. I think developers will find programming with this ‘new and improved Java’ to be a very pleasant experience -- I know I have.”

Most Significant JSR

--JSR 335, Lambda Expressions for the Java Programming Language

--JSR 344, JavaServer Faces (JSF) 2.2

--JSR 352, Batch Applications for the Java Platform

--JSR 354, Money and Currency API

--JSR 355, JCP Executive Committee Merge

The winner, as previously mentioned, was JSR 335, Lambda Expressions for the Java Programming Language, which the JCP praised as follows:

“This brings Java kicking and screaming into the modern programming language age and is seen as a catalyst for the second age of Java. It's underlying discoveries and improvements with regards to Type Inference has also resulted in a stronger JVM for all.”

Spec lead Brian Goetz, in picking up the award, remarked, “This is something we’ve been working on for three-and-a-half-years and it’s nice to be looking at it through the rear-view mirror.”

Outstanding Adopt-a-JSR Participant

--BeJUG, Johan Vos

--CeJUG, Helio Frota, Hildeberto Mendonça

--JUG Chennai, Rajmahendra (Raj) Hegde

--Morocco JUG and EGJUG, Mohamed Taman, Faissal Boutaounte

The winner was Morocco JUG and EGJUG, Mohamed Taman, and Faissal Boutaounte, who were praised, “For adopting JSR 339, JAX-RS 2.0 specification, along with many other JSRs. One JIRA issue filed by Morocco JUG on JSR 339 was classified as a ‘release-stopper’. A quick JIRA search using the ‘adoptajsr’ tag shows that most of the JIRA issues have been created by MoroccoJUG members. Several presentations and source code have been organized by these groups. Mohamed presented sessions about the upcoming technologies to widen the range of users in the future, especially Java EE 7 JSRs and spreading of community progress and contributions that make us encouraged to participate. Mohamed sent a clear message that Africa is here and is full of talented people who are willing to take it to the next level. Mohamed was responsible for translating an Arabic Adopt-s-JSR web page to allow more Arabs to participate.”

Taman said that, “Currently, I hold two positions, one as a Business Solutions Systems Architect and design supervisor and Java Team leader, at a big financial services company in Egypt, which affects all the country by building solutions affecting Egyptians every day, by providing more facilities for businesses and enhancing the economy… I am passionate about Java. I really love it and have fun coding, and love seeing it grow, day by day, as if it were my kid.”

The Annual Java Community Process Program Awards at  JavaOne is an event and party not to be missed!

The Java Community Process

Monday Sep 23, 2013

More on the JavaOne 2013 Strategy Keynote - IBM's Java Focus

John Duimovich, Java CTO and IBM Distinguished Engineer, took the stage at Sunday’s JavaOne 2013 keynote and stated that IBM had a new approach to this year’s JavaOne. They arrived at JavaOne with 20 developers of all ranks, giving 28 sessions -- and only one marketing person. This was consistent with a mantra he repeated throughout his keynote: “It’s a great time to be a developer.” Duimovich also commented several times that developers ultimately have a lot of power, a recognition that leads IBM to shape many policies around the needs and desires of developers.

“With so many frameworks, languages and tools available, developers have all they need to create great applications,” he observed. “With the cloud and PaaS it is easy to go to market and, in fact, possible to take a good idea, test it, and deploy it within a day.” This, he insisted, has changed the landscape for developers. Since Java is the leading platform being used to deploy to the cloud, along with Javascript and HTML5, IBM will continue to follow and invest in developers.

Systems of Interaction and Engagement
Duimovich identified an interesting turn of events. “There is a new class of application development out there now called systems of interaction, which are typically delivered via the cloud." “Systems of interaction” is a term that encompasses what has traditionally been called systems of record, which are what many Java developers work with in Java EE using containers and databases in such domains as business process-oriented bank accounts and HR systems.

He observed that there are new and growing open cloud ecosystems centered around such platforms and projects as CloudFoundry and OpenStack, offering the next “big thing” for developers -- the ability to access a whole open stack and write applications. “What’s different about IBM is that we are investing in open things a bit earlier in their life cycle,” said Duimovich. “We don’t wait until they are done and competing with us. We try to influence them early.”

New applications are being developed that offer systems of interaction which he characterized as user-centric applications specifically targeted to support user work flow.  These are mobile apps similar to what is in a phone or a car that bridge both systems of record and social networks. “So the application might take Twitter or Facebook into account, while bridging big data and bring together capabilities that drive user-focused applications,” explained Duimovich. “You are on the way to the airport and the app tells you the plane is late; you take off and the app tells you about the weather in the city of arrival. After that, you might be interested in where to buy new clothes because your luggage is still at the airline.”

Such applications have contextual “awareness” driving them. All of this is driven by the cloud as systems of record get pushed out to the cloud as services. “IBM has created an experimental platform that developers can try out called IBM BlueMix which is based on OpenSource and CloudFoundry,” said Duimovich. “It has runtimes and frameworks, like Java, and new ones like Node, and other scripting languages like Ruby.”

IBM BlueMix offers standard services such as database, caching, and messaging, but also includes new ones like social information, and location and geo-spatial database information. “This is all brought together so the enterprise can engage with their customers in a much richer way -- the way they do that is via the cloud.”

Java Innovation at IBM
He discussed the IBM WebSphere Liberty Buildpack, which is freely available for developers. It can be downloaded and pushed to any Cloud Foundry-based system. “This is our first step in making Java to PaaS deployment as easy as possible for developers.” Liberty is a Java profile that supports Java EE and is a container offering lots of features for clouds.

IBM has also been working on a multi-tenancy JVM, which means the VM can run and stack more VMs inside of it to save space and enable faster startup performance. This allows developers to manage life cycles independently. It’s intended for those who want to get more dense and efficient deployment on the cloud. “Just as peanut butter and chocolate go together – Liberty and multi-tenancy VMs are delicious,” said Duimovich.

He explained that running the Liberty profile and on the multi-tenancy JDK results in 2-3 times faster startup and twice as much density, so developers can stack twice as many instances on a machine than before without loss of performance.

Duimovich closed with some remarks about hardware innovation at IBM, and where the Java language may be headed in the future.

IBM BlueMix

IBM WebSphere Liberty Buildpack

Watch Keynote and Session Highlights on Demand

Thursday Jun 27, 2013

An Overview of Batch Processing in Java EE 7

Up on otn/java is a new article by Oracle senior software engineer Mahesh Kannan, titled “An Overview of Batch Processing in Java EE 7.0,” which explains the new batch processing capabilities provided by JSR 352 in Java EE 7. Kannan explains that “Batch processing is used in many industries for tasks ranging from payroll processing; statement generation; end-of-day jobs such as interest calculation and ETL (extract, load, and transform) in a data warehouse; and many more. Typically, batch processing is bulk-oriented, non-interactive, and long running—and might be data- or computation-intensive. Batch jobs can be run on schedule or initiated on demand. Also, since batch jobs are typically long-running jobs, check-pointing and restarting are common features found in batch jobs.”

JSR 352 defines the programming model for batch applications plus a runtime to run and manage batch jobs. The article covers feature highlights, selected APIs, the structure of Job Scheduling Language, and explains some of the key functions of JSR 352 using a simple payroll processing application. The article also describes how developers can run batch applications using GlassFish Server Open Source Edition 4.0.

Kannan summarizes the article as follows:

“In this article, we saw how to write, package, and run simple batch applications that use chunk-style steps. We also saw how the checkpoint feature of the batch runtime allows for the easy restart of failed batch jobs. Yet, we have barely scratched the surface of JSR 352. With the full set of Java EE components and features at your disposal, including servlets, EJB beans, CDI beans, EJB automatic timers, and so on, feature-rich batch applications can be written fairly easily.”

Check out the article here.

Wednesday Jun 26, 2013

Diving into Scala with Cay Horstmann

A new interview with Java Champion Cay Horstmann, now up on otn/java, titled  "Diving into Scala: A Conversation with Java Champion Cay Horstmann," explores Horstmann's ideas about Scala as reflected in his much lauded new book,  Scala for the Impatient.  None other than Martin Odersky, the inventor of Scala, called it "a joy to read" and the "best introduction to Scala". Odersky was so enthused by the book that he asked Horstmann if the first section could be made available as a free download on the Typesafe Website, something Horstmann graciously assented to.

Horstmann acknowledges that some aspects of Scala are very complex, but he encourages developers to simply stay away from those parts of the language. He points to several ways Java developers can benefit from Scala:

"For example," he says, " you can write classes with less boilerplate, file and XML handling is more concise, and you can replace tedious loops over collections with more elegant constructs. Typically, programmers at this level report that they write about half the number of lines of code in Scala that they would in Java, and that's nothing to sneeze at. Another entry point can be if you want to use a Scala-based framework such as Akka or Play; you can use these with Java, but the Scala API is more enjoyable. "

Horstmann observes that developers can do fine with Scala without grasping the theory behind it. He argues that most of us learn best through examples and not through trying to comprehend abstract theories. He also believes that Scala is the most attractive choice for developers who want to move beyond Java and C++.  When asked about other choices, he comments:

"Clojure is pretty nice, but I found its Lisp syntax a bit off-putting, and it seems very focused on software transactional memory, which isn't all that useful to me. And it's not statically typed. I wanted to like Groovy, but it really bothers me that the semantics seems under-defined and in flux. And it's not statically typed. Yes, there is Groovy++, but that's in even sketchier shape.

There are a couple of contenders such as Kotlin and Ceylon, but so far they aren't real.

So, if you want to do work with a statically typed language on the JVM that exists today, Scala is simply the pragmatic choice. It's a good thing that it's such a nice choice."

Learn more about Scala by going to the interview here.

Thursday Jun 06, 2013

A Java EE 7 Sneak Peek!

Next week, Wednesday the 12th, Oracle executives and technical experts will present the ins and outs of Java EE 7 in a live webcast

In this presentation, technical expert Arun Gupta gives a preview of the new and updated JSRs in Java EE 7. He also lays out the plans for Java EE 8. 

Join us for the live webcast: Introducing Java EE 7 on June 12th, 2013. It is free! 

Wednesday Mar 27, 2013

Real-Time Topic Modeling of Microblogs

A new article published on the front page of otn/java, by Yogesh Tewari and Rajesh Kawad, of Infosys Limited Labs in Bangalore, India, titled “Real-Time Topic Modeling of Microblogs,” explores “the challenge of real-time extraction of topics from a continuous stream of incoming microblogs or tweets that are particular to an application” that they created. From a simple tweet text, the application is designed to accurately suggest relevant topics discussed in the tweet, and provide real-time timelines of topics generated from the tweet streams.

They explain that this is no simple tasks since a tweet, “considered as a text corpus, contains only 140 characters and second, given their brevity, tweets may not provide useful information and may contain different forms of text such as ‘smileys’ and short-form URLs. Finally, tweets are generated in real time.”

Yogesh and Rajesh apply LDA (latent Dirichlet allocation) to topic model tweets and make use of the Machine Learning for Language Toolkit (MALLET) API as the implementation for LDA – all performed in a Java environment. The LDA implementation is in turn encapsulated within the MALLET API, which here functions as a command line–based Java tool.

As they state: “Our targets are the actual Java classes that perform the LDA logic whose methods we invoke with required input in real-time. Storm is our choice of a free and open source distributed real time computation engine implemented in Java and running in a distributed mode. Storm is highly scalable and easily capable of handling incoming tweet streams. We use Twitter4J to stream tweets, which require valid Twitter authentication. So our task is to design a topology that will consume tweet streams and output a timeline of topics.”
Check out the article here.

About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today