changing the width of input text in ADF | Techartifact

Requirment – to manage the width of an input text.

Solution- A very small tip on ADF. We have panel form layout , inside that we have multiple input text which is bind to db table column which is set as datatype to verchar2(1000) .then the input text will go beyond the expected limit.How to change the width.

In the input text property there is property called columns.You can give some value like 200 or 300 according to your need.
and it will change the width.

Happy coding with Techartifact

Why use hashMap when ConcurrentHashMap is there… | Techartifact

ConcurrentHashMap is sort of hidden class. Not many people know about it and not many people care to use it. The class offers a very robust and fast (comparatively, we all know java concurrency isn’t the fastest) method of synchronizing a Map collection.

On the internet there is lot of article which tell difference between hashmap and ConcurrentHashMap. This class obeys the same functional specification as Hashtable, and includes versions of methods corresponding to each method of Hashtable. However, even though all operations are thread-safe, retrieval operations do not entail locking, and there is not any support for locking the entire table in a way that prevents all access. This class is fully inter-operable with Hashtable in programs that rely on its thread safety but not on its synchronization details.
Ideally we should not ask for difference.Its like comparing orange with apple.One is giving you synchronize feature and other one is note.

concurrentHashMap is thread-safe implementation of Map interface. In this class put and remove method are synchronized but not get method. This class is different from Hashtable in terms of locking; it means that hashtable use object level lock but this class uses bucket level lock thus having better performance.

If you use HashMap in your application, it is working perfectly in development or test environment ,but gave pain in production..
But obvious is—when heavy load, HashMap behaves starting weird. If we use HashTable.Hashtable’s offer concurrent access to their entries, with a small caveat, the entire map is locked to perform any sort of operation. While this overhead is ignorable in a web application under normal load, under heavy load it can lead to delayed response times and overtaxing of your server for no good reason.
This is where ConcurrentHashMap’s step in. They offer all the features of Hashtable with a performance almost as good as a HashMap. ConcurrentHashMap’s accomplish this by a very simple mechanism.Instead of Map’s lock ,the collection keep a list of 16 lock by default,each of which is used to guard (or lock on) a single bucket of the map. This effectively means that 16 threads can modify the collection at a single time (as long as they’re all working on different buckets). Infact there is no operation performed by this collection that locks the entire map. The concurrency level of the collection, the number of threads that can modify it at the same time without blocking, can be increased. However a higher number means more overhead of maintaining this list of locks.

Retrieval operations on a ConcurrentHashMap do not block unless the entry is not found in the bucket or if the value of the entry is null. In such a case the map synchronizes on the bucket and then tries to look for the entry again just in case the entry was put or removed right after the get in synchronized mode.Removal operations do require a bit of overhead. All removal operations require the chain of elements before and after to be cloned and joined without the removed element. Since the value of the map key is volatile (not really, the value of the inner Entry class is volatile) if a thread already traversing the bucket from which a value is removed reaches the removed element, it automatically sees a null value and knows to ignore such a value.

Book Review : KnockoutJS Starter

The folks at Packt asked me to review one of their book on KnockOut Js If you are interested in buying it (a judgment you may reserve until after you have read the review)KnockOutJs is on packt site
this is link you can go.

Eric Barnard is a Software Engineer in Champaign-Urbana, Illinois. You can find his blog at http://www.ericbarnard.com

The Packt model is an interesting one. They are an online publishing house who approach subject matter experts and offer them an advance and a good commission for writing a book for them. They have approached me a couple of times but I have turned them down on both occasions simply due to a lack of time. Given the movement towards e-readers and related devices I believe it is a business model most publishers will eventually adopt.
Overview and Structure of the Book

The first thing you will probably notice is the size of the document. This is no brief summary of the new features. This is small book of over 40 pages covering to learn a new java script librart with a full index in the back. The structure of the book is:

Business overview
Step 1 – Defining a namespace
Step 2 – Creating our Model
Step 3 – Creating a View for our Model
Step 4 – Creating a ViewModel to manage our Models
Step 5 – Working with Observable Arrays
Step 6 – Adding and removing Models from an Observable Array
Step 7 – Editing properties of a Model
Step 8 – Setting up a Master-Details view
Step 9 – Applying bindings

• There are some key features as well like MVVM model and other important features of KnockOut JS

I like this structure as it parallels the steps one would take in setting up a KnockOut JS. To add a bit of a flow to the book, they also put it in the examples,real life scenarios.

What is missing is – This book is not covering the detailed code description.Although it have how to install this library.Creating a demo application.How to start creating site, MVVM library.

Its more a starter book.This book focuses on giving the reader a firm understanding of the core concepts of Knockout, such as MVVM and data binding,
and works through real-life app development scenarios. All core components of Knockout’s amazing library are covered in detail, and strategies are outlined for getting the best use of time when developing with Knockout .

Knockout – A JavaScript library
Knockout, at its core, is a simple JavaScript file that can be included in a website or a web application to add JavaScript functionality, and provides the ability to enhance a user’s experience. By default, Knockout does nothing to your website or web application until you specifically write code to utilize it. It is important to understand the difference between Knockout and many other JavaScript “frameworks” or “libraries” as some frameworks actually change how a website or web application works when included.

The difference between this library and other java script library is as below :

Subscribables – It give an edge of catching subscriber and receiver event.A Subscribable is simply an object that has three methods and an array of Subscriptions.

Observables -The Knockout Observable is one of the first objects that leverages the Subscribable functionality, and is one of the most simple, yet powerful pieces of the Knockout library.

Observable Arrays – There are multiple value of observable .

Computed Observables-Computed Observables are arguably the most powerful feature of Knockout. You may have noticed that creating a ViewModel with nothing but Observables and Observable Arrays is a huge step up from plain JavaScript, but it would be really nice to have other properties on your
ViewModel that simply depended upon other Observables and Observable Arrays and updated themselves when their dependencies change.

Utilities -Knockout is full of many useful utilities that you can use in your application development.You can find these by exploring the
ko.utils namespace.One of utility is extend.

Data-bind statements – Knockout was designed to make binding JavaScript objects and HTML extremely easy. The API that is given to us to use is through the HTML5 compliant data-bind statement.

Applying bindings – This is key feature of knockOut JS.Book describer it very well with example.Many examples show the applyBindings function being called with a ViewModel object being passed in as the only argument, but you can also specify a DOM node as the second argument.
When passing a DOM node as the second argument, Knockout only binds your ViewModel to that node and its children.

Conclusions
This book is not a comprehensive guide to the learn knockout JS. Rather, it is It presents a Starter guide to learn and work on KnockOut JS. It descrive MVVM model with detailed description.Worth of reading.