Friday, November 23, 2012

JDK7: Part 2- The power of java 7 NIO.2 (JSR 203) (Code Examples)

Get educated with the new file I/O mechanism introduced in the JDK 7 release.

In Part 1 I introduced the important concepts about new JSR 203 shipped and delivered with the latest release of Java development kit 7.

Here I am covering the important aspects involved in developing NIO.2-based applications by examples and case studies for the concepts introduced in part 1, this will spice up your Java 7 applications with the new I/O capabilities. You will learn to develop NIO.2 applications, beginning with simple but essential stuff and gradually moving on to complex features such as sockets and asynchronous channels.

In this second part I shipped it with fully coding examples for the following topics:
  1. Working with the new Path Class.
  2. Metadata File Attributes.
  3. Working with Symbolic and Hard Links.
  4. New API for Files and Directories.
  5. The FileVisitor Interface.
  6. Monitoring via Watch Service API.
  7. New powerful Random Access Files.
  8. Networking with the Sockets APIs.
  9. The Asynchronous Channel API.
  10. Production tips.
In the link below find the code as Netbeans project, divided into sections based on topics above, and also includes the material that guides you in details from software pre-requisite to compile and run the code, full explanation of every line of code and testing scenarios.

NIO2 project code and material.

Monday, November 19, 2012

EGJUG: "Power of Java 7 NIO.2" session in FCI-CU, Egypt

This is a free invitation for my session about The "power of Java 7 NIO.2" that will be held in Cairo university, faculty of computer science and information system FCI-CU, Egypt, at December 22/2012 from 12:00 P.M to 2:00 PM, which is managed by EGJUG(Egypt Java User Group, check the link below for more details about registration, date and place.

If you are coding with any language, in my session I am going to explore the most of I/O concepts useful for all levels and it not related to Java, I just will explore how these concepts implemented in the Java.

And If you would like to know in deep how stuff are going behind the concepts in Java, get ready for 2 days course that will give you the most of the concepts and final working project contains the reference implementation for NIO.2 examples in real world.

Go to the below link to register your seat.

looking forward to see you all my dear friends.

"Power of Java 7 NIO.2" session Facebook event page

Saturday, November 17, 2012

Mac: Alternatives to notepad++ on Mac OS X

For long time I have been working on windows platform sine first time I have touched the computer. Over the time I become in the development environment. After becoming team leader and then Systems Architect, I have reached to the point that I have a certain applications which I familiar with and know all of its features; one of the most interesting nifty notepad applications is Notepad++.

The default Notepad editor comes in very handy to quickly note down some important notes. However, the lack of potential features is realized when you are forced into the situation where you’ve to compare two text files or edit HTML document for instance. In such situations Notepad++ is a more than adequate alternative to native Notepad app.

Notepad++ is an open source project and is completely written in C++ language. Not only does it provide simple text editing option but also wide range of native add-ins and third-party plugins to make it the best Notepad alternative on Windows PC. It has a large swathe of features that makes it a developer's favorite alternative. It includes multi tab document support, easy comparison, syntax highlighting, syntax folding, document map, auto completion, macros support and many others, But how about such functionality on Mac? Is there any Notepad++ for Mac?

Recently (from 4 years) I worked on Linux and Mac, but I admired with Mac and decided to buy a Mac pro laptop, and for sure I searches for the same applications I used to use before on windows, sometimes you find and other you didn't, therefore you should get alternatives.

Since Notepad++ is not available on Mac, I will cover some of the worthy alternatives of Notepad++ for Mac.

  • TextWrangler
    TextWrangler is a powerful and richly featured tool for composing, modifying, and transforming text stored in plain-text files. and in my opinion it is a great alternative Text Editing and Manipulating, Programming, OS Platform Integration and Other Useful Features it has like Notepad++ and even more.

    The following are some of its features but not limited to those, there are more.

    Features of TextWrangler

    • Powerful single and multi-file search & replace
    • Flexible ‘grep’ style pattern-based search and replace based on PCRE (Perl-Compatible Regular Expression)
    • Sort Lines and Process Duplicate Lines commands offer grep pattern support for sorting, extracting, and handling text
    • Find Differences to compare two versions of a text file and merge the differences
    • Support for rectangular text selections
    • Built-in text transformations: Zap Gremlins, Change Case, Entab/Detab, and more
    • Open and save files in a variety of character sets, including Unicode (UTF-8 and UTF-16) files
    • Supports editing of multi-byte and Unicode text
    • Live Search for incremental, in-window searches
    • Open and save files in Mac, Unix, and Windows line-ending formats
    • Integrated support for Mac OS X’s spelling service
    • Hard or soft wrap text however you prefer
    • Quoted text rewrapper
    • Multiple Undo
    • Multiple Clipboards
    • Splittable editing windows
    • Auto-Indent

  • jEdit
    jEdit is written in Java, so it virtually runs on any OS out there including Mac OS. There are already few paid text editors or advanced editors available on Mac, but unlike other jEdit is a free open source project. This is the best alternative available on Mac.

    Features of jEdit
    • Built on Java
    • Unlimited undos/ redos
    • Syntax highlighting for more than 200 languages
    • Auto indent
    • Plugin repository with more than 200 plugins
    • Word wrap
    • Kill ring
    • Open any number of files simultaneously
    • File system browser
    • and more

  • Editra
    Editra, an open source program build using wxWidgets supports major platform like Windows, Mac and Linux. It supports over 60 programming language and has all the features users crave to have in their favorite editor. The project is in early stage of development so you may encounter few hiccups during your journey. Editra is visually appealing editor which comes with icons themes and loads of plugins.

    Editra could be the next big thing in code and text editor segment. Here are some of the features of Editra.

    Editra Features
    • Supports over 60 programming language
    • Syntax highlighting
    • Code folding
    • Auto completion
    • Auto indent
    • Drag and drop feature
    • Export to HTML/LaTeX/ RTF and other formats
    • File history
    • Multilingual interface
    • Undo/ Redo
    • Tabbed windows
    • Plugins supports
    • and more

In my opinion it is arguably the best Notepad++ alternative on Mac. The community is extremely supportive and active.

Saturday, November 3, 2012

ADF: JSF- ADF Backing beans life cycle

Backing (also referred to as managed) beans are Java beans referenced by JSF pages in an ADF Fusion web application through Expression Language (EL). They are usually dedicated to providing specific functionality to the corresponding page.

They are part of the ViewController layer in the Model-View-Controller architecture. Depending on their persistence in memory throughout the lifetime of the application, managed beans are categorized based on their scope: from request (minimal persistence in memory for the specific user request only) to application (maximum persistence in memory for the duration of the application).

They can also exist in any of the session, view, pageFlow, and backingBean scopes.

Managed bean definitions can be added to any of the following ADF Fusion web application configuration files:
  • faces-config.xml:
    The JSF configuration file. It is searched first by the ADF framework for managed bean definitions. All scopes can be defined, except for view, backingBean, and pageFlow scopes, which are ADF-specifc.

  • adfc-config.xml:
    The unbounded task flow definition file. Managed beans of any scope may be defined in this file. It is searched after the faces-config.xml JSF configuration file.

  • Specific task flow definition file:
    In this file, the managed bean definitions are accessed only by the specific task flow.

Additionally, if you are using Facelets, you can register a backing bean using annotations.

Many times I see people called it Baking, it is "Backing not Baking".

Friday, November 2, 2012

Saying: Failure is my key to success........

Failure is the first step to your success, and believe me you should watch every chance you got it. Study it well and see what is good you did to keep and enhance it, and what is bad and missed to neglect and improve it in your second try.

No success without a lot of work, doing your best, is not a success, and God will never waste your hard work. (this is what he says, "Great God")

one of my experience and very hard lessons, which I exposed to it from life, taught me this hardly.

Thanks God.