Yearly Archive 2019

ByJayanthi

Certifications vs Degree

Reading Time: 2 minutes

‘Certifications’? Ask this to any computer professional – and their eyes will surely glow… 🙂 ‘certifications’ are available in every computer field – as an example, we have the Oracle Java certifications(OCJP, OCJWCD), PMP certifications, data center certification(CCNA, CCNP), computer hardware certifications(A+, Server+), cloud certifications(AWS, CCNA) and the Information security certifications like CISSP, CCSP, CEH(which I am most interested in… 🙂 ) and more…- in fact, you can hardly meet a software professional in the computer field who is not certified!!

Degrees:

Having said this, many colleges also offer degrees in the Computer field such as Bachelors degree in Computer Science and Engineering(for India), Masters degree in Computer Science and Engineering and many other degrees directly or indirectly related to the Computer field. All these degrees require 4 years(Masters programs will take lesser number of years) of hard work and good grades to pass with a good GPA or marks. 

So, which is more respected – degrees or certifications in the computer industry?

As you step into the employment phase of life, initially, educational qualifications will definitely pave the way for a good and plum job in the desired industry and domain. But after a period of time, as technology rolls and changes all in its path – though our core values from the degree are strong and firm, we need additional skills to move up the career ladder. This is where certifications step in. 

Every certification tests you on different skills apart from your work experience. In fact, mid and high level positions in an organization might demand certifications to validate you and make sure that you are still in sync with the industry. You will have to spend at least 3-4 months  studying for these certification exams and the exams will not be easy by any means. After you are certified, most of these certifications might have to be renewed every few years. In fact, I have high respect for professionals who put a series of certifications behind their name!! 🙂

Conclusion:

I am sure any organization will be happy with a candidate who has an amazing degree plus all the relevant certifications but I think certifications definitely steal the thunder from a higher degree in the mid and high level employment space!! 🙂

This is the fifth post for #MyFriendAlexa by @Blogchatter. I am taking my blog to the next level with #MyFriendAlexa and #Blogchatter.

 

ByMani Prithiviraj

Habit 1: Be Proactive

Reading Time: 3 minutes

 In the previous article, we reviewed Covey’s 7 Habits of Effective people. We understood  how alignment of actions with natural principles, balance of production and production capacity are important. In this post, we will look at the first habit which is “Be Proactive”. This is one of the habits associated with the self.

            Covey writes that a unique human endowment is “Self Awareness”. This is something that other life forms in the world do not possess. Some examples of Self Awareness are: self evaluation, learning from our experiences and learning from experiences of others. We have the ability not only to be trained, but also choose a training that suits us or even create a training.

            The term ‘proactivity’ is used a lot by modern organizations as a buzz word. While it refers mainly to taking the initiative, Covey explains that it goes well beyond that. According to him, proactivity also means that we are responsible for our lives and that our behavior is a function of our decisions and not conditions. We do not blame circumstances or others for problems that we face.

            I work in the area of customer support and one of the areas we focus on is proactive support. What is it that is different in proactive support? A few differentiators are:

  • In addition to resolving issues customers come to us for, we reach out to customers to see how they are doing and see if they need any help via phone, emails or visits.
  • Whenever a new release of a software is out, we explain new features that can be beneficial to the customers (rather than wait for the customers to ask us).
  • We offer to review existing processes to see if they can be improved to enhance productivity.

We see that the proactive support model give us a much higher probability of improving customer satisfaction, increasing their success and  encourage our customers to give us more business. It also improves the quality of our products, since we use feedback from the field and pass it on to the developers who work on enhancing the product.

We are all subject to Stimuli from the outside. Covey says that between Stimuli and Response, we have the ability to choose. A proactive person thinks and chooses an appropriate response to the stimulus he or she receives.  For example, one of our customers might come to us with a very harsh criticism. Now while the criticism might lack professionalism, the basis for the criticism may be justified. A proactive approach to the situation is to carefully analyze the problem in hand and focus on getting a solution for the problem.

During India’s Independence Struggle, Mahatma Gandhi remarked that “They cannot take away our self-respect if we do not give it to them”. The reason our feelings get hurt is not because of what happens to us, but our response to what happens to us.

As human beings we have several concerns in life. Concerns can be grouped into two areas as described by Covey. The inner circle in the figure below refers to things that are under our control. The outer circle describes things that are not directly within our control (e.g. the Weather, global economy)

 

Proactive people are focused mainly on the circle of influence. This approach helps in slowly expanding our circle of influence. On the other hand reactive people are more focused on the circle of concern.

Some of Covey’s suggestions for expanding our circle of influence are:

  • Being a better listener
  • Being a better spouse or family member
  • Being a better student and employee
  • Being a better manager.
  • Being a better teacher.

It is not that we completely ignore the circle of concern. We still need to think about it, but not let it be the major part of focus. We always have the choice of choosing an action. However, the outcome of our action is always aligned with natural principles. For example, we may choose not to wear our seat belt while travelling. However, if the vehicle comes to a sudden and  un-expected stop, we may get thrown, since that is a natural consequence the laws of physics.

According to Covey, the heart of the circle of influence is our ability to make and keep commitments and promises.  The commitments we make to ourselves and others and our ability to keep them is the clearest manifestation of our proactivity.

Hope you enjoyed this post. In the next post, we will look at the 2nd habit which is “Begin with the End in mind”.

Reference: 25th Anniversary Edition “The 7 Habits of Highly Effective People” by Stephen R. Covey.

This is the fourth post for #MyFriendAlexa by @Blogchatter. I am taking my blog to the next level with #MyFriendAlexa and #Blogchatter.

ByJayanthi

ATM hacking

Reading Time: 2 minutes

Cars can be hacked, phones can be hacked, all smart devices can be hacked – so why not ATM machines? Scary isn’t it? This news from the ‘Economic times’ stole my glance and I had to blog about it right away! 

Hacking and the procedure to do it required a bit of expertise in the days gone by, but that is no longer the case in today’s world. Data breaches cost millions of dollars in losses and ATM hacks are also estimated to cost around $3.5 million dollars in losses between late 2017 and early 2018 in the US (Source: https://www.cnbc.com/2019/08/01/atm-hack-attacks-caught-on-video.html)

In today’s world, we do not  need thorough hacking and certified professionals to hack ATM machines to steal your credit/debit card information. It can be done by simple tools such as ATM malware cards and ATM hacking tutorials which are easily available in the “dark web” for as low as 100$. And how much time does it take to do it? Just 15 minutes!!

Sounds easy for a hacker, isn’t it?

It is…in fact… in a physical attack, if a device is implanted behind the ATM machine, the machine will give out cash without proper authentication to unauthorized individuals!! (yikes!!)

Since most ATM machines use the same software, attacking one machine will ensure that similar machines can be attacked in a similar manner. Most ATM hacks are performed on machines that run the Windows XP operating system.

How to protect yourself:

After the shocking news of how common and easy it is do ATM hacking, the next question comes about how to protect yourself from it:

  1. It is always wise to use ATMs at well lit locations and those locations that see more footfall
  2. Be aware of ATM skimmers(these are the ones that steal your credit/debit numbers and your PIN) that are attached to the ATM machines and make sure that you are able to use the card smoothly(if not – there is a probability that a skimmer is attached)
  3. Keep track of your bank balance constantly
  4. If you can – try and withdraw money from the bank itself(or try using “Cash back” option in the US and other Western countries)

ATM hacking and other attacks are always on the rise. It is imperative for us as customers to keep ahead of the curve and adopt safety practices!!

References:

  1. https://www.moneycontrol.com/news/trends/ready-made-tools-to-hack-atms-now-trending-on-dark-web-4421901.html
  2. https://www.cnbc.com/2019/08/01/atm-hack-attacks-caught-on-video.html
  3. https://www.marketwatch.com/story/how-to-protect-yourself-against-atm-hackers-2017-04-04

This is the third post for #MyFriendAlexa. I am taking my blog to the next level with #MyFriendAlexa and #Blogchatter.

ByMani Prithiviraj

7 Habits of Highly Effective People

Reading Time: 2 minutes

The 7 habits of highly effective people is a compilation by Stephen Covey of age old natural principles. Examples of natural principles are fairness, integrity, dignity, service, patience, quality and excellence.  According to Covey, anyone who consciously aligns their goals (personal or professional)  to these natural principles is bound to be very successful in life (Mahatma Gandhi is an excellent example of a successful person since he was aligned with natural principles) 

If a farmer wants a good yield at the end of the year, he needs to take appropriate steps throughout the year (e.g. Prepare the land, plant the seed, irrigate the plants, remove the weeds and finally harvest) If a farmer skips any of the steps or tries to compress the process, he is not likely to be successful in getting a good harvest. Similarly, Covey says that in life one has to align goals (personal and professional) to be in line with natural principles to be successful.

Covey defines a ‘Habit’ as an intersection of knowledge, skill and desire. Knowledge refers to theory or the “what to”. Skill refers to the “How to” and Desire refers to “Want to”. In order to make something a habit, we need to have the knowledge, know how to execute and also have the desire to execute.

The 7 Habits are:

  1. Be Proactive
  2. Begin with the end in mind
  3. Put first things first
  4. Think Win-Win
  5. Seek first to Understand then to be Understood
  6. Synergize
  7. Sharpen the Saw

       The first three habits are focused on the self (inside) and the next three are focused on the outside (inter-personal relations). The last habit is the habit of rejuvenation or constant learning.

         Why are these habits of effectiveness? They are habits of effectiveness since they are all based on the natural principal of balancing production and the capability of production. Let us look at an organization with employees. Employees are capable of producing work which is beneficial to the organization. However employees also need to be cared for and nurtured,  in order to be able to produce work. If they over-worked and over-loaded by the management, then they lose the ability to produce results for the organization. A delicate balance between production and production capability is required according to Covey (similar to Aesop’s Fable story of the goose that laid the golden eggs).

          I was first introduced to Covey by my then reporting Manager Nathan Mac Donald in the year 2012. I can say for sure that ever since I started reading Covey’s book and making an attempt to follow them, I have seen small incremental improvements. My wish is that I had started when I was in school and college. However, I do believe that it is not late for anyone to start following the 7 habits of highly effective people. In my following posts, I will spend time discussing each of the seven habits.

Reference: 25th Anniversary Edition “The 7 Habits of Highly Effective People” by Stephen R. Covey.

This is the second post for #MyFriendAlexa. I am taking my blog to the next level with #MyFriendAlexa and #Blogchatter.

 

ByJayanthi

AI and Cyber security

Reading Time: 3 minutes

“Artificial intelligence” or “AI” is a word that has been generously splashed all over and is omnipresent in our lives today and yet most of us are hardly aware of it. From Siri to Alexa to spam filters to smart searches, AI is powering our lives and simplifying it wherever we go.  

What is AI and how does AI work?

In simple terms, AI is a part of Computer Science that tries to simulate human intelligence in machines. Machine learning is a sub-topic of AI and is used along with AI or independently. 

Considering ‘gmail’ as an example, have you ever wondered how regular unwanted email gets pushed into the  “Spam” folders? One way “spam” can be detected is by making use of AI. By carefully studying hundreds and thousands of messages, the machine learns that the messages with certain “keywords” fall into “Spam”.  In our example here, the machine is trained to be “artificially intelligent” to detect “spam”.

This type of learning is close to our learning process as well. The more we read, understand and comprehend – the more decisions we can take. 

We can also see AI and ML(machine learning) powering the job sector with bots speaking to job seekers and helping them get an appropriate  job.

Cyber security:

“Cyber security” is a branch of study which is used to secure personal and business assets through various means and possibilities (like firewalls, VPNs, anti-virus definitions and more) It also involves studying different types of attacks and preventing them in addition to in-depth topics like phishing, ransomware, pen testing, vulnerability assessment and more.

This is a minimal list of cyber security duties –

The cyber security analyst is expected to read a lot of network data in traffic packets and understand the patterns and anomalies in them. This will enable them to detect threats early and sound the alarm for organizations to prevent breaches. Cyber security engineers also work to detect viruses by comparing new files against a signature list of virus definitions.  

So, what happens when “cyber security” makes use of AI?

There are many ways where AI helps cyber security:

  1. Human beings get weary and tired of doing network analysis for a prolonged period of time. Detecting threats and tuning applications is a tedious job, and prone to errors as fatigue sets in. “Alert fatigue” is real and human beings get exhausted looking for patterns and anomalies in the network. This is where AI steps in to enable the user to detect threats more easily. Machines never tire and the power of “artificial intelligence”  and “machine learning” is harnessed by using algorithms that detect “keyword matching, statistics monitoring, anomaly detection”(Source: https://resources.infosecinstitute.com/ai-in-cybersecurity/#gref)
  2. AI systems are also trained to detect malware in software rather than only human beings doing it. 
  3. Making the users click on malicious links in an email is the simplest form of hacking. Innocent users click on poisonous links that lead them to part with their precious data. These phishing emails can also be detected by using AI by employing appropriate algorithms.
  4. The power of artificial intelligence can also be harnessed when responding to security incidents. Human intelligence and artificial machine intelligence can work together to speed up detection and response times to security incidents.

These are some ways that cyber security engineers can make use of AI. But it has be remembered that AI can be used by hackers and other miscreants for their own benefit too. It is up to cyber security professionals to keep ahead of the game and thwart them with appropriate techniques.

This is my first post for #MyFriendAlexa. I am taking my blog to the next level with #MyFriendAlexa and #Blogchatter.

 

 

 

ByJayanthi

Face app

Reading Time: 3 minutes

It seems the online world is embroiled in some sort of controversy or the other giving me plenty to write about!! 😉 Jokes aside – have you downloaded and used the currently viral ‘Face app’?   If you have or have not yet done so, read on…

What is ‘Face app’?

‘Face app’ – the AI , face editor is a freely downloadable app for both Android and iOS platforms and is owned by a Russian company Wireless Labs. It is available both on Google Play and Apple App store. I downloaded it and it was really fun to try the different looks(with a smile, without a smile, with makeup, without makeup) and the younger version and older version of oneself are phenomenal too…For a moment, I threw all my security caution to the wind and dissolved into it and enjoyed it!! 🙂 But, not for long… 

The ‘Face app’ asks for your permission to access the pictures from your ‘Gallery’ and no sooner, do you give it the permission – it takes your ‘face’ from a picture and performs a lot of magic to it. It definitely keeps you enthralled and even has options to use your pictures from social media platforms such as ‘Facebook’.

What is all the noise about ‘Face app’ now?

On the face of it, ‘Face app’ seems to be another app for everyone to have a bit of fun online, but there is more to what meets the eye. Your pictures are all uploaded to the cloud which itself is unnerving from a privacy standpoint. Along with this, there is another problem that has been reported widely which is in the ‘Terms and conditions’ of the viral app. The ‘Terms and conditions’ state this:

“You grant FaceApp a perpetual, irrevocable, nonexclusive, royalty-free, worldwide, fully-paid, transferable sub-licensable license to use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, publicly perform and display your User Content and any name, username or likeness provided in connection with your User Content in all media formats and channels now known or later developed, without compensation to you..”

While you own your “face” content, you are giving the app exclusive rights for your “face” content to be stored perpetually and be used for other derivative works and display it anywhere!! (yikes) I cannot imagine my face being stored on some strange servers in some part of the world and being used for strange purposes!! 

This is the part of the ‘Faceapp’ that is deeply troubling for all users of the Internet community today.

What is being done then?

  1. US Senate minority leader, Chuck Schumer has called on the FBI and Federal Trade Commission to look into the privacy issues with ‘Faceapp'(Source: economictimes.com)
  2. In the wake of privacy concerns, the CEO of Faceapp has stated that most of the pictures are deleted within 48 hours(Source: https://techcrunch.com/2019/07/17/faceapp-responds-to-privacy-concerns/)
  3. User data is definitely not transferred to Russia
  4. Users can requests their data to be deleted
  5. Only the selected picture is uploaded and not all the pictures from the ‘Gallery’ are uploaded

The net result of heavy outburst on social media unfortunately or fortunately, the downloads for ‘Faceapp’ have supposedly increased by 500% in the last six days(Source: https://www.forbes.com/sites/johnkoetsier/2019/07/18/controversy-good-for-business-faceapp-downloads-jumped-561/#759ad9c3577c)

My take on the whole Faceapp drama:

While privacy issues constantly rake the online world, this is probably one of the few times that even non-serious security individuals have woken up to security and privacy thoughts. While our entire online data(conversations, payments, locations, group pictures, events, gatherings) is always moving silently behind the computer screen, a picture of a “face” moving around has really shaken everybody up( A picture is definitely worth a thousand words 🙂 !! ) More people are questioning the privacy behind the fun which is definitely a good thing.

We will see how the ‘Faceapp’ drama unfolds further but for now it is good to see ‘Faceapp’ has definitely woken up the sleeping privacy giant in all of us!!

Cheers!

 

ByJayanthi

Are you a “Cyberchrondriac?” or a “Script kiddie?”

Reading Time: 2 minutes

Cyberchrondriac:

I am sure most of us have heard of the term “hyperchrondriac”. A “hyperchrondriac” is a person who is excessively worried about their health and imagines any minor ailment as a major health concern. Combine this feeling with today’s Internet usage and we have a “cyberchrondriac”!

A “cyberchrondriac” is a person who is guilty of combing the Internet for any or more information about their health concerns. They read various things on the Internet about the minor symptoms that they may have and imagine that they have a terrible disease. With more and  more medical terms and information freely available on the Internet, we all become “cyberchrondriacs” at one time or the other. Their medical ailments may be unfounded or real – but they definitely add to the misery of doctors who are trying to diagnose the real problem. Best option for all “cyberchrondriacs” is to seek medical advice right away and not do a lot of medical research on the Internet…

Script kiddies:

The Internet is our oyster now. We can do anything and everything with its might.We can crack, cook, code, learn and more with the Internet… then why not “hack”? Those looking to hack into websites can learn a great deal by a single minded effort to learn malicious things online. This is where “script kiddies” step in…

‘Script kiddies’ is the name given to newbie hackers. These newbie hackers are not professional hackers and have not perfected the art of ‘hacking’. ‘Script kiddies’ are those who have learnt to hack by reading various articles and publications and watching several online videos on hacking. They also steal other people’s code as they lack enough programming knowledge to wield an attack. In spite of the fact that they are “professional hackers” in the making, their attacks still do affect the majority of users in an equally harmful way. ‘Script kiddies’ do all this and more for the excitement of it and to get joyous bragging rights.

This post saw a definition of a few terms on the Information security front…Stay tuned for more technical updates..

 

 

ByBala Manikandan

ArrayLists: Dynamic Arrays in Java (Part 2)

Reading Time: 3 minutes

Here is the second post on ArrayLists which is a continuation from part 1 . Here are some points covered in the first part:

  • Main advantage of ArrayLists over arrays
  • Creating an ArrayList
  • Adding elements to ArrayLists
  • Iterating through the elements
  • Modifying and deleting elements

In the next section, we will deal with some methods commonly used to query an ArrayList.

Querying ArrayLists:

The following example demonstrates the usage of some more ArrayList methods:

//Other methods of ArrayList

package codingexamples;

import java.util.*;

 

public class ArrayListExample3 {

     public static void main(String[] args){

        ArrayList<String> list = new ArrayList<>();

        list.add(“Apple”);

        list.add(“Banana”);

        list.add(“Grapes”);

        list.add(1, “Watermelon”);

        list.add(“Apple”);       

        System.out.println(list);       

        String val = list.get(3);     //retrieve element at index 3

        System.out.println(val);

          int sz = list.size();

        System.out.println(sz);

       

        System.out.println(list.contains(“Banana”));

        System.out.println(list.contains(“String”));

        System.out.println(list.indexOf(“Apple”));

        System.out.println(list.indexOf(“String”));

        System.out.println(list.lastIndexOf(“Apple”));

     }

}

The output of the code is:

[Apple, Watermelon, Banana, Grapes, Apple]

Grapes

5

true

false

0

-1

4

The methods get() and size() used above are self-explanatory, which is evident from the first three lines of output (remember that index 3 is the fourth element). The method contains() returns true if the specified item is present in the list and false otherwise. In this case, the list contains “Banana” but does not contain “String”. And last, the indexOf() and lastIndexOf() methods return the indices of the first and the last occurrences of the specified object, respectively, or -1 if the object is not present. This is consistent with the above output.

The next section deals with a slightly more advanced concept related to ArrayLists.

Role of the equals() method in results of ArrayList methods:

The equals() method of class Object is inherited by all the classes in Java. But by default, it only checks whether the references of the invoking object and the method parameter are the same, or in other words, it returns true only if they refer to the same object. However, classes may override this method and define a new “equality” condition, which usually involves comparison of the instance variables of the objects.

Some of the methods in the ArrayList class, such as remove(), contains(), indexOf() and lastIndexOf() use the equals() method to check if an object is present in the list or not. Thus depending on whether the equals() method is overridden or not, the results of these methods may differ. This is demonstrated in the following code:

//Demonstrating effects of overriding equals() in classes used as the

//element type in an ArrayList

package codingexamples;

import java.util.*;

 

class Person1{

    private String name;

    Person1(String nm){name = nm;}

    public String getName(){return name;}

    //no equals() override

}

class Person2{

    private String name;

    Person2(String nm){name = nm;}

    public String getName(){return name;}

   

    //Override equals(), returns true if the names are equal

    public boolean equals(Object obj){

        if(obj instanceof Person2){

            Person2 other = (Person2)obj;

            boolean isEqual = this.name.equals(other.name);

            return isEqual;

        }

        else

            return false;

    }

   

}

public class ArrayListExample4 {

    public static void main(String[] args){

        ArrayList<Person1> list1 = new ArrayList<>();

        Person1 p1 = new Person1(“John”);

        Person1 p2 = new Person1(“Roger”);

        list1.add(p1);

        list1.add(p2);

       

        System.out.println(list1.contains(p2));                     //prints true

        System.out.println(list1.contains(new Person1(“Roger”)));   //prints false!

        list1.remove(new Person1(“John”));                      //doesn’t remove John!

       

        for(Person1 p : list1)

            System.out.print(p.getName() + “:”);

        System.out.println();

       

        ArrayList<Person2> list2 = new ArrayList<>();

        Person2 p3 = new Person2(“John”);

        Person2 p4 = new Person2(“Roger”);

        list2.add(p3);

        list2.add(p4);

       

        System.out.println(list2.contains(p4));                    //prints true

        System.out.println(list2.contains(new Person2(“Roger”)));  //also prints true!

        list2.remove(new Person2(“John”));                         //removes John

       

        for(Person2 p : list2)

            System.out.print(p.getName() + “:”);

        System.out.println();

    }

}

The output of the code, as it turns out, is:

true

false

John:Roger:

true

true

Roger:

The above code defines two almost identical classes, Person1 and Person2, both of which have a single instance variable, name. But Person1 does not override equals(), whereas Person2 does. In case it is tough to understand the code in the equals() override of class Person2, for now just remember that the new definition returns true if the names of the two Person2 objects are the same.

Now an ArrayList of Person1 objects is created and two Person1 objects with names John and Roger are added to it. If the ArrayList is queried whether it contains the object referenced by p2 (that is, ‘Roger’), it results in true. But if instead you pass a new object whose ‘name’ is also Roger to the contains() method, it results in false! Why? Because Person1 did not override equals(), and thus only object references were compared all along! Similarly, the next line demonstrates an unsuccessful (for the very same reason) attempt to remove ‘John’ from the list. This is demonstrated in the third line of output, which displays the ‘names’ of all the elements in the list.

The same things are done for another ArrayList of Person2 objects, and a significant change is observed in the output, only because Person2 overrode equals(), and so names instead of object references were compared! Thus the second call to contains() on the second list also produced true, and this time John was successfully removed from the list.

We have seen how to use ArrayLists in Java in this post – stay tuned for more technical posts!

ByBala Manikandan

ArrayLists: Dynamic Arrays in Java (Part 1)

Reading Time: 3 minutes

Before beginning this post, I would like to state that this post assumes some prior knowledge of Java (particularly arrays, classes and objects, and overriding)

The main limitation with arrays (groups of elements of the same datatype that are referenced by a common name) in Java is that they have a fixed size, and cannot shrink or grow in size. To overcome this, the ArrayList class can be used, which offers the functionality of a dynamic array. This class implements the List interface, which itself defines the methods used to manipulate ArrayLists. Both the class and the interface reside in the java.util package. This post deals with the functionality of various methods in the ArrayList class.

Adding elements to ArrayLists and Iterating through them:

The following example shows how to add elements to an ArrayList and iterate through them.

//Adding elements to an ArrayList and iterating through them

package codingexamples;

import java.util.*;

public class ArrayListExample1 {

    public static void main(String[] args){

        List<String> list = new ArrayList<>();    //works in Java 7 and above

        list.add(“Apple”);

        list.add(“Banana”);

        list.add(“Grapes”);

        list.add(1, “Watermelon”);              //insert “Watermelon” at position 1       

        System.out.println(list);               //prints out names of elements

        System.out.println();

               //iterate through elements using enhanced for loop

        for(String s : list)

            System.out.println(s);

            System.out.println();

            //iterate through elements using ListIterator

        ListIterator<String> itr = list.listIterator();

        while(itr.hasNext())

            System.out.println(itr.next());

        }   

}

The output of the code is:

[Apple, Watermelon, Banana, Grapes]

Apple

Watermelon

Banana

Grapes

Apple

Watermelon

Banana

Grapes

The first line marked in bold shows how to create an ArrayList. Note the use of angle brackets in this line. ArrayList can work with multiple object types (it is a generic collection), and the type to be stored (in this case String) must be specified in the angle brackets, making ArrayLists type safe. Also, as mentioned earlier, ArrayList implements the List interface, and all the methods commonly used with ArrayLists are defined in this interface itself. So, a List reference may be used to store an ArrayList object, as shown in this line. As of Java 7, the angle brackets on the right side of the ‘=’ sign can be left empty. So prior to Java 7, you would have had to write,

List<String> list = new ArrayList<String>();

The next few lines add elements to the ArrayList. While the elements “Apple”, “Banana” and “Grapes” are added to the end of the list each time (using the single argument add() method), the element “Watermelon” is inserted at position 1 (so that it is the second element, as the numbering starts from 0), using the two-argument add() method. The remaining elements are shifted ahead by one position when this happens.

In the next line, the list is passed to the println() method, which shows the elements of the ArrayList in order, in agreement with the add() method calls. And finally, the elements of the ArrayList are iterated through, using an enhanced ‘for’ loop and a ListIterator (observe the syntax when using ListIterator).

Modifying and Deleting Elements:

The following example shows how to modify and delete elements from an ArrayList:

//Modifying and deleting elements of an ArrayList

package codingexamples;

import java.util.*;

public class ArrayListExample2 {

    public static void main(String[] args){

        ArrayList<String> list = new ArrayList<>();

        list.add(“Apple”);

        list.add(“Banana”);

        list.add(“Grapes”);

        list.add(1, “Watermelon”);

        list.add(“Apple”);

       System.out.println(list);

     

        list.set(2, “Pomegranate”);      //modify element at index 2

       

        System.out.println(list);

       

        list.remove(2);                 //remove element at index 2

        list.remove(“Apple”);           //remove first occurrence of “Apple”

       

        System.out.println(list);

       

        list.clear();                   //clear the ArrayList

       

        System.out.println(list);

    }

}

The above code outputs:

[Apple, Watermelon, Banana, Grapes, Apple]
[Apple, Watermelon, Pomegranate, Grapes, Apple]
[Watermelon, Grapes, Apple]
[]

The first line of output shows the initial contents of the ArrayList. Then the set() method is used to modify the element at index 2 (that is the third element), which is reflected in the second line of output. After this, the element at index 2 and the element “Apple” are removed using the remove() method. But since the element “Apple” occurs twice in the ArrayList, only the first occurrence of the element is removed. The effect of this is shown in the third line of output. Finally the clear() method is used to clear the ArrayList, which is shown in the fourth line of output.

With this we come to the end of Part 1 of this post. For more information on ArrayLists, please do read Part 2 of this post which will be published on Friday, July 5th, 2019…

ByJayanthi

‘Sharenting’

Reading Time: 3 minutes

‘Sharenting’ – “What is that?” might be the thought for many of us…it was the same thought for me too and soon I was researching more and more into the topic…here are a few of my findings and thoughts…

Social media personalities:

As discussed in another post, all of us have different social media personalities when we are online. While some of us feel comfortable sharing only our achievements online, many of us share a whole lot of other personal things  and there are yet others who totally shun social media! All of us have different takes and views on sharing information online. While there is no perfect right or wrong here and each person is entitled to share what they want,just knowing the risks empowers us.

The “star” subject:

These days there are videos for every type of content….

“You need to bake a cake?”  “Just go to YouTube” might be a popular retort…

“You want to paint?” “Just head to YouTube too”…

“You want to learn Java?” “Head to YouTube – there are plenty of live coding examples that make coding much more easier to learn…..”

While the subject in the above example is “cake”,”paint brush” and “code”, there are numerous videos where the subject is “children”. Children growing, talking about everyday activities with children, children,children and more children…most of the times the author talks about their own children in great detail. Not only videos, there are blog posts and other means of sharing which feature one’s own children.

Some times, some children’s digital identities are fixed from the time they are in their mother’s wombs!!

The more information we share about them – the more views, likes, shares and subscribers we get. We think we are helping other people out there in the same boat(and we might be helping somebody I am sure) -but I am not sure if that is always the case…in the corner of my mind there comes a faint thought if we are exploiting the children in any way because they cannot say anything…

This is “sharenting” which is talking excessively about them and recording every minute detail in full public view….

I admit I am also guilty of a few posts about my grown children as well! 🙂 But all my posts are reviewed by the star of the post – as all of them are old enough to make that decision. Some times, they are amused and sometimes they are not so amused but I hit “publish” only after the final assent by them!

I think most of us do not have that luxury as most of our child subjects are too young. We assume that we do not have to take their permission and yes, if they are too young – we cannot and we do not have to….

But apart from the privacy thought,the multi-million dollar sharenting question is what will the child think of all this sharing and “sharenting” when they grow up?

As you might be knowing, children grow up fast and it will be just be another 4-5 years before they assert their online identity.

Will they say “Stop, mom and dad, why did you have to record me so much?”or will they share your happiness in all the recording and sharing? Only time will tell…

Conclusion:

So, where are you on the “sharenting” spectrum? Do you share a little about  your kids or do you share a lot about them? What do you think they will think of this in the future?

What is my final take on “sharenting”? Take “sharenting” with care and balance – let us not embarass our future social media citizens!! 🙂

All thanks to Cybermum_India and Cybermum_AU for this thought that transformed into a complete blog post! 🙂