Jumat, 01 Agustus 2014

Yahoo Wins Suit to Reveal Documents from Secret Court Proceedings

According to the Daily Dot, a court has ruled that documents relating to Yahoo's legal resistance to demands from the Federal government for access to its users' records will be declassified.  Excerpt:
Yahoo, initially vilified for being part of the PRISM program, which allows the National Security Agency (NSA) to tap it and other companies for users' information, is about to be vindicated.

A court ruled Monday that the Department of Justice must reveal classified documents from 2008 that Yahoo says will demonstrate that the company fought back against a secret court order to reveal their users' data.

"The Government shall conduct a declassification review of this Court's Memorandum Opinion of [Yahoo's case] and the legal briefs submitted by the parties to this Court," the ruling read. The Department of Justice has two weeks to estimate how long it'll take to declassify the documents and can still redact the parts it finds contains classified information.

Source:http://blog.agupieware.com/2013/07/yahoo-wins-suit-to-reveal-documents.html

Difference between linked list and array data structure in Java Programming




Array and linked list are two fundamental data structure in programming
world. Almost all programs use Array in some form or other, which makes it
increasingly important to learn array and linked list. Difference between
linked list and array data structure is also a popular data structure question,
frequ
ently asked in various programming job interview. This makes it even more
important to learn and understand difference between an array and a linked list.
Well there are lot of difference between these two starting from how they store
data, to how you retrieve data from them. Main difference comes from the fact
that array elements are stored in contiguous memory location, which makes it
easy to retrieve them in quick time, while linked list elements are scattered
through out memory, where one element knows address of other, it makes it hard
to retrieve element from linked list in quick time. Some of the differences
which we saw in ArrayList vs LinkedList also
applicable at data structure level, because
ArrayList is backed
by array and
LinkedList is internally backed by double
linked list in Java. In this tutorial, we will learn differences between these
two fundamental data structure in more details. Once you know the difference,
you can make a concise choice of which data structure suits your need better.
Since both of them offers distinctive advantage over others, in terms of speed
and flexibility, You can make an informed choice based upon your need.




Array vs linked list in Java



array vs linked list in JavaHere is my list of differences between array and linked list. Though data
structure concept are independent of any programming language and more or less
applicable in all programming language including C and C++, I have explained
differences in Java's context.





1. First and major difference between linked list and array data structure
is that former doesn't support random access, while later support random
access. linked list is sequential, in order to retrieve an element, you need to
traverse till that, while if you know index, you can retrieve an element from
array very quickly, because it doesn't involved traversal.





2. Second major difference between array and linked-list data structure
is that, array needs contiguous memory allocation, which may result in java.lang.OutOfMemoryError: Java Heap
Space
if
there is not enough contiguous ( a big chunk) of memory in
Java Heap. On the other hand, linked list is distributed data structure, it's
element are scattered over heap and doesn't need a contiguous memory
allocation. This makes linked list ideal, if you have scattered memory.





3. Third major difference is fixed length, array is a fixed length data
structure, you provide length or size of array at the time of creation, later you
can not modify that size. On the other hand, linked list is dynamic data
structure, it can grow and doesn't required size to be specified at the time of
creation, because each node keep tracks of other.





4. It's easy to insert and delete elements from linked list than array,
especially inserting element at beginning of linked list, and deleting element
from end of linked list is O(1) operation. On the other hand array is fixed
length data structure, so memory is allocated during initialization, and doesn't
really change due to addition and removal of elements.  Though you can set a particular index null,
to cut the reference count of that object.





5. Array is ideal for implementing fast caches e.g. HashMap or Hashtable, which
requires constant time retrieval e.g. Map data structure provides O(1)
performance for
get(Key key) operation, while linked list
based structure provides liner performance i.e. O(n) for retrieval operation,
where n is the number of elements in linked list.





6. Array can be one or multi-dimensional, while linked list can be
singly, doubly or circular linked list. Two dimensional array are most common
in multi-dimensional and used to represent matrix in Java. You can use two
dimensional array to represent a plain of x,y coordinates, frequently used in
Game programming. Java programming language provides support for creating array
at syntax level, it supports both single and multidimensional array. Java API
also provides a class called
java.util.LinkedList, which is
an implementation of doubly linked list data structure.





That's all on my list of differences
between array and linked list data structure
. I strongly suggest to get a
good hold of these data structure, especially linked list, which is very
popular among data structure interview questions. Questions like appending
elements into linked list, deleting elements, reversing linked list are quite
common in various programming jobs. At very least, knowledge of fundamental
data structure is essential to do well in programming jobs.






Couple of books in data structure which is worth
reading


1. Data Structure and Algorithm Analysis in Java


2. Data Structures: Abstraction and Design Using Java By Elliot B. Koffman, Paul A.
T. Wolfgang































Source:http://javarevisited.blogspot.com/2013/07/difference-between-array-and-linked-list-java.html

You've Been Skyped: Microsoft Provides NSA with Backdoor Access

The paranoiacs are proven right, yet again.  New documents reveal that Microsoft has provided the NSA with access to its users' audio and video chats on Skype, as well as email and message chat logs.  If you want secure messaging, you may have to revert back to carrier pigeons.  From Ars Technica:
Skype audio and video chats, widely regarded as resistant to interception thanks to encryption, can be wiretapped by American intelligence agencies, according to a new report in The Guardian. The report appears to contradict claims by Microsoft that it has not provided the contents of Skype communications to the government.
In a story published Thursday, based on documents leaked by former National Security Agency (NSA) contractor Edward Snowden, The Guardian offers some detail about extensive cooperation between the FBI, the National Security Agency, and Microsoft to enable government access to user communications via the intelligence tool known as PRISM. That cooperation included, according to the leaked NSA documents, enabling access to Outlook.com e-mails and chats, the SkyDrive cloud storage service, and Skype audio and video calls.

Source:http://blog.agupieware.com/2013/07/youve-been-skyped-microsoft-provides.html

Anti-Tracking, Anonymous Search Engines Bloom in Aftermath of Mass Surveillance Leaks

If you're not using a search engine such as Duck Duck Go, then it is very likely that the search engine you are using is tracking your every move.  Search engines that value privacy and anonymity online are entering a boom following revelations of mass dragnet internet surveillance by government and business.  From The Guardian:
Gabriel Weinberg noticed web traffic building on the night of Thursday 6 June – immediately after the revelations about the "Prism" programme. Through the programme, the US's National Security Agency claimed to have "direct access" to the servers of companies including, crucially, the web's biggest search engines – Google, Microsoft and Yahoo.

Within days of the story, while the big companies were still spitting tacks and tight-lipped disclaimers, the search engine Weinberg founded – which pledges not to track or store data about its users – was getting 50% more traffic than ever before. That has gone up and up as more revelations about NSA and GCHQ internet tapping have come in.

"It happened with the release by the Guardian about Prism," says Weinberg, right, a 33-year-old living in Paoli, a suburb of Philadelphia on the US east coast. "We started seeing an increase right when the story broke, before we were covered in the press." From serving 1.7m searches a day at the start of June, it hit 3m within a fortnight.
Yet you've probably never heard of DuckDuckGo.

Source:http://blog.agupieware.com/2013/07/anti-tracking-anonymous-search-engines.html

Kamis, 31 Juli 2014

When to make a method static in Java




Making a method static in Java is an important decision . Though, static
keyword
is one of the fundamental concepts, many times programmers gets
confused to make a particular method static or not. In Java programming, main
motivation for making a method static is convenience.
You can call a static method without creating any object, just by using it's
class name. So if you need a method, which you want to call directly by class
name, make that method static. Utility classes e.g.
java.lang.Math or StringUtils, are good
examples of classes, which uses static methods. Before making a method static,
you should look into limitation of static methods as well, as you
can not override static method in Java
. By keeping these properties in
mind, we can make few rules, which will help to decide when to make a method static in Java and when to use them. In this
Java article, we will learn more about benefits and limitation of making a method
static, and also see couple of examples of static methods from JDK to learn
when and how to use static method in Java.







What does static method do in Java



When you see a static method in Java code, What do you assume? What
reasoning and assumptions a reader make, when he sees a static method? This is
important to learn to  ensure we are
using static method correctly.





1) Static method doesn't modify state of object. Since state of object is
maintained as instance variables, and Java doesn't allow non static variables
on static context
.
Modern days IDE like Netbeans also shows static
method in italics to differentiate it from other methods.





2) Static method mostly operates on arguments, almost all static method
accepts arguments, perform some calculation and return value.











Rules
to make a method static in Java




There is no hard and fast, well written rules, to decide when to make a
method static or not, But there are few observations based upon experience,
which not only help to make a method static but also teaches when to use static
method in Java. You should consider making a method static in Java :





1) If a method doesn't modify state of object, or not using any instance variables.




2) You want to call method without creating instance of that class.




3) A method is good candidate of being static, if it only work on
arguments provided to it e.g.
public int factorial(int number){}, this
method only operate on number provided as argument.





4) Utility methods are also good candidate of being static e.g. StringUtils.isEmpty(String
text)
, this a utility method to check if a String is empty or not.





5) If function of method will remain static across class hierarchy e.g. equals() method is not a good
candidate of making static because every Class can redefine equality.









When to use static method in Java



How to use static method in JavaNow, we know the benefits and limitation of making a method static in
Java, we can see couple of scenarios where we can use static methods. Factory
design pattern provides a good use of static method. You can use static method
to create instance of a class. Even Effective Java advises about
using static factory method, couple of example of these in Java library is
creating thread pool from Executors class.
Executors provides
lots of static methods to create different types of thread pool e.g.
public
static ExecutorService newCachedThreadPool()
, public static
ExecutorService newFixedThreadPool(int nThreads)
etc. Another interesting
use of static methods from JDK is collection classes e.g.
Collections and Arrays which
provides lot of static utility methods to operate on different kinds of
collection. Static method can also be combined with variable arguments to
create a collection of explicitly elements e.g.
EnumSet.of(E first,
E... rest)
.
Apart from these, if you loot at Apache commons lang library, you will
find a pattern of utils class e.g.
StringUtils, ArrayUtils, which
provides utility methods to operate on
String and
arrays. One more interesting use of static method I have seen is
valueOf() method
inside different value classes e.g.
java.lang.String, though
this is also an example of factory method, but it's also
a nice way to convert one type to another. For example
valueOf() can also
be used to convert String to Integer in Java. In short, it make sense to use
static methods :





1) Along with creational design pattern e.g. Factory and Singleton.




2) As utility method, which operate on arguments.




3) A conversion tool e.g. valueOf().





That's all about when to make a method static in Java. We have seen
benefits and limitation of making a method static, and few examples of static
methods from JDK. JDK examples will also help you to decide when to use static
method in Java.








Mentioned books in this article


Effective Java 2nd Edition from Joshua Bloch



























Source:http://javarevisited.blogspot.com/2013/07/when-to-make-method-static-in-java.html

ZEEF: the official Beta release!




Source:http://balusc.blogspot.com/2013/07/zeef-official-beta-release.html

Best practices for Maximo projects

Today I have received the following questions from one of our customers.
  • Are there any best practices or recommendations on how to develop and maintain different versions of a Maximo based solution?
  • How can we do source control?
  • Are there any compare tool/utility to find differences in various version of application (available in different environments)?
Expanding a little, in this article I will present my own recipes to cook successful Maximo projects.


Development Methodology

I am a strong fan of Agile philosophy and less enthusiastic adopter of Agile software development methodologies like Scrum, XP or Crystal.
I really believe that the right way to seek success and perfection in software development project is to strive to align your processes, organization and culture to the four value statements of the Agile manifesto whatever methodology you are using.

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

There is no silver bullet here. Every project is different. Every customer is different. You have to experiment and improve keeping in mind those principles.
My own motto is: Start Small, Grow Fast. I always use this as a very simple guiding principle.





Workspace structure

I suggest to keep all the files and documents in a single place. There is no need to create boundaries between development, test or project management people. Everybody is on the same ship and a great collaboration is fundamental for an efficient and productive team. If possible, give access to the customer to entire set of files and documents. Foster mutual trust and establish a partnership.
This is a common set of directories in a project folder.
  • Mbo: Home of an Eclipse project for Mbo Java code (aka businessobjects).
  • Web: Home of an Eclipse project for UI Java code (aka maximouiweb).
  • Applications: Applications definitions exported in XML files. Any time a change is made, the app definition must be exported and stored here.
  • Scripts: TPAE 7.5 scripts.
  • Database: Custom database triggers and SQL scripts.
  • Docs: Requirements, plans and procedures as well as architectural and design documents. All the team members should use this folder to collaborate for a lean workgroup.
I know that some of these files are stored in a safe place in the Maximo database. However, I think it is better to keep together all the custom code in a common repository where you can also search for previous versions of a specific file.


Collaboration, Backup, Versioning

The workspace described above must be shared across all the team members including specialists, architects, developers, project managers and stakeholders.
Avoid using email to exchange documents. This could quickly become a nightmare. Break old habits. Share a list of tasks on Google Docs and ask everyone to keep it updated. Create a design document and edit it in real time during a review session. Many times we don't need strict rules and processes.

Regarding the technology for storage and versioning of the workspace it really depends on the size of the team. As a general rule:
  • 1-3 members: A shared folder with a weekly backup is enough. Cloud services like Google Drive, SkyDrive, DropBox, etc. are great and free. Google platform enable a powerful collaboration platform with chat, email, real time document collaboration and sharing.
  • 4-6 members : Here you will need some versioning system like CVS, SVN or Git. You may decide to setup your own server or to go cloud.
  • 7 or more: You need some requirement/bug management system. Those systems are typically called ALM (Application Lifecycle Management). IBM Rational Team Concert is a great and powerful tool but can be a little complex to administer. There are tons of ALM services on the cloud


Tools

First of all, share a common set of productivity tools. Look at Maximo specialist Swiss Army Knife for my selection of tools.
If you have to develop Java customization you have to set some coding standards.
In real world scenarios you will always face some challenges to keep in sync development, test and production environments. Unfortunately, there is no tool to compare two different Maximo environments. That's why I have develop my own method.
An effective technique is to periodically clone the production environment to the test and development environments with a procedure like this.
On the other side it is important to use Migration Manager to move packages to be released from dev to test to production.


Source:http://maximodev.blogspot.com/2013/07/best-practices-for-maximo-projects.html