Get the intersection when u know row and column in 2D array

I am trying to get the intersection of the row and column and I am not able to do so......
for example:
123456789 <<These in array indicate the row
255555555
388888888
499997999
1234 above first element of each row represent columns........
I want to get 7 which is the intersection of column 6 and row 4............Please help

Hi Marlin..
I am reading this after having done it in a very similar way....... thank you so much
The problem is that the letters in languages can also be characters so they can be a,b..Language over{a,b}..if characters are not in numbers I am trying convert a,b into int internally however I dont know any data structure in java which will accept character as key and int as value......
So I am stuck at modifying the part highlighted with ???? below
     public void startRecognizing()
          System.out.println("Begun recognizing language....");
          //Convert the word entered to letter array
          char [] wordEntered = word.toCharArray();
          // initialize variables
          currentState = startState[0]; //In the beginning the current state is start state
          /***************    For each letter entered    ********************************/
               for (int w =0; w < wordEntered.length ;w++)
                    //Print element entered
                    currentChar = wordEntered[w];
                    System.out.println("Char "+currentChar);
                    //Convert to int
                    int currentIntChar;
                    //System.out.println("Char "+currentIntChar);
                    //Print current state
               int currentIntState = Character.getNumericValue(currentState);
                    //System.out.println(" State "+currentIntState);
                    System.out.println(" State "+currentState);
               // if characters are numbers this is fine below
               if((Character.getNumericValue(currentChar)) != -1)
                                      currentIntChar = Character.getNumericValue(currentChar);
/*** Get the new state based on element entered with the current state and get a new state***/ // column/char entered & row/state// The intersection is the new state which is made the current state for further process
                    //We add 1 since array starts from 0
               currentState = transitionTable[currentIntState+1][currentIntChar+1];
                    System.out.println("  NEW current state "+currentState);
               else
     //if letters in the language are not in numbers and are char ie a,b then convert a,b into int internally
                    java.util.Hashtable h = new java.util.Hashtable();
                    // STUCK HERE !!******************??????????
                    h.put(wordEntered[w], new Integer(w));
                    currentIntChar = ((Integer)h.get(wordEntered[w])).intValue();
          System.out.println("currentIntChar non numbers "+currentIntChar);
                    //We add 1 since array starts from 0
               currentState = transitionTable[currentIntState+1][currentIntChar+1];
                    System.out.println("  NEW current state "+currentState);
          }//for main          
          finalDecision();
     }//startRecognizingThe assignment is due tomm morning...... I havent slept all night !

Similar Messages

  • Remove specific row and column from 2d array

    Hi,
    I would like to know how to remove the specific row and column from 2d array.
    for example, I have the original 4x4 array as below
    2 -1 -1 0
    -1 2 0 -1
    -1 -1 2 0
    -1 -1 -1 3
    let say that i want to remove row 2(bold) and column 2(bold), and the new 2d array should get as below
    2 -1 0
    -1 2 -1
    -1 -1 3
    Thanks.

    You can't remove elements of an array, it's fixed at a certain size once created. What you can do however is make a new array and only copy the things you want. Something like:public static void main(String[] args) {
        Integer[][] bar = new Integer[5][5];
        for (int i = 0; i < bar.length; i++) {
            Integer[] baz = bar;
    Arrays.fill(baz, i);
    System.out.println(Arrays.toString(baz));
    Integer[][] muu = new Integer[5][4];
    removeColumn(3, bar, muu);
    for (Integer[] mee : muu) {
    System.out.println(Arrays.toString(mee));
    Integer[][] smuu = new Integer[4][5];
    removeRow(3, bar, smuu);
    for (Integer[] mee : smuu) {
    System.out.println(Arrays.toString(mee));
    public static <T> void removeRow(int row, T[][] a, T[][] result) {
    if (row >= a.length) {
    throw new IllegalArgumentException("no row at " + row);
    for (int a_r = 0, result_r = 0; a_r < a.length; a_r++) {
    if (a_r == row) {
    continue;
    System.arraycopy(a[a_r], 0, result[result_r], 0, a[a_r].length);
    result_r++;
    public static <T> void removeColumn(int col, T[][] a, T[][] result) {
    for (int i = 0; i < a.length; i++) {
    if (col >= a[i].length) {
    throw new IllegalArgumentException("no column at [" + i + ", " + col + "]");
    for (int a_i = 0, r_i = 0; a_i < a[i].length; a_i++) {
    if (a_i == col) {
    continue;
    result[i][r_i] = a[i][a_i];
    r_i++;

  • Summing the Rows and Columns in an Array

    I am importing a 2-dimensional array of integers.(which is held in a 2-dimensional array)
    I need to store the row sums and column sums in separate 1-dimensional arrays.
    I can get the integers in and print out a list along with the grand total(sum of all).
    But, how do I pass each row's and each column's value in to my sumRow and sumCol methods to get the sum for each row and each column?
    Can I do the row and column summing in the same "for" statement where I calculate the "grand total"? Or am I making this more difficult than it is?
    Would appreciate any help.
    This is what I have so far:
    import java.awt.Graphics;
    import java.applet.Applet;
    public class TwoWayTable extends Applet {
         int numRows;
         int numCols;
         int [] [] cell;
         int [] rowSum;
         int [] colSum;
         int grandTotal;
    public TwoWayTable(int [][] data){
    grandTotal = 0;
    cell = new int [data.length][data.length];
    for(int i = 0; i < data.length; i++)
    for(int j = 0; j < data.length; j++){
         cell[i][j] = data[i][j];
    grandTotal += cell[i][j];
         System.out.println(cell[i][j]);
    System.out.println(grandTotal);
    public int sumRow(int [] data2){
         int rowaccumulator=0;
         rowSum = new int[data2.length];
         for(int numRows = 0; numRows < rowSum.length; numRows++){
         rowaccumulator += rowaccumulator + rowSum[numRows];
              return(rowaccumulator);
    public int sumCol(int [] data3){
         int colaccumulator = 0;
         colSum = new int[data3.length];
         for(int numCols = 0; numCols < colSum.length; numCols++){
              colaccumulator += colaccumulator + colSum[numCols];
              return(colaccumulator);

    Thanks for your input.
    I'll make the changes that you suggest.(after this)
    My output prints:
    4 6 3 8 21
    9 1 5 3 18
    13 7 8 11 39
    numbers are right, but I need to format the table
    the output needs to look like this:
    int int int int | rowsum
    int int int int | rowsum
    colsum colsum colsum colsum | total
    How do I do this?
    I have no idea?
    I'm supposed to call a "void setMargins( )" method to line this up, without
    using the exotic formatting in the IO library.
    I'm also supposed to use "public String toString( )"
    This is what I have so far:
    import java.awt.Graphics;
    import java.applet.Applet;
    public class TwoWayTable extends Applet {
    int numRows;
         int numCols;
         int [] [] cell;
         int [] rowSum;
         int [] colSum;
         int grandTotal;
    public TwoWayTable(int [][] data){
    cell = new int [data.length][data.length];     
    for(int i = 0; i < data.length; i++){
    for(int j = 0; j < data.length; j++){
         cell[i][j] = data[i][j];
    calcTotals(cell);
    for(int i = 0; i < cell.length; ++i){
    for(int j = 0; j < cell.length; ++j){
    System.out.print(cell[i][j] + " ");
    System.out.println(rowSum[i] + " ");
    for(int j = 0; j < cell.length-1; ++j){
    System.out.print(colSum[j] + " ");
    System.out.println(colSum[cell.length-1] + " " + (grandTotal));
         public void calcTotals(int [][] data2){
              grandTotal = 0;
              rowSum = new int[data2.length];                         
              colSum = new int[data2.length];                         
              for(int numRows = 0; numRows < data2.length; numRows++){
              for(int numCols = 0; numCols < data2.length; numCols++){
                   grandTotal += data2[numRows][numCols];               
                   rowSum[numRows] += data2[numRows][numCols];
                   colSum[numCols] += data2[numRows][numCols];

  • Getting row and column of an array element

    Hi,
    I have an array of 24 rows and 24 column giving me a total of 576 elements. How do I get the row and column of a particular element in an array in LabView. E.g. If I have to write to element 127 how do I get the column and row in which element 127 is located.
    Regards,
    Harshil
    Solved!
    Go to Solution.

    Hi Harshil,
    maybe you only need to find the correct "address" of the element in your 2D array?
    Use something like this:
    Maybe you have to switch Row&Column output according to your numbering scheme...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to get the values of a selected row and edit it

    hi all,
    i am using a table component.I am populating it from the database.i used static text to display the data .i have a edit button in the last column. when i click on it that particular rows data should be shown in a text field in that row itself,so that i should be able to edit it and then if i save it it that row should change to statictext with the updated data.
    please provide a solution for this...
    regards,
    rpk

    Hi Andrea,
    If you are using ADFBC, the easiest way is to drop the attribute(Say Name) from the data control palette as outputText component and add partialTriggers property of it to point to table id(to refresh the outputText whenever the row is selected in table)
    Sireesha

  • Hyperion Reports - Row and Column templates

    <p>Sorry if this may be a bit basic but we are new to Hyperionreports. Currently we are going through a redesign process and washoping to get some viewpoints on the benefits of using row andcolumn templates within reports. I am looking at this option butgetting frustrated by the limitations around formatting, etc</p><p> </p><p>Are there any views out there on the preferred options. We havea particular style in design we need to include which is becomingdifficult when we use row and column templates</p>

    it may also worth cross checking below form doc:
    a.If your row and column template contains formulas with external references (for
    example, to cells outside of the selected row and column template), you are prompted
    to modify those formulas before saving the row or column template.
    Note: You can save a row and column template that contains cell formulas, as these can
    be discarded. For more information, see step 9.c on page 115.
    b. If a secondary database connection was specified within the row and column template,
    a dialog box displays prompting you to continue saving the template. If you save the
    template, the secondary database connection you specified in the row and column
    template is discarded. The primary database connection is then used for the row and
    column template.
    c. If unsupported properties are found, an Information dialog box presents a list of
    properties to discard before saving the template. For example, if the row and column
    template contains a cell formula, you can choose to save the template without the
    formula or not save the template.

  • Maximum number of rows and columns in data form

    Hi,
    I wanted to know if there is a limitation to the number of rows and columns that can be displayed in a data form, in Hyperion planning 11.1.2.1 ?
    And what would be the most appropriate number of rows and columns to be included for optimum performance.
    Thanks.

    Hi,
    While its a fun fact to determine how much one can stuff into a web form, the reality is: how much can a user reasonably consume in a web form?
    And what would be the most appropriate number of rows and columns to be included for optimum performance
    You will find that the answer to this is by "what design makes a web form most usable?" And no, the users don't really know what they want from a design perspective, they see it in their head, but usually what they ask for is something that would look entirely different (huge).
    The next thing to think about is the use of member selection functions in the page axis. IDescendants(Entity) in a dropdown could cause issues just as easily as too many rows - and again make the drop down unusable for a user.
    If your question is a bit more technical, then consider this (somewhat oversimplified): Web forms are constructed by a process on the server. Objects are created based on the form's definition and used by the process that builds the form. The process uses Cartesian looping (lots of iterations) to construct the form cell by cell, starting at the top left and finishing up in the bottom right. If the form has a million cells on it, then the loop and all the code within it runs a million times. The capability of the server has a lot to do with how well it can handle this request, and how many it can handle at one time.
    The result of this is gobs of HTML and JavaScript. All of this has to be sent over a network to the requesting client. The client starts receiving the web page code and has to render it in the browser and run the JavaScript. The ability to do this is limited by the browser, the OS, and the hardware that the client is running on.
    And that's just rendering the page for use.
    Now it has to be interacted with on the client machine, and changes parsed, packaged, and sent back to the server.
    So the technical answer is, there can be many limitations to how many rows and columns a data form can have - none of which can truly be anticipated by anyone. This is why I put the part about usability first in this post.
    Regards,
    Robb Salzmann

  • HT4623 Has anyone had trouble installing 7.1 wirelessly on an ipad mini w/retina?  I downloaded the update, but when I attempt to install, I get an error message saying that I am not connected to the internet when I know that I am!

    It downloaded fine, but when I attempt to install it won't verify, saying that I am not connected to the internet when I know that I am!  Tried on several wifi connections while plugged into power source.  Any advice is appreciated!

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are drooping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    Fix WiFi Issue for iOS 7
    http://ipadnerds.com/fix-wifi-issue-ios-7/
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    iPad: Issues connecting to Wi-Fi networks
    http://support.apple.com/kb/ts3304
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h Mt
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    10 Ways to Boost Your Wireless Signal
    http://www.pcmag.com/article2/0,2817,2372811,00.asp
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Some Wi-Fi losses may stem from a problematic interaction between Wi-Fi and cellular data connections. Numerous users have found that turning off Cellular Data in Settings gets their Wi-Fi working again.
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • I made a movie with iMovie and cannot get the audio when I burn into dvd. I would like to transfer video to a dvd to be played in any computer and TV

    I made a movie with iMovie and cannot get the audio when I burn into dvd. I would like to transfer video to a dvd to be played in any computer and TV

    Go to the Map mode in your iDVD project and make sure the blue bin at the left is empty.  That's where you drag slideshows to if you want the DVD to open immediately to that slideshow and bypass the menu. 
    Click to view full size
    If there is an item in there drag it out.
    OT

  • How long should I let Safe Mode startup run? I keep getting the "disk0s2 i/o error" message and I'm just not sure when to give up and try a different method. I already ran disk utility in Recovery Mode and it said there were no repairs needed.

    How long should I let Safe Mode startup run? I keep getting the "disk0s2 i/o error" message and I'm just not sure when to give up and try a different method. I already ran disk utility in Recovery Mode and it said there were no repairs needed but it still kept getting stuck on the apple loading screen.

    You have limited opportunity to attempt to create a backup of your created files.
    That is what the SafeBoot or safemode appears to allow you -- at the moment.
    Since the hard disk drive exhibits signs of failure or other major issues, plan
    on a replacement in the near future. You may be able to get the computer to
    start up in a regular full OS X (not safe mode) but consider its hours are limited.
    An externally enclosed hard disk drive (with own power supply, not relying on
    Mac ports to run it) is a good basic means of which to use a disk utility to make
    a copy or a Clone of the current OS X. This may help retrieve an archive that
    could be used along with a Time Machine backup, to restore your Mac once you
    get a new hard drive installed inside.
    Good luck & happy computing!

  • Halfway through the OS X Yosemite update it says I am not connected to the internet (when I know I am because I can search through the app store). How can I fix this? I cannot get on Safari because it requires an update to Mac OS X 10.9 or later.

    Halfway through the OS X Yosemite update it says I am not connected to the internet (when I know I am because I can search through the app store). How can I fix this? I cannot get on Safari because it requires an update to Mac OS X 10.9 or later.

    Just to be clear. You have downloaded the Yosemite installer. However you say while it's updating you get the error you are not online. This is confusing since you shouldn't be able to use your computer in the process of updating.
    Exactly where do you see you need to 10.9 to get on Safari?

  • Since upgrading to OS X 10.8.2 a few days ago, Safari will suddenly zoom in on web pages (happens on multiple sites) when I scroll or move the mouse -- any one know why and what to do about it? Thanks.

    Since upgrading to OS X 10.8.2 a few days ago, Safari will suddenly zoom in on web pages (happens on multiple sites) when I scroll or move the mouse -- any one know why and what to do about it? Thanks!

    It really isn't a well thought out 'gesture' when a normal scroll action can result in an unwanted zoom but disabling SmartZoom wasn't an option for me—one of those with eyes that tire easily when reading very small text on a 27" display.
    For a while I used command-+ and command-'-' to read small text but that isn't supported in some apps and for Safari it often leaves the browser in an less than perfect state when moving to the next page.  I also tried option scroll to zoom the whole display but that was not desirable, either.
    I finally settled on leaving SmartZoom enabled and remembering to double tap with one finger whenever the undesired zoom happens. It happens so often that the double tap is almost a reflex action for me.

  • HT203175 Running Windows 7 64, when installing, I get the error, 'itunes encountered an error and could not configure'.  Ideas?

    Running Windows 7 64, when installing, I get the error, 'itunes encountered an error and could not configure'.  Ideas?

    iTunes unknown error 13010

  • I keep getting the message when I open Muse CC, that the latest version is here and that i need to download it... But when i click "Download Latest Version" and it takes me to the applications manager it tell me that Muse is "Up to date"..... I also downl

    I keep getting the message when I open Muse CC, that the latest version is here and that i need to download it... But when i click "Download Latest Version" and it takes me to the applications manager it tell me that Muse is "Up to date"..... I also downloaded a template from Muse and it tells me when I open it that i also need the latest version... Can anyone explain why Iam getting this message and Why I can not up date?... Much appreciated

    Download the creative cloud desktop app using the below link:-
    Download Adobe Creative Cloud apps | Free Adobe CC trial
    And then check if you get install Button for Muse CC 2014.3
    Regards,
    Neha

  • When trying to sync, I get this computer is no longer authorized for purchases on this iphone. I click on store-authorize this computer and get successful and still get the error. I tried deauthorizing and reauthorizing and keep getting this message. Help

    when trying to sync, I get this computer is no longer authorized for purchases on this iphone. I click on store-authorize this computer and get successful and still get the error. I tried deauthorizing and reauthorizing and keep getting this message. Help

    the solution you propose is not helping . are there alternatives ?
    I have Iphone 4  never  had any problem , and withouth changing or modifying , this problem popped up out of the blue ....
    Please HELP

Maybe you are looking for

  • No output to NTSC monitor

    I am unable to get Encore 2.0 to output the Menu Editor to my NTSC monitor. In Preferences > Audio/Video Out I have checked the "Show Menu Editor on DV Hardware" box and Encore correctly recognizes my Sony device and indicates that it is in "VCR Mode

  • Shared Connection Pool via Singleton

    I have just started to learn Java (more jsp & servlets) and have been going through "Core Servlets and Java Server Pages" and in there is stuff on connection pooling. The author provides a good a connection pool servlet that can be shared, but as I'm

  • Matshita CW-8122 Combo Drive

    I was wondering if it might be possible to use a Matshita CW-8122 slot loading Combo Drive in a G3 CRT iMac. I realize that none of the G3 CRT iMacs shipped with slot loading Combo Drives. I want to be able to watch DVDs from any region in the world

  • I tried getting a game for iPad 2 / did not work but took money

    As above what do I do I had $twenty four dollars Tried three apps all said unablle to download but took money

  • HT4910 Export old iphone 3 contacts to PC and upload to icloud or new iphone 4

    So i cannot utilize itunes successfully to import contacts from my old Iphone 3 and export to new iphone 4.  I tried backup of the iphone 3 then restore from backup to my new iphone 4.  I tried using export windows address through itunes and it was s