Programming – How to create PNG images

I am developing an Android application and I would like to create different images to use in my application, but I don't know anything about graphic design, what platform or application do you recommend? If you want to recommend some UI / UX courses, graphic design courses, no problem. Thank you.

The database migration wizard for Unicode by Oracle does not respond after using the programming column option

I published this problem in Oracle Community, but I would like to post it here to have more opinions on this topic.

Issue:

  • I have a problem with DMU 19.1, which is the DMU application
    not responding (frozen or locked) after cleaning the data using
    program the problem column (the problem exceeds the limit of the column). That
    It happens frequently and every time this happens, I have to use the homework
    manager to finalize the DMU application.

Here is my summary of the configuration:

  • The DMU is installed on a Windows Server 2008 R2 SP1 client machine
    which connects to Oracle Database Server 11.2.0.4. The host of
    The database server is the Linux base. The JDK that DMU is currently
    using is JDK 1.8.0_231 The DMU installed all the packages that
    requires the DMU document, including the creation of a separate table space
    for DMU repository. The DMU will be used to convert the character.
    configured for a database with a size larger than 1.5 TB of storage. I
    I was able to scan the entire database and now I am cleaning data
    step, and this problem happened.

Looking at the record, I could find the cause. Due to privacy, I could not copy the entire record here. Instead, I will try to write down the registration problem as much as I can. Here is the log message:

  • Principal; S; 05001 Stack of exception calls in
    Java.lang.ArrayIndexOutofBounds Exception -2 in
    Java.Util.ArrayList.elementData (ArrayList.Java: 422) in
    Java.Util.ArrayList.get (ArrayList.Java: 435) in
    oracle.duma.gui.cleansing.cache.defaultCachePage.getObject
    (defaultCachePage.Java: 96) in
    oracle.dmu.gui.cleansing.cache.defaultDataProvider.getCellData
    (defaultDataProvider.Java: 262) in
    oracle.duma.gui.cleansing.model.cleansingDataGridModel.getOriginalDataAt
    (cleansingDataGridModel.Java: 1218) …
  • The rest of the record were exceptions thrown from Java.wing and
    java.awt. For example. J Component. Java 5158, 1065, 889 or
    Javax.swing.bufferStrategyPaintManager 290 and so on.

My attempt:

  • I think I can try to find some solutions if I read the ide.conf o
    dmu.conf
    , but I couldn't find much about this information or any
    Documents on this subject.

Please let me know what I should do or what I should analyze this problem.

Best,

Khang Mai

Programming: the formula for the processing speed of each job cannot be understood

I am trying to understand the formula for the processing speed of each job. I got the formula from the following link:

Fair online programming for selfish jobs in heterogeneous machines

The other details are provided below:

Description1

I can't understand what the source of the following formula is. The speed is given by:
S = V * t

Why do we have this fraction term in the formula? What does the denominator represent? I think it represents the processing time of each job.

Someone please guide me

Description 2

Programming languages: Have Java inventors publicly expressed their regret for hashCode and equals in the Object class?

I was talking to a colleague recently about hashCode and it is the same as methods in the Object class in Java (among other languages). I am of a more theoretical formation, while my colleague is more a pragmatic person.

In my opinion, it makes no sense to have the hashCode and the same methods defined in the Object class. While our personal discussion was quite fun, I am more interested in an official retrospective on this subject of the original inventors of Java. Have you ever publicly expressed your regret for having made the decision? Or have they explicitly defended their decision against criticism in public?

Public statements from people other than the original developers are also welcome, but only from people with at least some level of authority and notoriety.

Thanks in advance!

unit: I have no idea how to calculate the faces of my mesh generated by programming

So I am doing a cave program that generates programs and I have all the vertices, but I have no idea how to solve the faces of my mesh. My code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MapGen : MonoBehaviour
{
    Mesh mesh;

    int() triangles;

    public int xSize = 20;
    public int zSize = 20;
    public int ySize = 20;
    (Range(0f, 4.5f))
    public float SurfaceLevel = 3.5f;
    Vector3() interest;
    Vector3 old = new Vector3(0, 0, 0);
    public bool ShowAlg = false;
    (Header("Slows down the scene veiw dramaticly when in play mode!"))
    public bool ShowVert = true;

    // Start is called before the first frame update
    void Start()
    {
        mesh = new Mesh();
        GetComponent().mesh = mesh;

        CreateShape();
        SolveFaces();
        UpdateMesh();
    }
    void CreateShape()
    {
        interest = new Vector3((xSize + 1) * (zSize + 1) * (ySize + 1));

        float seed = Random.Range(0.2f, 0.5f);
        Debug.Log(seed);

        for (int x = 0; x <= ySize; x++)
        {
            for (int i = 0, y = 0; y <= zSize; y++)
            {
                for (int z = 0; z <= xSize; z++)
                {
                    float ypn = (Mathf.PerlinNoise(x * seed, z * seed) * 2f);
                    float xpn = (Mathf.PerlinNoise(y * seed, z * seed) * 2f);
                    float zpn = (Mathf.PerlinNoise(x * seed, y * seed) * 2f);

                    if (ypn + xpn + zpn >= SurfaceLevel)
                    {
                        interest(i) = new Vector3(x, y, z);
                    }

                    i++;
                }
            }
        }
    }

    void SolveFaces()
    {
        triangles = new int(xSize * ySize * zSize * 9);

    }
    void UpdateMesh()
    {
        mesh.Clear();

        mesh.vertices = interest;
        mesh.triangles = triangles;


        mesh.RecalculateNormals();
        MeshCollider meshc = gameObject.AddComponent(typeof(MeshCollider)) as MeshCollider;
        meshc.sharedMesh = mesh;

    }
    private void OnDrawGizmos()
    {
        if (interest == null)
            return;
        for (int i = 0; i < interest.Length; i++)
        {
            if (ShowVert == true)
            {
                Gizmos.color = new Color (0.286f, 0.486f, 0.812f);
                Gizmos.DrawSphere(interest(i), 0.2f);
            }
            if(ShowAlg == true)
            {
                Gizmos.color = Color.green;
                Gizmos.DrawLine(old, interest(i));
                old = interest(i);  
            }
        }
    }
}

This script is placed on an empty game object with a mesh filter, a renderer and a collider.
Keep in mind that they do nothing without faces.
I set it up so that the face array goes to triangles variable and missing part of the script should go in the SolveFaces() function. Thanks in advance.

Add objects in object-oriented programming

Hello everyone, I have the following code, which has an instance method, which will have two parameters (in addition to self), which will be used to modify the properties (x, y) of the self object (the first parameter will be added to the value of the attribute "x" and the second to the property "y")

p = suma_Poo(2.3, 6.9)
p.suma(1.0, -1.0)
print("(x = {}, y = {})".format(p.x, p.y)) # Muestra "x = 3.3, y = 5.9"


class Point:

    def __init__(self, x, y):
"""La clase cuenta con dos atributos, 'x' e 'y'"""
       self.x = x
       self.y = y

     def suma_Poo(self, v1, v2):
        sumax = v1._x + v2_x
        sumay = v1._y + v2._y
        return (sumax, sumay)

if __name__ == "__main__":

# Example
  p = suma_Poo(2.3, 6.9)
  p.suma(1.0, -1.0)
  print("(x = {}, y = {})".format(p.x, p.y)) # Muestra "x = 3.3, y = 5.9"

Python: Udacity AI for dynamic robotics programming

This is the code for the left-turn policy at the end of lesson 12 in the Udacity course by Sebastien Thrun.

The following code was copied from the course solution and the github repositories of the students who completed (or copied from the video of the course solution) and it works.

I printed the value and policy of the 3d matrices and I can see how each iteration in the main loop is changing, but surprisingly the 4 sub-matrices of each of the values ​​and the policy are changing identically, since I thought that each sub-matrix was designated for one of the 4 headings. / orientations to which the car could be oriented (up, down, left, right) so that there are different values ​​in each submatrix since the costs of turning left and right or in a straight line are different.

Also, I don't understand how the first cell next to the goal becomes 20, which is a left turn cost and not 1, which is the direct cost.

I thought the goal of dynamic programming was to track the results returned by recursive calls?

If I wrote this from scratch, I would probably do a BFS or DFS search and track a minimum or maximum value for the total cost from the beginning to the goal. But the Udacity autograder would not accept my other BFS solutions that produced the same answer for other questions, so I am trying to learn how to do this the Udacity way.

Anyway, here is the Udacity code in its entirety with additional print declarations inserted so you can see what I mean. Does anyone know how this something works?

# ----------
# User Instructions:
# 
# Implement the function optimum_policy2D below.
#
# You are given a car in grid with initial state
# init. Your task is to compute and return the car's 
# optimal path to the position specified in goal; 
# the costs for each motion are as defined in cost.
#
# There are four motion directions: up, left, down, and right.
# Increasing the index in this array corresponds to making a
# a left turn, and decreasing the index corresponds to making a 
# right turn.

forward = ((-1,  0), # go up
           ( 0, -1), # go left
           ( 1,  0), # go down
           ( 0,  1)) # go right
forward_name = ('up', 'left', 'down', 'right')

# action has 3 values: right turn, no turn, left turn
action = (-1, 0, 1)
action_name = ('R', '#', 'L')

# EXAMPLE INPUTS:
# grid format:
#     0 = navigable space
#     1 = unnavigable space 
grid = ((1, 1, 1, 0, 0, 0),
        (1, 1, 1, 0, 1, 0),
        (0, 0, 0, 0, 0, 0),
        (1, 1, 1, 0, 1, 1),
        (1, 1, 1, 0, 1, 1))

init = (4, 3, 0) # given in the form (row,col,direction)
                 # direction = 0: up
                 #             1: left
                 #             2: down
                 #             3: right

goal = (2, 0) # given in the form (row,col)

cost = (2, 1, 20) # cost has 3 values, corresponding to making 
                  # a right turn, no turn, and a left turn

# EXAMPLE OUTPUT:
# calling optimum_policy2D with the given parameters should return 
# ((' ', ' ', ' ', 'R', '#', 'R'),
#  (' ', ' ', ' ', '#', ' ', '#'),
#  ('*', '#', '#', '#', '#', 'R'),
#  (' ', ' ', ' ', '#', ' ', ' '),
#  (' ', ' ', ' ', '#', ' ', ' '))
# ----------

# ----------------------------------------
# modify code below
# ----------------------------------------

# up, left, down, right
#heading = (0, -1, 0, 1)

def optimum_policy2D(grid,init,goal,cost):

    # 4 3D grids one for each heading
    value = (((999 for row in range(len(grid(0)))) for col in range(len(grid))),
            ((999 for row in range(len(grid(0)))) for col in range(len(grid))),
            ((999 for row in range(len(grid(0)))) for col in range(len(grid))),
            ((999 for row in range(len(grid(0)))) for col in range(len(grid))))

    policy = (((' ' for row in range(len(grid(0)))) for col in range(len(grid))),
             ((' ' for row in range(len(grid(0)))) for col in range(len(grid))),
             ((' ' for row in range(len(grid(0)))) for col in range(len(grid))),
             ((' ' for row in range(len(grid(0)))) for col in range(len(grid))))

    # for printing
    policy2D = ((' ' for row in range(len(grid(0)))) for col in range(len(grid)))

    change = True
    count = 0
    while change:
        change = False

        for x in range(len(grid)):
            for y in range(len(grid(0))):
                # heading ranges 0 to 3
                for heading in range(4):
                    # check for goal
                    if x == goal(0) and y == goal(1):
                        if value(heading)(x)(y) > 0:
                            change = True
                            value(heading)(x)(y) = 0
                            policy(heading)(x)(y) = '*'
                            change = True
                    # if grid cell navigable
                    elif grid(x)(y) == 0:

                        #calc 3 ways to propagate value (right, straight or left???)
                        for i in range(3):
                            # heading in (0,1,2,3)
                            # action = (-1, 0, 1), action_name = ('R', '#', 'L')
                            h2 = (heading + action(i)) % 4
                            x2 = x + forward(h2)(0)
                            y2 = y + forward(h2)(1)

                            if x2 >= 0 and x2 < len(grid) and y2 >= 0 and y2 < len(grid(0)) and grid(x2)(y2) ==0:
                                # add cost associated with R turn, no turn, L turn
                                v2 = value(h2)(x2)(y2) + cost(i)
                                if v2 < value(heading)(x)(y):
                                    value(heading)(x)(y) = v2
                                    policy(heading)(x)(y) = action_name(i)
                                    change = True

            count += 1
            print("iter {}".format(count))

            print('valuen ')
            for i in range(len(value)):
                for j in range(len(value(0))):
                    print(value(0)(j))
                print('nextn')

            print('policyn')
            for i in range(len(policy)):
                for j in range(len(policy(0))):
                    print(policy(0)(j))
                print('nextn')

    # after value function, populate the 2D map
    x = init(0)
    y = init(1)
    heading = init(2)

    policy2D(x)(y) = policy(heading)(x)(y) 

    while policy(heading)(x)(y) != '*':
        if policy(heading)(x)(y) == '#':
            h2 = heading
        elif policy(heading)(x)(y) == 'R':
            h2 = (heading - 1) % 4
        elif policy(heading)(x)(y) == 'L':
            h2 = (heading + 1) % 4 
        x = x + forward(h2)(0)
        y = y + forward(h2)(1)
        heading = h2
        policy2D(x)(y) = policy(heading)(x)(y)



    print('policy2D')
    for i in range(len(policy2D)):
        print(policy2D(i))
    #return policy2D

optimum_policy2D(grid, init, goal, cost)
```

programming challenge – LeetCode: Binary Tree Level Order Traversal C #

Please check for performance. and also naming convention

https://leetcode.com/problems/binary-tree-level-order-traversal/

Given a binary tree, it returns the level order path of its nodes & # 39;
values. (that is, from left to right, level by level).

For example:

Given binary tree (3,9,20,null,null,15,7),
    3
   / 
  9  20
    /  
   15   7

return its level order traversal as:
(
  (3),
  (9,20),
  (15,7)
)
using System.Collections.Generic;
using System.Linq;
using GraphsQuestions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TreeQuestions
{
    /// 
    /// https://leetcode.com/problems/binary-tree-level-order-traversal/
    /// 
    (TestClass)
    public class BinaryTreeLevelOrderTraversalTest
    {

        //      3
        //     / 
        //    9  20
        //   /  
        //  15   7
        (TestMethod)
        public void TreeTest()
        {
            TreeNode root = new TreeNode(3);
            root.left = new TreeNode(9);
            root.right = new TreeNode(20);
            root.left.left = new TreeNode(15);
            root.left.right = new TreeNode(7);
            IList> res = BinaryTreeLevelOrderTraversalClass.LevelOrder(root);
            CollectionAssert.AreEqual(res(0).ToList(), new List{3});
            CollectionAssert.AreEqual(res(1).ToList(), new List{9,20});
            CollectionAssert.AreEqual(res(2).ToList(), new List{15,7});
        }


        (TestMethod)
        public void OneNodeTreeTest()
        {
            TreeNode root = new TreeNode(3);
            IList> res = BinaryTreeLevelOrderTraversalClass.LevelOrder(root);
            CollectionAssert.AreEqual(res(0).ToList(), new List { 3 });
        }
    }

    public class BinaryTreeLevelOrderTraversalClass
    {
        public static IList> LevelOrder(TreeNode root)
        {
            List> res = new List>();
            if (root == null)
            {
                return res;
            }
            Queue Q = new Queue();

            Q.Enqueue(root);

            int counter = 0; // which level
            while (Q.Count > 0)
            {
                int children = Q.Count;
                res.Add(new List());
                for (int i = 0; i < children; i++)
                {
                    var temp = Q.Dequeue();
                    res(counter).Add(temp.val);
                    if (temp.left != null)
                    {
                        Q.Enqueue(temp.left);
                    }
                    if (temp.right != null)
                    {
                        Q.Enqueue(temp.right);
                    }
                }
                counter++;
            }
            return res;
        }
    }

}

Udacity AI for dynamic robotics programming

This is the code for the left-turn policy at the end of lesson 12 in the Udacity course by Sebastien Thrun.

The following code was copied from the course solution and the github repositories of the students who completed (or copied from the video of the course solution) and it works.

I printed the value and policy of the 3d matrices and I can see how each iteration in the main loop is changing, but surprisingly the 4 sub-matrices of each of the values ​​and the policy are changing identically, since I thought that each sub-matrix was designated for one of the 4 headings. / orientations to which the car could be oriented (up, down, left, right) so that there are different values ​​in each submatrix since the costs of turning left and right or in a straight line are different.

Also, I don't understand how the first cell next to the goal becomes 20, which is a left turn cost and not 1, which is the direct cost.

I thought the goal of dynamic programming was to track the results returned by recursive calls?

If I wrote this from scratch, I would probably do a BFS or DFS search and track a minimum or maximum value for the total cost from the beginning to the goal. But the Udacity autograder would not accept my other BFS solutions that produced the same answer for other questions, so I am trying to learn how to do this the Udacity way.

Anyway, here is the Udacity code in its entirety with additional print declarations inserted so you can see what I mean. Does anyone know how this something works?

# ----------
# User Instructions:
# 
# Implement the function optimum_policy2D below.
#
# You are given a car in grid with initial state
# init. Your task is to compute and return the car's 
# optimal path to the position specified in goal; 
# the costs for each motion are as defined in cost.
#
# There are four motion directions: up, left, down, and right.
# Increasing the index in this array corresponds to making a
# a left turn, and decreasing the index corresponds to making a 
# right turn.

forward = ((-1,  0), # go up
           ( 0, -1), # go left
           ( 1,  0), # go down
           ( 0,  1)) # go right
forward_name = ('up', 'left', 'down', 'right')

# action has 3 values: right turn, no turn, left turn
action = (-1, 0, 1)
action_name = ('R', '#', 'L')

# EXAMPLE INPUTS:
# grid format:
#     0 = navigable space
#     1 = unnavigable space 
grid = ((1, 1, 1, 0, 0, 0),
        (1, 1, 1, 0, 1, 0),
        (0, 0, 0, 0, 0, 0),
        (1, 1, 1, 0, 1, 1),
        (1, 1, 1, 0, 1, 1))

init = (4, 3, 0) # given in the form (row,col,direction)
                 # direction = 0: up
                 #             1: left
                 #             2: down
                 #             3: right

goal = (2, 0) # given in the form (row,col)

cost = (2, 1, 20) # cost has 3 values, corresponding to making 
                  # a right turn, no turn, and a left turn

# EXAMPLE OUTPUT:
# calling optimum_policy2D with the given parameters should return 
# ((' ', ' ', ' ', 'R', '#', 'R'),
#  (' ', ' ', ' ', '#', ' ', '#'),
#  ('*', '#', '#', '#', '#', 'R'),
#  (' ', ' ', ' ', '#', ' ', ' '),
#  (' ', ' ', ' ', '#', ' ', ' '))
# ----------

# ----------------------------------------
# modify code below
# ----------------------------------------

# up, left, down, right
#heading = (0, -1, 0, 1)

def optimum_policy2D(grid,init,goal,cost):

    # 4 3D grids one for each heading
    value = (((999 for row in range(len(grid(0)))) for col in range(len(grid))),
            ((999 for row in range(len(grid(0)))) for col in range(len(grid))),
            ((999 for row in range(len(grid(0)))) for col in range(len(grid))),
            ((999 for row in range(len(grid(0)))) for col in range(len(grid))))

    policy = (((' ' for row in range(len(grid(0)))) for col in range(len(grid))),
             ((' ' for row in range(len(grid(0)))) for col in range(len(grid))),
             ((' ' for row in range(len(grid(0)))) for col in range(len(grid))),
             ((' ' for row in range(len(grid(0)))) for col in range(len(grid))))

    # for printing
    policy2D = ((' ' for row in range(len(grid(0)))) for col in range(len(grid)))

    change = True
    count = 0
    while change:
        change = False

        for x in range(len(grid)):
            for y in range(len(grid(0))):
                # heading ranges 0 to 3
                for heading in range(4):
                    # check for goal
                    if x == goal(0) and y == goal(1):
                        if value(heading)(x)(y) > 0:
                            change = True
                            value(heading)(x)(y) = 0
                            policy(heading)(x)(y) = '*'
                            change = True
                    # if grid cell navigable
                    elif grid(x)(y) == 0:

                        #calc 3 ways to propagate value (right, straight or left???)
                        for i in range(3):
                            # heading in (0,1,2,3)
                            # action = (-1, 0, 1), action_name = ('R', '#', 'L')
                            h2 = (heading + action(i)) % 4
                            x2 = x + forward(h2)(0)
                            y2 = y + forward(h2)(1)

                            if x2 >= 0 and x2 < len(grid) and y2 >= 0 and y2 < len(grid(0)) and grid(x2)(y2) ==0:
                                # add cost associated with R turn, no turn, L turn
                                v2 = value(h2)(x2)(y2) + cost(i)
                                if v2 < value(heading)(x)(y):
                                    value(heading)(x)(y) = v2
                                    policy(heading)(x)(y) = action_name(i)
                                    change = True

            count += 1
            print("iter {}".format(count))

            print('valuen ')
            for i in range(len(value)):
                for j in range(len(value(0))):
                    print(value(0)(j))
                print('nextn')

            print('policyn')
            for i in range(len(policy)):
                for j in range(len(policy(0))):
                    print(policy(0)(j))
                print('nextn')

    # after value function, populate the 2D map
    x = init(0)
    y = init(1)
    heading = init(2)

    policy2D(x)(y) = policy(heading)(x)(y) 

    while policy(heading)(x)(y) != '*':
        if policy(heading)(x)(y) == '#':
            h2 = heading
        elif policy(heading)(x)(y) == 'R':
            h2 = (heading - 1) % 4
        elif policy(heading)(x)(y) == 'L':
            h2 = (heading + 1) % 4 
        x = x + forward(h2)(0)
        y = y + forward(h2)(1)
        heading = h2
        policy2D(x)(y) = policy(heading)(x)(y)



    print('policy2D')
    for i in range(len(policy2D)):
        print(policy2D(i))
    #return policy2D

optimum_policy2D(grid, init, goal, cost)
```

programming challenge – HackerRank: Friend Circles (DFS in Java)

I have this problem in a HackerRank challenge and it was the best thing that occurred to me. Basically it is simply to use DFS to find connected components (in this case, circles of friends). I was having a hard time discovering how to track unvisited nodes. Please let me know how I can improve this code. It seems to work, but the test cases given were quite simple.

Issue:

There are N students in a class. Some of them are friends, while others are not. Their friendship is of a transitive nature, that is, if A is a friend of B and B is a friend of C, then A is also a friend of C. A circle of friends is a group of students who are friends directly or indirectly.

You have to complete a function int friendCircles(char()() friends) which returns the number of circles of friends in the class. Your argument, friends, is a NxN matrix consisting of the characters "Y" or "N". Yes friends(i)(j) == "Y" so the students of i-th and j-th are friends with each other, otherwise not. You have to return the total number of circles of friends in the class.

Sample Input 0:
4
YYNN
YYYN
NYYN
NNNY
Sample Output 0:
2

Explanation 0:
There are two pairs of friends (0, 1) and (1, 2). So (0, 2) is also a pair of friends by transitivity.
So first friend circle contains (0, 1, 2) and second friend circle contains only student 3

Sample Input 1:
5
YNNNN
NYNNN
NNYNN
NNNYN
NNNNY
Sample output 1:
5

Restrictions (sorry, I couldn't format, so I had to put the restrictions here):

  • 1 <= N <= 300.
  • Each element of the matrix friends will be "Y" or "N".
  • The number of rows and columns will be the same in friends.
  • friends (i) (j) = "Y", where 0 <= i <N.
  • friends (i) (j) = friends (j) (i), where 0 <= i <j <N.

Solution:

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.HashSet;
import java.util.Set;

public class Solution {
    public static int friendsCircle(char()() friends) {
        // The only alternative I could think of, instead of
        // tracking unvisited nodes, was to put visited nodes
        // in a set and then do setOfAllNodes.removeAll(visited)
        // to see which nodes are still unvisited
        Set unvisited = new HashSet<>();
        boolean() visited = new boolean(friends.length);
        Deque stack = new ArrayDeque<>();
        int connectedComponents = 0;
        for (int i = 0; i < friends.length; i++) {
            unvisited.add(i);
        }
        // dfs on friends matrix
        while (!unvisited.isEmpty()) {
            stack.push(unvisited.iterator().next());
            connectedComponents++;
            while (!stack.isEmpty()) {
                int currVertex = stack.pop();
                if (visited(currVertex) == false) {
                    visited(currVertex) = true;
                    unvisited.remove(currVertex);
                    for (int i = 0; i < friends(currVertex).length; i++) {
                        if (friends(currVertex)(i) == 'Y' && visited(i) == false) {
                            stack.push(i);
                        }
                    }
                }
            }
        }
        return connectedComponents;
    }

    public static void main(String() args) {
        char()() friends = {
                {'Y','Y','N','N'},
                {'Y','Y','Y','N'},
                {'N','Y','Y','N'},
                {'N','N','N','Y'}
        };
        System.out.println(friendsCircle(friends));
    }
}