How to determine rows and columns of a two dimensional array at runtime?
Dear All,
I am using Java 5.
I have defined an array as follows:
int[][] arr= { {1,2,3}, {4,5,6}};
Using the reference of arr, how can i get the rows (2) and columns (3) of this array at run-time?
Thanks in advance.
-Sameer
rows and columns are simply the way you visualize the array.
int[][] arr= { {1,2,3}, {4,5,6}};
in above code
if you access array element as arr[x][y]
then x can have 0 or 1 where y can have 0,1 or 2
*/
Similar Messages
-
How to get number of rows and columns in a two dimensional array ?
Hello,
What would be the simplest way to get number of rows and columns in a two dimensional array represented as integers ?
I'm looking for another solution as For...Each loop in case of large arrays.
Regards,
PetriHi Petri,
See a attached txt file for obtaining two arrays with upper and lower index values
Regards
Ray
Regards
Ray Farmer
Attachments:
Get2DArrayIndex.txt 2 KB -
How to design rows and columns in sapscript layout
Hi friends,
Please let me know how to design rows and columns in sapscript layout with example?
Thanks,
YogeshHi friends,
Please let me know how to design rows and columns in sapscript layout with example?
Thanks,
Yogesh -
How to freeze row and column in JTable
Hi,
I need to freeze first two rows and columns in a large JTable. I found ways to freeze either a row or a column, but not both at the same time.
Can any of you help ?
Found this code which allows freezing a col. Similar method can be used to freeze column
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JViewport;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableModel;
public class FrozenTablePane extends JScrollPane{
public FrozenTablePane(JTable table, int colsToFreeze){
super(table);
TableModel model = table.getModel();
//create a frozen model
TableModel frozenModel = new DefaultTableModel(
model.getRowCount(),
colsToFreeze);
//populate the frozen model
for (int i = 0; i < model.getRowCount(); i++) {
for (int j = 0; j < colsToFreeze; j++) {
String value = (String) model.getValueAt(i, j);
frozenModel.setValueAt(value, i, j);
//create frozen table
JTable frozenTable = new JTable(frozenModel);
//remove the frozen columns from the original table
for (int j = 0; j < colsToFreeze; j++) {
table.removeColumn(table.getColumnModel().getColumn(0));
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
//format the frozen table
JTableHeader header = table.getTableHeader();
frozenTable.setBackground(header.getBackground());
frozenTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
frozenTable.setEnabled(false);
//set frozen table as row header view
JViewport viewport = new JViewport();
viewport.setView(frozenTable);
viewport.setPreferredSize(frozenTable.getPreferredSize());
setRowHeaderView(viewport);
setCorner(JScrollPane.UPPER_LEFT_CORNER, frozenTable.getTableHeader());
}Hi,
I need to freeze first two rows and columns in a large JTable. I found ways to freeze either a row or a column, but not both at the same time.
Can any of you help ?
Found this code which allows freezing a col. Similar method can be used to freeze column
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JViewport;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableModel;
public class FrozenTablePane extends JScrollPane{
public FrozenTablePane(JTable table, int colsToFreeze){
super(table);
TableModel model = table.getModel();
//create a frozen model
TableModel frozenModel = new DefaultTableModel(
model.getRowCount(),
colsToFreeze);
//populate the frozen model
for (int i = 0; i < model.getRowCount(); i++) {
for (int j = 0; j < colsToFreeze; j++) {
String value = (String) model.getValueAt(i, j);
frozenModel.setValueAt(value, i, j);
//create frozen table
JTable frozenTable = new JTable(frozenModel);
//remove the frozen columns from the original table
for (int j = 0; j < colsToFreeze; j++) {
table.removeColumn(table.getColumnModel().getColumn(0));
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
//format the frozen table
JTableHeader header = table.getTableHeader();
frozenTable.setBackground(header.getBackground());
frozenTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
frozenTable.setEnabled(false);
//set frozen table as row header view
JViewport viewport = new JViewport();
viewport.setView(frozenTable);
viewport.setPreferredSize(frozenTable.getPreferredSize());
setRowHeaderView(viewport);
setCorner(JScrollPane.UPPER_LEFT_CORNER, frozenTable.getTableHeader());
} -
How to color Rows and Columns of BI Query
Hi to all,
I have created BI query in query designer, with 2 structures for rows and Columns.
Now I need that certain rows can be colored orange and certain columns as green color.
I knew that it can be done in Query designer, but slice and dice reporting can not be done, which I required in my report.
Is there any way I can do in WAD.
or any other way to do that.
i shall be thankfull to you for this.
Regards
Pavneet RanaHi Rana,
You can do the coloring of KF values using the report designer tool.
Check the below links
http://help.sap.com/SAPhelp_nw70/helpdata/en/dd/cea14119eb9f09e10000000a155106/frameset.htm
[Creating Formatted reports using BEx Report Designer|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00ae5173-6112-2d10-d78f-e7779d269f25?QuickLink=index&overridelayout=true]
Regards
KP -
How to copy data in text file into two-dimensional arrays?
Greeting. Can somebody teach me how to copy the input file into two-dimensional arrays? I'm stuck in making a matrix with number ROWS and COLUMNS according to the data in "input.txt"
import java.io.*;
import java.util.*;
public class array
public static void main (String[] args) throws FileNotFoundException
{ Scanner sc = new Scanner (new FileReader("input.txt"));
PrintWriter outfile = new PrintWriter("output.txt");
int[][]matrix = new int[ROWS][COLUMNS];
}my input.txt :
a,b,c
2,2,1
1,1,1
2,2,1
3,3,1
4,4,1
5,5,1
1,6,2
2,7,2
3,8,2
4,9,2
5,10,2import java.io.*;
import java.util.*;
public class array {
public static void main(String[] args) throws IOException {
FileInputStream in = null;
FileOutputStream out = null;
try {
in = new FileInputStream("input.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line = null;
while ((line = reader.readLine()) != null) {
String split[]=line.split(",");
catch (IOException x) {
System.err.println(x);
} finally {
if (in != null) in.close();
}}}What after this? -
How to make Row and Column headings bold in 2004s Web template
Hi!
I have created a web template which has 3 queries.
I would like to achieve the following
1> Bold the column heading and row headings.
2> Delete the space between the three reports(right now there is some space)
3> Align the columns on top of each other so that it looks like a continuous report.
(I know how to suppress the column headers on the 2 reports which are at the bottom)
Is this possible in 2004s???
With Table interface class gone in 2004s--is stylesheet modification the only way to go????
Please provide me with steps to achieve the above.
Helpers will be rewarded.Hi Zhu,
Thanks for the link.This really helps.
However I was only able to see the modules for Column Width, Negative number and Document Content.
Is there any other module as well to change Column heading ?Its not mentioned in the documentation.
Can you please let me know.
Thanks,
Vivek -
How to hide rows and columns by AppleScript or Automator for printing
Hello,
I have to hide first empty rows (I do it by: organize - Column B is not empty)
then: By context-menu in Header of Column K: Hide column
and: By context-menu in Header of Column L: Hide column
How can I make this 3 Steps automatic with AppleScript or Automator or maybe by formula?
Thanks for any helpHere is an edited version which allow you to choose the custom template on the fly.
No need to edit a property in the script.
--[SCRIPT printtable(s)_choosecustom]
Enregistrer le script en tant que Script ou Application : printtable(s)_choosecustom.xxx
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Sélectionner une partie de table, une table ou même plusieurs tables.
Aller au menu Scripts , choisir Numbers puis choisir “printtable(s)_choosecustom”
Le script crée un nouveau document depuis un modèle perso sélectionné,
puis applique « Colle les valeurs » au contenu du presse-papiers.
Il envoie enfin la commande d'impression.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
Sous 10.6.x,
aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
puis cocher la case "Afficher le menu des scripts dans la barre des menus".
--=====
Save the script as a Script or an Application : printtable(s)_choosecustom.xxx
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Select a subset of a table, a table or even several tables.
Go to the Scripts Menu, choose Numbers, then choose “printtable(s)_choosecustom”
The script create a new document based on the selected custom template,
then apply “Paste Values” to the clipboard's contents.
At last, it issue the print command.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/02/20
2011/03/16 -- replaced the Blank template by a custom one defined thru the property custom_template
2011/03/17 -- Let choose the custom template, no longer Paste but Paste Values.
--=====
property theApp : "Numbers"
--=====
on run
--my doyourduty()
run script doyourduty
end run
script doyourduty
--on doyourduty()
my activateGUIscripting()
Copy the selected items *)
my raccourci(theApp, "c", "c") (* cmd + c *)
Create a new document based upon Blank.template *)
set myNewDoc to my makeAnIworkDocFromCustom()
As it's a custom template, there is no default table to delete.
Delete the default table *)
tell application "Numbers" to tell document 1 to tell sheet 1 to delete table 1
my selectMenu("Numbers", 4, 8) (* Paste Values *)
my raccourci(theApp, "p", "c") (* cmd + p = Print *)
my raccourci(theApp, return, "") (* return = validate the Print command*)
--end doyourduty
end script
--=====
Creates a new iWork document from a custom template and returns its name.
example:
set myNewDoc to my makeAnIworkDocFromCustom()
on makeAnIworkDocFromCustom()
set nb_chiffres to 3 (*
2 = allow 99 templates
3 = allow 999 templates *)
Grab the localized names of the templates folders *)
tell application "Numbers"
set templates_loc to localized string "Templates"
-- set myTemplates_loc to localized string "My Templates"
end tell -- to application a
Define the path to the folder storing custom templates *)
--set chemindesmodeles to "" & (path to library folder from user domain) & "Application Support:iWork:Numbers:" & templates_loc & ":" & myTemplates_loc & ":"
set chemindesmodeles to "" & (path to library folder from user domain) & "Application Support:iWork:Numbers:" & templates_loc & ":"
Grab the list of every items stored in the folder *)
tell application "Finder"
set entire_contents to entire contents of folder chemindesmodeles
end tell
Build two lists. One contain the path to every custom templates.
The other contain the names of these templates and the names of subfolders *)
set indx to 1
set cheminde_mesmodeles to {}
set nomsde_mesmodeles to {}
set le_conteneur to ""
tell application "System Events"
repeat with i from 1 to count of entire_contents
set un_element to item i of entire_contents as text
try
if type identifier of disk item un_element is in {"com.apple.iwork.numbers.template", "com.apple.iwork.numbers.sfftemplate"} then
if name of container of disk item un_element is not le_conteneur then
set le_conteneur to name of container of disk item un_element
copy (text 1 thru nb_chiffres of "---") & space & le_conteneur to end of nomsde_mesmodeles
end if
copy un_element to end of cheminde_mesmodeles
copy text -nb_chiffres thru -1 of ("00" & indx) & space & name of disk item un_element to end of nomsde_mesmodeles
set indx to indx + 1
end if
end try
end repeat
end tell -- System Events
if my parleAnglais() then
set le_titre to "Numbers’s custom templates"
else
set le_titre to "Modèles personnalisés de Numbers"
end if
Choose the template to use.
If you select a subfolder name, the script beep and ask one more time *)
tell application (path to frontmost application as string)
repeat
set mon_choix to choose from list nomsde_mesmodeles with title le_titre
if mon_choix is false then error number -128
try
set mon_choix to text 1 thru nb_chiffres of (item 1 of mon_choix) as integer
exit repeat
on error
beep 1
end try
end repeat
end tell
tell application "Numbers"
set nb_doc to count of documents
open (item mon_choix of cheminde_mesmodeles)
repeat until (count of documents) > nb_doc
delay 0.1
end repeat
set doc_name to name of document 1
end tell -- the_App
return doc_name
end makeAnIworkDocFromCustom
--=====
on parleAnglais()
local z
try
tell application theApp to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
on activateGUIscripting()
(* to be sure than GUI scripting will be active *)
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true
end tell
end activateGUIscripting
--=====
==== Uses GUIscripting ====
This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
on raccourci(a, t, d)
local k
tell application a to activate
tell application "System Events" to tell application process a
set frontmost to true
try
t * 1
if d is "" then
key code t
else if d is "c" then
key code t using {command down}
else if d is "a" then
key code t using {option down}
else if d is "k" then
key code t using {control down}
else if d is "s" then
key code t using {shift down}
else if d is in {"ac", "ca"} then
key code t using {command down, option down}
else if d is in {"as", "sa"} then
key code t using {shift down, option down}
else if d is in {"sc", "cs"} then
key code t using {command down, shift down}
else if d is in {"kc", "ck"} then
key code t using {command down, control down}
else if d is in {"ks", "sk"} then
key code t using {shift down, control down}
else if (d contains "c") and (d contains "s") and d contains "k" then
key code t using {command down, shift down, control down}
else if (d contains "c") and (d contains "s") and d contains "a" then
key code t using {command down, shift down, option down}
end if
on error
repeat with k in t
if d is "" then
keystroke (k as text)
else if d is "c" then
keystroke (k as text) using {command down}
else if d is "a" then
keystroke k using {option down}
else if d is "k" then
keystroke (k as text) using {control down}
else if d is "s" then
keystroke k using {shift down}
else if d is in {"ac", "ca"} then
keystroke (k as text) using {command down, option down}
else if d is in {"as", "sa"} then
keystroke (k as text) using {shift down, option down}
else if d is in {"sc", "cs"} then
keystroke (k as text) using {command down, shift down}
else if d is in {"kc", "ck"} then
keystroke (k as text) using {command down, control down}
else if d is in {"ks", "sk"} then
keystroke (k as text) using {shift down, control down}
else if (d contains "c") and (d contains "s") and d contains "k" then
keystroke (k as text) using {command down, shift down, control down}
else if (d contains "c") and (d contains "s") and d contains "a" then
keystroke (k as text) using {command down, shift down, option down}
end if
end repeat
end try
end tell
end raccourci
--=====
my selectMenu("Numbers",4, 8)
==== Uses GUIscripting ====
on selectMenu(theApp, mt, mi)
tell application theApp
activate
tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
tell menu bar item mt to tell menu 1 to click menu item mi
end tell -- application theApp
end selectMenu
--=====
--[/SCRIPT]
Yvan KOENIG (VALLAURIS, France) jeudi 17 mars 2011 21:29:15 -
How to customize row and column settings in BI report
Hi SDN,
We have integrated EP702 and BI 704systems and uploaded BI roles into portal. Now i want to personalize BI report settins.
There are 10 columns in BI report, but initially 4 columns are only displayed. But we want to display all the columns initially. I didn't find any option to customize these settings. And variable screen button is displayed when click on Filter link. But we require this button in report itself. Information and Show chars buttons are not available in report.
I am working on BI reports for the first time. Please help me to customize settings.
regards,
Sree.By default BEx web using a web template called 0ANALYSIS_PATTERN to render the queries. Most clients create a copy of SAP supplied standard web template and customize it to their needs. Most of the changes are what you have described. You can add a new button on the toolbar. Change the Analysis Item properties to control the number of columns.
Once you have a new desired web template, you can set it as your default adhoc-analysis web template in IMG. Look for a node called Report relevant settings. All this setup needs to be done on the BW system. A restart of BI java is required after the customizing settings have been changed.
Thanks
Vineet -
Table -- sum of rows and columns?
I was wondering if anyone has a suggestion to how I can easily generate the sum of each row and column in a two dimensional table? This is what I've got so far:
public class SumRowsColumns {
public static void main (String[] args) {
int[][] table = new int[2][3];
// gets the values
for (int i = 0; i < table.length;
i++) {
for (int j = 0; j < table.length;
j++)
table[i][j] = Terminal.lesInt(); // Terminal is a class that can read the terminal input
System.out.println("\t\t\t\tSum:");
// prints the values
for (int i = 0; i < table.length;
i++) {
for (int j = 0; j < table[i].length;
j++) {
System.out.print("\t" + table[i][j]);
System.out.println();
// sum of first column
int sumColumn = 0;
for (int i = 0; i < table.length;
i++) {
sumColumn += table[i][0];
System.out.print("\nSum:\t");
System.out.println(sumColumn);
Example of output:
1
2
3
4
5
6
Sum:
1 2 3
4 5 6
Sum: 5This is the output I'd like:
1
2
3
4
5
6
Sum:
1 2 3 6
4 5 6 15
Sum: 5 7 9One way of getting the sum for all the columns is to make a for-loop for each one of them, but there has to be a better way. I could apply the same hack to get the sum of the rows, but I still wouldn't know how to get the layout I want.After many hours of frustration I finally solved it (for-loops can be confusing, man) after I got a hint from a post in another forum: http://www.linuxquestions.org/questions/showthread.php?postid=624021#post624021
A more logical name to the integers actually helped a lot too. And here's the final product:
public class SumRowsColumns {
public static void main (String[] args) {
int[][] table = new int[2][3];
// gets the values
for (int row = 0; row < table.length;
row++) {
for (int col = 0; col < table[row].length;
col++)
table[row][col] = Terminal.lesInt(); // Terminal is a class that reads the terminal input
System.out.println("\t\t\t\tSum:");
// prints the values and sum of each row
for (int row = 0; row < table.length;
row++) {
for (int col = 0; col < table[row].length;
col++) {
System.out.print("\t" + table[row][col]);
int sum = 0;
for (int col = 0; col < table[0].length;
col++) {
sum += table[row][col];
System.out.println("\t" + sum);
System.out.print("\nSum:");
// sum of each column
for (int col = 0; col < table[0].length; // table[0].length is the length of row 0 (the number of columns)
col++) {
int sum = 0;
for (int row = 0; row < table.length; // table.length is the number of rows
row++) {
sum += table[row][col];
System.out.print("\t" + sum);
System.out.println();
} -
Dear all,
Could u plz tell me how to create rows and columns dynamically at runtime?
I got 3 columns and multiple rows.How do i go about it?
Is there ne FM to do this?Can you create an internal table dynamically? (at run time)
Yes , you can create a Dynamic Internal table .Just chek out this program .
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab. *********Creates a dyanamic internal table*********
perform get_data.
perform write_out.
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform.
form create_dynamic_itab.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
form get_data.
Select Data from table.
select * into table <dyn_table>
from (p_table).
endform.
Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index
of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
http://www.sap-img.com/ab030.htm -
how can i open a PDF bank statement in "numbers" so that the rows and columns contain properly aligned data from statement?
Numbers can store pdfs pages or clippings but does not directly open pdf files. To get the bank statement into Numbers as a table I would open the bank statment in Preview (or Skim) or some pdf viewer.
Then hold the option key while selecting a column of data.
Then copy
Then switch to numbers and paste the column into a table
Then repeat for the other columns in the pdf document
It would be easier (in my opinion) to download the QFX or CSV version from your bank -
How do I delete multiple rows and columns in an image?
I am looking into how digital SLRs extract video data from a CMOS sensor. To give an example, the GH1 from Panasonic can record video at 1920 x 1080 from a 12 MPixel sensor that, say, is 4000 horizontal x 3000 vertical. How they do that seems to be not in the public domain, but there have been a few guesses (see http://www.dvxuser.com/V6/showthread.php?t=206797 and http://luminous-landscape.com/forum/index.php?showtopic=38713).
One approach would be to simply read every second row of sensor pixels (1500 rows read from the original 3000) and once you have those in memory, delete every second column (2000 columns left). You would end up with a 2000 x 1500 image which could then be resampled to 1920 x 1080.
I'd like to simulate what the camera appears to be doing, by generating a 4000 x 3000 test image and then asking Photoshop CS4 to delete the appropriate rows and columns. It may not necessarily be every second row; the Canon 5DMk11 appears to read every third row, so I may need to delete two out of every three rows.
Can Photoshop do that sort of thing? If so, how?Thanks for the suggestions. Yes, I did take a detailed look at your images, but they weren't 100% convincing because it wasn't clear just what was happening. And Adobe's explanation, after reading it again, explains nothing at all to someone who doesn't know how Nearest Neighbor works.
But you are correct -- Nearest Neighbor does effectively delete pixels. I proved it with the attached 6 x 6 image of coloured pixels (the tiny midget image right after this full stop -- you'll have to go to maximum zoom in PS to see it).
These are the steps to delete every second row and then every second column.
1. Select Image > Image Size.
2. Set Pixel Dimensions > Height to half the original (in this case set to 3 pixels).
3. Set Resample Image to Nearest Neighbor.
4. Click OK and the image shoould now consist of three vertical white strips and three vertical Green-Red-Blue stripes.
5. Repeat steps 1-4, but this time set Pixel Dimensions > Width to half the original (in this case set to 3 pixels). The image should now consist of three horizontal stripes Green-Red-Blue.
Just to make sure the method worked for every third pixel, I repeated the above steps but with 2 pixels instead of 3 and obtained the correct White-Green, White-Green pattern.
I resampled the Height and Width separately for the test so that I could see what was happening. In a real example, the height and width can be changed at the same time in the one step, achieving the same results as above.
Finally, how to explain how Nearest Neighbor works in the simple cases described above?
Division by 2
In the case of an exact division by two (pixels numbered from top leftmost pixel), only the even numbered rows and columns remain. To put it a different way, every odd numbered row and column are deleted.
Division by 3
Only rows and columns 2, 5, 8, 11... remain.
Division by N
Only rows and columns 2, 2+N, 2+2N, 2+3N... remain.
To put it simply, a resample using Nearest Neighbor (using an exact integer multiple) keeps every Nth row and column, starting from number two. The rest are deleted. -
Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
Please help me!
For your information, I'm using LABView 7.0.Hi,
Thanks for your reply.Sorry for the confusion.
I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
I hope that I have made the problem clear. Sorry if it is still confusing.
Hope you can help me. Thank you!!!!
Attachments:
arrayrowncolumn2.JPG 64 KB -
How to increase the row and Column length of Bex query in EP Portal 7.3
Dear All,
Please let me know the process to Increase the Rows and Columns Size of Bex Query in Enterprise Portal of SAP 7.3 .
Please let settings to increase rows up 10000 and column 100 in one page.
Thanks
Regards,
SaiDear All,
Please find the attached screen shot.
The report be open with 4 or 5 columns and 5 or 6 rows.
So, please let me know how to increase the length of the table.
Do the needful for me to over come this issue.
Thanks
Regards,
Sai.
Maybe you are looking for
-
Page definition is not found while running JSR286 portlet in WebCenter app
Hi All, I have ADF application which has 3 different task flows 1. my service 2. my car 3. my bike. which I have placed into a single bounded task flow called repairTaskflow. I have created a JSR286 portlet out of a repairTaskflow. I am trying to con
-
I have an application where I need to send data via TCP/IP from two separate machines to a third machine. The machines are on a local area network connected through a network switch. The data are generated independently through data acquisition by th
-
How to call java methods from different java file.
Hi, i create 2 files: CircleCalculationMethod.java Main.java In Main.java, How can i call method in CircleCalculationMethod.java ? Should i put everything in same folder ?? Should i do something like "import CircleCalculationMethod.java" Should i do
-
Has anyone managed to get HP Warranty Information into SCCM?
Has anyone managed to get HP Warranty Information into SCCM? I have tried a few scripts that I found on the net but none of them seem to work as I believe HP updated there site this year..
-
I'm having a problem because I am working with the Sample Editor. I've edited the sample down to what I want to use, but when I place it on a track I don't hear anything. I place it on the instrument that says drag and drop samples kit. I can hear it