4*4 char matrix

hello was wondering if anyone could look at this code and tell me why i cant get it to print the whole string, at the moment it only prints the first 4 letters over and over again if u type in a 16 letter string
thanks!!!
System.out.print("Enter letters to convert: ");
// open up standard input
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String test = null;
// read the username from the command-line; need to use try/catch with the
// readLine() method
try {
test = br.readLine();
} catch (IOException ioe) {
System.out.println("IO error trying to read the word!");
System.exit(1);
// for (int k = 0; k < test.length(); k++)
// char a = test.charAt(k);
char matrix[][] = new char [4][4];
// String test = "hellotojavaworld";
for (int i=0; i<4; i++)
for(int j=0; j<4; j++)
matrix[i][j]=test.charAt(i);
//matrix[j]=test.toCharArray();
//matrix[0] = test.toCharArray();
// Print it out to prove it exists :)          
for (int r=0; r<matrix.length; r++)          
StringBuffer outputLine = new StringBuffer();                                        
for (int c=0; c<matrix[0].length; c++)               
outputLine.append(matrix[r][c]);                    
outputLine.append("\t");
// adds a tab character               
System.out.println(outputLine.toString());          
}

thanks im not sure what im doing obviously i tried putting in another loop for chars:
char matrix[][] = new char [4][4];
// String test = "hellotojavaworld";
for(int k=0; k <matrix[0].length; k++)
for (int i=0; i<4; i++)
for(int j=0; j<4; j++)
matrix[i][j]=test.charAt(k);
but it still doesnt work, any ideas would be appreciated!!

Similar Messages

  • Image repaint preformance and threading

    Folks,
    I'm trying to make this sucker run faster.
    My question is, can anyone please guide me, especially with regards synchronising the Threads more efficiently... I'm thinking of using join and i]notify to make the "navigator" threads yield to the swing threads, to give it a chance to repaint before continuing... does this sound sane to you?
    Currently, without the thread.sleep it paints get the first "burst", and then nothing until the alrorithm has completed... exactly not what I wanted, because the whole point of this GUI is to watch the algorithm at work... sort of a "visual debugger"... I find that watching an algorithm play out helps me to "imagineer" ways of improving it... and in this case improvement means optimisation... it's all about getting from A-J faster than anyone else on the planet, especially those smarty-wishbone-legs C# programmers ;-)
    The code is too big to post (darn that 7500 char limit!) so I'll split it over several posts here, and I've also posted it as a single download to [MazeOfBoltonGUI2.java|http://groups.google.com/group/comp_lang_java_exchange/web/MazeOfBoltonGUI2.java] on my google group (comp lang java exchange).
    Cheers all. Keith.
    package forums.maze;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.SortedMap;
    import java.util.TreeMap;
    import java.util.Stack;
    import java.util.Queue;
    import java.util.PriorityQueue;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.concurrent.Callable;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    import java.util.concurrent.ExecutionException;
    import java.awt.Dimension;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Font;
    import java.awt.image.BufferedImage;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import javax.swing.SwingWorker;
    import java.io.PrintWriter;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    * A Visual debugger,
    * for the [A* Alogorithm|http://en.wikipedia.org/wiki/A*_search_algorithm] navigator
    * of the [Maze Of Bolton|http://cplus.about.com/od/programmingchallenges/a/challenge12.htm]
    * as implemented by [Prometheuz|http://forums.sun.com/profile.jspa?userID=550123]
    * with GUI by [Kajbj|http://forums.sun.com/profile.jspa?userID=91610]
    * hacked together by [Keith Corlett|http://forums.sun.com/profile.jspa?userID=640846]
    * and posted on [Sun's Java Forum|http://forums.sun.com/thread.jspa?threadID=5319334]
    * and posted on [Google news group|http://groups.google.com.au/group/comp_lang_java_exchange/]
    public class MazeOfBoltonGUI2
      static final char[][] matrix = readMatrix("map.txt");
      public static void main(String[] args) {
        SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              try {
                MazeNavigator navigator = new MazeNavigator(matrix);
                JFrame frame = new JFrame("MazeOfBoltonGUI2");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setContentPane(new MainPanel(navigator));
                frame.pack();
                frame.setVisible(true);
              } catch (Exception e) {
                e.printStackTrace();
       * Reads the file into a char matrix[rows,cols] ie: an array of char arrays.
       * @param String filename - the name of the file to read
       * @return a fixed length array of strings containing file contents.
      private static char[][] readMatrix(String filename) {
        try {
          BufferedReader input = null;
          try {
            input = new BufferedReader(new FileReader(filename));
            char[][] matrix = null;
            List<String> lines = new ArrayList<String>();
            String line = null;
            while ( (line = input.readLine()) != null ) {
              lines.add(line);
            int rows = lines.size();
            matrix = new char[rows][];
            for (int i=0; i<rows; i++) {
              matrix[i] = lines.get(i).toCharArray();
            System.err.println("DEBUG: rows="+rows+", cols="+matrix[0].length);
            return matrix;
          } finally {
            if(input!=null)input.close();
        } catch (IOException e) {
          e.printStackTrace();
          throw new IllegalStateException("Failed to readMatrix!", e);
    class MainPanel extends JPanel
      private static final long serialVersionUID = 1L;
      // button panel
      private final JButton goButton;
      // maze panel
      private final MazeNavigator navigator;
      private final Monitor<Path> monitor;
      private BufferedImage background;
      private BufferedImage image;
      private List<Path>currentPaths;
      public MainPanel(MazeNavigator navigator) {
        this.navigator = navigator;
        this.monitor = new SwingMonitor();
        this.goButton = new JButton("Go");
        goButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent event) {
              final String caption = goButton.getText();
              goButton.setVisible(false);
              monitor.execute();
        add(goButton);
        setPreferredSize(new Dimension(navigator.maze.cols*3, navigator.maze.rows*3)); //w,h
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (image==null) {
          image = (BufferedImage)createImage(navigator.maze.cols, navigator.maze.rows);
          mazeColors = createMazeColors(navigator.maze);
        this.draw(image.createGraphics());
        ((Graphics2D)g).drawImage(image, 0, 0, super.getWidth(), super.getHeight(), null);
      private static Color[][] mazeColors;
      private static Color[][] createMazeColors(Maze maze) {
        Color[][] colors = new Color[maze.rows][maze.cols];
        for (int r=0; r<maze.rows; r++) {
          for (int c=0; c<maze.cols; c++) {
            colors[r][c] = getColor(maze.matrix[r][c].ch);
        return colors;
      }*... PTO ...*

    I'm persuaded that the main issue (no intermediate results drawn) is the improper use of SwingWorker.
    When you've got over it, you may want to consider other smaller-effect optimizations:
    Reconsider usage of an offscreen image*
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (image==null) {
          image = (BufferedImage)createImage(navigator.maze.cols, navigator.maze.rows);
          mazeColors = createMazeColors(navigator.maze);
        this.draw(image.createGraphics());
        ((Graphics2D)g).drawImage(image, 0, 0, super.getWidth(), super.getHeight(), null);
      }At first I didn't get why you wanted to draw an offscreen image, then paint it to the screen, all that in the EDT.
    After reading the draw() method more closely, I guess you want to ease the coding of the scaling: you draw an image where one cell = one pixel, then paint the image, scaled to the panel's display size.
    In terms of performance, I don't know how it stands:
    On one hand, the image creation if lighter (1 pixel per cell). And you have a point that the built-in scaling offered by Graphics2D.drawImage(image, size) may be efficient. I can't comment on that, I hope the granphics and hardware acceleration folks will pop in the thread.
    On the other hand, if the built-in scaling had poor performance, it may be good to try what "manual" scaling would bring you. That means, in a simplified version, skip the offscreen image creation, and draw directly on the paintComponent()'s Graphics2D argument. the drawing of a cell at coordinates c,r, for example, would look like:
    g.fillRect(c*CELL_WIDTH, r*CELL_HEIGHT, WIDTH, HEIGHT);Performance apart, the scaling as you do it currently has functional drawbacks, if you want pathes as 1-pixel width lines over large cells:
    - if the maze is smaller (in rows, columns) than the panel displaying it (in pixels), the cells will be scaled but the pathes too: so your 1-pixel lines appear as large as the cells. May or may not be a desired effect.
    - if the maze is larger than the display panel, the cells are shrinked, fine, but the so are the path lines, to a point where they may be invisible (probably depending on color blending, I'm a n00b at graphics operations).
    But maybe I misunderstood the need, and maybe the intended drawing of a path is actually the drawing of the rectangles of all its traversed cells, in special path colors?
    Reconsider intermediate allocations*
    Each paintComponent() call results in the allocation of a 2D-array of Color objects (method createMazeColors(Maze)).
    I don't see what the mazeColors array brings you. I assume you wanted to decouple the determination of colors (depending on cell state) and the rendering of the colors: what does it bring: no performance advantage (on the contrary, it adds a 2D array allocation, and 2xN^2 2D-array access), and does not improve the code readability either (subjective rant, sorry).
    Why don't you pass the Maze as an argument to the draw() method, and call the getColor(cell.ch) from there?
    Side note, maybe a bit subjective: performance apart, the design of the usage of this mazeColor array is a no-go!
    An instance method alters a static variable reference,which is used subsequently in another instance method, with no synchronization. The current code does that in a single thread (+paintxxx()+ is only called in the EDT), which keeps that safe (I'd dare to say: by luck), but considerations exposed below may have you refactor the design to introduce other threads, and may exhibit the thread-unsafety of this design.
    Consider drawing the image in a background thread.*
    Indeed the technique of drawing to an offscreen image is quite common, but it is often done to improve responsiveness (not raw performance) of Swing applications. Here is a resource about this (what the author calls the passive approach), although it doesn't use a background thread.
    The idea is that if a paintCompobnent() methods involves lots of computation (arithmetics of traversing a 2D model, scaling things, etc.), this takes CPU times in the EDT, and all subsequent events (such as, a MouseEvent, but also other painting events) keep pending on the event queue, which is consumed by the single event-dispatch thread. The result is that the UI appear unresponsive, and painting of other areas may seem hung.
    The idea is to move the computation to a background thread, which posts rendering to the EDT when the Image is ready to be displayed.
    Of course this doesn't gain any CPU time. This only ensures the EDT uses a minimal part of this CPU (only render and image and process events), instead of performing the whole computation.
    In your case you already have a background thread, and indeed an appropriate choice, a SwingWorker. The application of this technique would consist in calling the draw() method in the worker thread (in the update(Path) method), and invoke super.publish() only after the image has been updated. Note that the process(List<Path>) could then ignore its argument (you may reconsider the choice of type parameter of the worker), and simply get the latest version of the image attribute).
    Of course in this technique, the offscreen image filling is called synchronously from the Navigator, so this halts the algorithm part itself, for the duration of the image generation. You may refine the technique by spawning a dedicated thread for the image generation - with subtle guard code to handle occasions when the algorithm goes faster than the image generation, and posts a new update(Path) while the image generation for the previous path has not completed yet...
    Recuce the number of things to redraw*
    Two parts:
    first, depending on the number of cells and pathes, there may be (yet another) optimization, to not redraw the whole offscreen image, but only the cells/path that have changed in the last update(). In particular, if a path is not a line but a list of cells, then it's quite easy, reusing the current offscreen image, to only fillRect(...) the appropriate cells.
    Second, if a path is not rendered as a thin line over larger cells, but as cells themselves rendered in special path colors, you may paint cells and path in one go: instead of drawing, first the cells, then the path, draw only the cells, electing the color using a decision method such as:
    private Color getColor(Cell) {
        if (cell.getPathState()!=NOT_IN_ANY_PATH) {
            return getColor(cell.getPathState());
        else {
            return getColor(cell.ch);
    }Of course this forces you to modify your data model, and update the new pathState as part of the algorithm (or better isolated, in the update(Path) method, before invoking the drawing machinery). Maybe that was the intention of the mazeColors array?
    I haven't studied your other posts on the logic of the MazeOfBolton algorithm, so I don't know if it's acceptable for you that a cell appear to have only one path state, as opposed to one for each of the pathes that traverse it. This last trick may then seem incorrect, but please consider it as only a graphical information, and indeed your current image drawing draws only ONE path for a given cell (the last path in currentPaths that traverses this cell ).

  • Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/char.bin Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/dicrc Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/matrix.bin Open error 5: "Input/outp

    Please can any one help.
    All sound has disappeared from my imac, it just 2 years old, I've run disk warrior and disk repair/verify and this is what come up.
    ARe there any solutions?
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/char.bin
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/dicrc
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/matrix.bin
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/sys.dic
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/ja/BE/unk.dic
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/sc/BE/matrix.bin
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/sc/BE/sys.dic
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/sc/BE/unk.dic
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/tc/BE/char.bin
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/tc/BE/dicrc
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/tc/BE/matrix.bin
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/tc/BE/sys.dic
    Open error 5: "Input/output error" on usr/lib/mecab/dic/apple/tc/BE/unk.dic
    Open error 5: "Input/output error" on System/Library/Extensions/AppleSMBIOS.kext/Contents/CodeDirectory
    Open error 5: "Input/output error" on System/Library/Extensions/AppleSMBIOS.kext/Contents/CodeRequirements
    Open error 5: "Input/output error" on System/Library/Extensions/AppleSMBIOS.kext/Contents/CodeResources
    Open error 5: "Input/output error" on System/Library/Extensions/AppleSMBIOS.kext/Contents/CodeSignature
    Open error 5: "Input/output error" on System/Library/Extensions/AppleSMBIOS.kext/Contents/_CodeSignature/CodeRequirem ents
    Open error 5: "Input/output error" on System/Library/Extensions/SM56KUSBAudioFamily.kext/Contents/PlugIns/AppleSM56KU SBModemFamily.kext/Contents/_CodeSignature/CodeRequirements
    Open error 5: "Input/output error" on System/Library/Extensions/SM56KUSBAudioFamily.kext/Contents/Resources/English.l proj
    Open error 5: "Input/output error" on System/Library/Extensions/SM56KUSBAudioFamily.kext/Contents/Resources/English.l proj/InfoPlist.strings
    Open error 5: "Input/output error" on System/Library/Extensions/SM56KUSBAudioFamily.kext/Contents/_CodeSignature/Code Requirements

    Whew, generally those errors would indicate a serious Hard Drive problem, but possibly RAM or Logic Board... any other drives connected?
    See if the Disk is issuing any S.M.A.R.T errors in Disk Utility...
    http://support.apple.com/kb/PH7029

  • Help desiging a 10g Oracle Report with Matrix and Lexical Parameters - Long

    Hello all:
    I apologize in advance for this long post.... I'm using Oracle Reports 10g (9.0.4.0.33). First -- the question:
    I need to create a Matrix where the rows come from one database table
    (TABLE1) and the columns and cell contents come from a linked query (pulled from TABLE2) that is generated with lexical parameters based on the current TABLE1 row. The lexical parameters contain a WHERE clause for the TABLE2 query. Basically, I have a linked query between TABLE1 and TABLE2. I need to generate a Matrix around it.
    Does anyone know if this is even possible?
    Here's the background on the application, if that is helpful...
    I have an application where I maintain database tables containing names/addresses along with information pertaining to them. As part of the processing, I need to produce reports that contain statistics based on values in the table. For example, each row has a field RTYPE that identifies the Record Type (1-Suppress, 2-Buyer, 3-Inquirer). Each row also has a last purchase date field. The statistics produced for this field would look like this:
              2001     2002     2003     11/03     12/03 01/04     02/04 03/04     04/04     05/04 ...
    Buyer      100 150 250 30 25 15 8 9 22 83
    Inquirer     1000 800 493 ...
    Suppress ... ...
    Totals ... ...
    Each cell contains the count of the number of records that have the corresponding RTYPE and Last Purchase date. The dates across the top are determined by the most recent purchase date in the file. We count the last 12 months, month by month, and then anything older than that is grouped by
    year of purchase. So, the column headings are variable.
    The SQL query for this example looks like this:
    SELECT CASE WHEN rtype = '2' THEN 'Buyers'
    WHEN rtype = '3' THEN 'Inquirers'
    WHEN rtype = '1' THEN 'Suppress'
    END HLDESC,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'YYYYMM')
    ELSE TO_CHAR(T.HOTLINE,'YYYY') || '00'
    END YYMM_8,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'MM/YY')
    ELSE TO_CHAR(T.HOTLINE, 'YYYY')
    END FmtDate_8,
    COUNT(*) HLCOUNT
    FROM &TABLENAME T
    GROUP BY CASE WHEN rtype = '2' THEN 'Buyers'
    WHEN rtype = '3' THEN 'Inquirers'
    WHEN rtype = '1' THEN 'Suppress'
    END,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'YYYYMM')
    ELSE TO_CHAR(T.HOTLINE,'YYYY') || '00'
    END,
    CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'MM/YY')
    ELSE TO_CHAR(T.HOTLINE, 'YYYY')
    END
    ORDER BY CASE WHEN MONTHS_BETWEEN(trunc(:MAXHLDATE,'MONTH'),
    TRUNC(T.HOTLINE,'MONTH')) < 12
    THEN TO_CHAR(T.HOTLINE,'YYYYMM')
    ELSE TO_CHAR(T.HOTLINE,'YYYY') || '00'
    END
    There might be a better way to write this, but that isn't the issue at the moment.
    I have many different tables, each with different fields. I need to produce counts on each of those fields. Some of those fields have a limited number of values where I need to count the occurrences and attach a description (like the RTYPE counts above). Others, like Last Purchase Amount, require counts within ranges (between 0 and 9.99, 10 and 19.99, etc.). Still others are "multiple choice"-style fields (such as products purchased), where we have multiple single-char flags that are not null when the corresponding products are purchased. In this case, we need to produce statistics that look like this:
              2001     2002     2003     11/03     12/03 01/04     02/04 03/04     04/04     05/04 ...
    Product 1 .........
    Product 2 .........
    The worst of the bunch is a field where I need to count the occurrence of each value within it (hundreds of values) without entering descriptions, so I don't know how many rows will appear ahead of time. This is used for "source codes" that identify where the name/address came from. They look similar to the RTYPE above, but the leftmost column contains each value from the field rather than a description. There are so many possible values and they change so often that it isn't feasible to enter a description for each one.
    Right now, I manually create an Oracle Report for each table when I design/load it. This is becoming difficult to manage, since I have over 150 of them now. Each of these reports can have any number of matrices to display (the largest right now has about 25).
    The new table structure to generate these reports consists of two tables: A COUNTHDR table and a COUNTROW table. The COUNTHDR table represents a single Matrix within the report. It contains info such as a heading for the Matrix and whether column totals should be calculated or not. The COUNTROW table contains a description for each row and an SQL Fragment that contains an appropriate WHERE clause to match the description. In the event of a "source code" style count, COUNTHDR has the name of the field to count. COUNTROWs won't exist, so I'll be handling those counts differently. But, ignoring that issue for now, the report structure looks like this:
    + Q1 +
    |
    + COUNTHDR +
    |
    + COUNTROW +
    | linked query
    + Q2 +
    |
    + COUNTDTL +
    Q2 is the query with lexical parameters for the table and "where clause" that identifies the actual statistic I need counted. I need fields from COUNTROW and COUNTDTL to form a Matrix.
    Can this be done? How?
    Of course, if anyone out there has a better idea on how to achieve my goal of not writing a report per table, please let me know!! :-)
    TIA
    Eric Raskin
    PS. This structure does not exactly duplicate my original query, since multiple Matrix rows are created by the single SQL query given in the example. Instead, I'll end up executing an SQL query for each row, which is less than desirable. The design will need some tweaking...
    PPS. I have tried handling this problem by pre-counting the target table and storing the results in a COUNTCOL table, containing the details of the matrix. This actually does work, but the performance is terrible. I have one "source code"-style count that generated over 20,000 detail cells, including all the "0" cells needed to fill out the matrix. If you don't generate the "0" cells, you get holes in the matrix presentation and/or error messages (which I can explain if you wish). I never did get Oracle Reports to print this one -- I gave up after an hour of runtime on a P4 3GHz machine connected via Gigabit Ethernet to the server. Hence the attempt to push the SQL Queries back into the Oracle Report itself.
    Eric H. Raskin Voice: 914-765-0500
    Professional Advertising Systems Inc. Fax: 914-765-0503
    200 Business Park Dr Suite 107 [email protected]
    Armonk, NY 10504

    Hi there
    here's example of my code
    Html header of the page :
    <script language="JavaScript" type="text/javascript">
    function callMyPopup (formItem1,formItem2) {
    var formVal1 = document.getElementById(formItem1).value;
    var formVal2 = document.getElementById(formItem2).value;
    var url;
    url = 'f?p=&APP_ID.:8:&APP_SESSION.::::P8_PROJECT,P8_PDRL_NO:' + formVal1 + ',' + formVal2;
    w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    </script>
    troubleshooting
    1.Test each parameter separate first - each work ?
    2.Use code above, rerig it, create multiple parameter
    3.try again...
    hope this helps...
    check your orginial source (page where items are) - what data

  • How to create Image from 8-bit grayscal pixel matrix

    Hi,
    I am trying to display image from fingerprintscanner.
    To communicate with the scanner I use JNI
    I've wrote java code which get the image from C++ as a byte[].
    To display image I use as sample code from forum tring to display the image.
    http://forum.java.sun.com/thread.jspa?forumID=20&threadID=628129
    import java.awt.*;
    import java.awt.color.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class Example {
    public static void main(String[] args) throws IOException {
    final int H = 400;
    final int W = 600;
    byte[] pixels = createPixels(W*H);
    BufferedImage image = toImage(pixels, W, H);
    display(image);
    ImageIO.write(image, "jpeg", new File("static.jpeg"));
    public static void _main(String[] args) throws IOException {
    BufferedImage m = new BufferedImage(1, 1, BufferedImage.TYPE_BYTE_GRAY);
    WritableRaster r = m.getRaster();
    System.out.println(r.getClass());
    static byte[] createPixels(int size){
    byte[] pixels = new byte[size];
    Random r = new Random();
    r.nextBytes(pixels);
    return pixels;
    static BufferedImage toImage(byte[] pixels, int w, int h) {
    DataBuffer db = new DataBufferByte(pixels, w*h);
    WritableRaster raster = Raster.createInterleavedRaster(db,
    w, h, w, 1, new int[]{0}, null);
    ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
    ColorModel cm = new ComponentColorModel(cs, false, false,
    Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
    return new BufferedImage(cm, raster, false, null);
    static void display(BufferedImage image) {
    final JFrame f = new JFrame("");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(new JLabel(new ImageIcon(image)));
    f.pack();
    SwingUtilities.invokeLater(new Runnable(){
    public void run() {
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    And I see only white pixels on black background.
    Here is description of C++ method:
    GetImage
    Syntax: unsigned char* GetImage(int handle)
    Description: This function grabs the image of a fingerprint from the UFIS scanner.
    Parameters: Handle of the scanner
    Return values: Pointer to 1D-array, which contains the 8-bit grayscale pixel matrix line by line.
    here is sample C++ code which works fine to show image in C++
    void Show(unsigned char * bitmap, int W, int H, CClientDC & ClientDC)
    int i, j;
    short color;
    for(i = 0; i < H; i++) {
         for(j = 0; j < W; j++) {
         color = (unsigned char)bitmap[j+i*W];
         ClientDC.SetPixel(j,i,RGB(color,color,color));
    Will appreciate your help .

    Hi Joel,
    The database nls parameters are:
    select * from nls_database_parameters;
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET CL8MSWIN1251
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 9.2.0.4.0
    Part of the email header:
    Content-Type: multipart/alternative; boundary="---=1T02D27M75MU981T02D27M75MU98"
    -----=1T02D27M75MU981T02D27M75MU98
    -----=1T02D27M75MU981T02D27M75MU98
    Content-Type: text/plain; charset=us-ascii
    -----=1T02D27M75MU981T02D27M75MU98
    Content-Type: text/html;
    -----=1T02D27M75MU981T02D27M75MU98--
    I think that something is wrong in the WWV_FLOW_MAIL package. In order to send 8-bit characters must be used UTL_SMTP.WRITE_ROW_DATA instead of the UTL_SMTP.WRITE_DATA.
    Regards,
    Roumen

  • Length of Uniqueid for matrix Column

    There appears to be an inconsistency in the length of the UniqueID that can be used for a matrix column.
    For an Addon in 2005 I have UDFs whose name is 12 characters long (including the U_), when appearing in matrix on a system form the system uses the UDF name for the columnID.
    However if I try to do the same thing when adding a column to a matrix on a user form I get error -7013 'The string value entered is too long; it should be less than 10 characters  [66000-14]'.
    Mirroring the UDF name as the column Id allows me to have generic code with out the need to jump through hoops to aling columns and field names.
    Is this a known issue for which there is a fix available?

    Hi Graham,
    It's a known issue but I'm not sure if a fix will be provided (it's a 'by design' feature and not a bug). I tested this in SBO 2007A and you still cannot have a matrix column in a user-defined form with a unique id of more than 10 chars.
    Unfortunately, you'll need to code a workaround or reduce your UDF sizes to 10 characters.
    Also, if you haven't already done so, I'd recommend you create a suggestion on the development collaboration forum:
    /community [original link is broken]
    Kind Regards,
    Owen

  • Need help in matrix report

    <p>Dear fellows,<br>
    <br>
    I am designing a matrix report of Rooms those are vacant at certian time and
    days of week. In this time values are fixed, I have written the mention below
    query to design the report.<br>
    <b><br>
    Table Description is</b> <br>
    <br>
    <br>
    SQL> desc vac_rm<br>
    Name                            
    Null?     Type<br>
    ----------------------------------------- -------- ----------------------------<br>
    RM_NO                                           
        NOT NULL VARCHAR2(8)<br>
    DAY                                                     
    NOT NULL VARCHAR2(9)<br>
    TIME                                                    
    NOT NULL VARCHAR2(20)<br>
    VACANT                                                                  
    CHAR(1)<br>
    <br>
    <b>Query is</b> <br>
    SELECT day, time,<br>
    LTRIM(MAX(SYS_CONNECT_BY_PATH(rm_no,','))<br>
    KEEP (DENSE_RANK LAST ORDER BY curr),',') AS Room<br>
    FROM (SELECT day,time, rm_no,<br>
    ROW_NUMBER() OVER (PARTITION BY day ORDER BY rm_no) AS curr,<br>
    ROW_NUMBER() OVER (PARTITION BY day ORDER BY rm_no) -1 AS prev<br>
    FROM vac_rm <br>
    where vacant = 'Y'))<br>
    GROUP BY day, time<br>
    CONNECT BY prev = PRIOR curr AND day = PRIOR day<br>
    START WITH curr = 1<br>
    <br>
    The problem occur in this way that when I see the result It show same room no
    many time in single cell.<br>
    <br>
    For Example there is Room A1 and it is vacant on monday at <br>
    9:00 AM - 11:00 AM, then it will show<br>
    <br>
    <b>Time</b>            9:00 AM - 11:00
    AM    11:15 AM - 1:00 PM<br>
    <b>Day</b> <b><br>
    Moday</b>            
    A1, A1, A1                A1, A1, A1, A3, A2<br>
    <br>
    I am very grateful In this regard if you sort out this matter. <br>
     </p>

    For the periods, create a seperate dummy query and then use it as column group in the multi query matrix.

  • Matrix Program - First time using multiple classes

    I'm writing a program right now that takes matrices from an input file specified by the user. The file is in this format.
    #rows #columns
    1 1 1 1 1 1
    1 1 1 1 1 1
    1 1 1 1 1 1
    So in place of #rows I would have a 3, and #columns would be a 6. They are seperated by a space, as are the elements.
    I have two classes, one entitled Proj6 (Yes, it's a school assignment) and one called Matrix. Proj6 chooses the name of the file to use. After the Matrix class creates the two matrices, using loops, Proj6 then asks what I would like to do to these matrices. I must be able to:
    Print the two Matrices
    Add
    Subtract (just in the order of Matrix 1 - Matrix 2)
    Transpose Matrix one.
    Quit the program.
    Here is my Proj6 Class:
    public class Proj6 {
         public static Scanner s;
         public static Scanner f;
         public static void main(String[]args) throws FileNotFoundException {
              System.out.print("Please Enter the filename, complete with extension: ");
              s = new Scanner(System.in);
              f = new Scanner(new File(s.nextLine()));
              String fline = (f.nextLine());
              StringTokenizer st = new StringTokenizer(fline ," ");
              String r = st.nextToken();
              int row = Integer.parseInt(r);
              String c = st.nextToken();
              int col = Integer.parseInt(c);
              Matrix m1 = new Matrix(row,col);
              for (int i = 0; i < row; i++){
                   fline = (f.nextLine());
                   for (int j = 0; j < col; j++){
                        while (st.hasMoreTokens()){
                        String x = st.nextToken();
                        int value = Integer.parseInt(x);                              
                        m1.setElem(i,j,value);     
              f.nextLine();
              fline = (f.nextLine());
              r = st.nextToken();
              row = Integer.parseInt(r);
              c = st.nextToken();
              col = Integer.parseInt(c);
              Matrix m2 = new Matrix(row,col);
              for (int o = 0; o < row; o++){
                   fline = (f.nextLine());
                   for (int j = 0; j < col; j++){
                        while (st.hasMoreTokens()){
                        String x = st.nextToken();
                        int value = Integer.parseInt(x);                              
                        m2.setElem(o,j,value);                    
              System.out.println("Enter (p)rint, (a)dd, (t)ranspose, or (q)uit");
              String a = s.nextLine();
              char action = a.charAt(0);
              if (action == 'p') {
                        String print1 = Matrix.toString(m1);
                        System.out.println("First");
                        System.out.println();
                        System.out.print(print1);
                        String print2 = Matrix.toString(m2);
                        System.out.println("Second");
                        System.out.println();
                        System.out.print(print2);
              else if (action == 'a') {
              else if (action == 't') {
                        Matrix m1t = new Matrix(transpose(m1));
                        Matrix m2t = new Matrix(transpose(m2));
                        String print1 = Matrix.toString(m1t);
              else {
                        System.exit(-1);
    }Here is my "Matrix" class
    import java.util.*;
    public class Matrix {
         public int row;
         public int col;
         public int[][] arr = new int[row][col];
         Matrix (int row, int col) {
              arr = new int[row][col];          
         public void setElem(int row, int col, int value) {
              arr[row][col] = value;
         public String toString (Matrix m){
              return null;
         public Matrix plusMatrix (Matrix m) {
              if (m1.length != m2.length || m1.length[0] != m2.length[0]) {
                   return null;
              Matrix x = new Matrix(m1.length,m1.length[0]);
              int number;
              for (int i = 0; i<m1.length; i ++) {
                   for (int j = 0; j<m1[0].length; j ++) {
                        number = (Integer.parseInt(m1[i][j]) + Integer.parseInt(m2[i][j]));
                        x.setElem(i,j,number);
              return x;
         public Matrix minusMatrix(Matrix m) {
              Matrix x = new Matrix(m1.length, m1.length[0]);
              return x;
         public Matrix transpose (Matrix m) {
              int number;
              Matrix x = new Matrix(m1.length[0],m1.length);
              for (int i = 0; i< m1.length[0]; i ++) {
                   for (int j = 0; j<m1.length; j ++) {
                        number = Integer.parseInt(m1[i][j]);
                        x.setElem(i,j,number);                    
              return x;
    }I'm having two main problems:
    First, my references to "m1" and "m2" in the Matrix class get the cannot be resolved errors. Once I've created the matrices correctly (in theory) why can't I refer to them in Matrix?
    Second, I don't think that I'm creating the matrix quite correctly. I know that Tokenizer is technically obsolete, but I'm more familiar with it than the split method.
    I'm required to use a toString method in Matrix to "Print" the matrices from each function, but I'm not allowed to send it any parameters, or use any print statements in the Matrix class.
    Can you guys catch any errors that I can rectify without necessarily changing my techniques? Or at least provide a thorough explanation for any technique changes?

    My new, updated code is having trouble getting the Matrices inputted correctly
    public class Proj6 {
         public static Scanner s;
         public static Scanner f;
         public static void main(String[]args) throws FileNotFoundException {
              System.out.print("Please Enter the filename, complete with extension: ");
              s = new Scanner(System.in);
              f = new Scanner(new File(s.nextLine()));
              String fline = (f.nextLine());
              StringTokenizer st = new StringTokenizer(fline ," ");
              int row = Integer.parseInt(st.nextToken());
              int col = Integer.parseInt(st.nextToken());
              Matrix m1 = new Matrix(row,col);
              System.out.println(row + "  " + col);
              System.out.print(fline);
              f.nextLine();
              f.nextLine();
              fline = f.nextLine();
              for (int i = 0; i < row; i++){               
                   while (st.hasMoreTokens()) {
                        int value = Integer.parseInt(st.nextToken());
                        System.out.println(value);
                        for (int j = 0; j < col; j++){
                             m1.setElem(i,j,value);     
                   fline = (f.nextLine());
              //System.out.println(toString());
              System.out.println(fline);
              System.out.println("Here begins the second matrix");
              int row2 = Integer.parseInt(st.nextToken());
              int col2 = Integer.parseInt(st.nextToken());
              System.out.print(row2 + "  " + col2);
              Matrix m2 = new Matrix(row2,col2);
              for (int o = 0; o < row2; o++){
                   f.nextLine();
                   while (st.hasMoreTokens()) {
                        int value = Integer.parseInt(st.nextToken());
                        for (int j = 0; j < col2; j++){
                             m2.setElem(o,j,value);                    
              }When I run this code with this matrix file:
    3 5
    8 19 7 15 4
    21 42 9 0 26
    13 7 2 1 16
    4 5
    2 12 6 9 0
    40 22 8 4 17
    3 13 8 29 10
    1 1 1 1 1 I get:
    3 5
    3 52 12 6 9 0
    Here begins the second matrix
    it's not moving through correctly. The f.nextLine()operator, and its relation to the string fline is confusing me.
    Edited by: Ryanman on Apr 7, 2010 9:31 PM

  • Printing in dot matrix

    I am working in D2k environment, where i need to call a java program which sets the formated text to a dot matrix printer.
    The text is of a 2D char array. which is converted into a string.
    I wrote this string, to a FileOutputStream with printer name as the file name. But the problem is that the result is jumbled format. is there any means to specify the printer codes (say where to add newline, form feed etc) in the char array itself.
    Appreciate if anyone help me.

    http://java.sun.com/j2se/1.4.2/docs/guide/jps/

  • Can values in matrix cells flow across the pages (Reports 6i)?

    Hi,
    I have to display more than 1000 char in a matrix cell. The report errors out when the values in the matrix cells exceeds the page. Can values in matrix cells flow across pages?
    any help on this?
    Thank You,
    -- Raja

    As far as to make the report work, developing the query accordingly using UNION does help.
    But my question is still not answered and no replies as well.
    So I think, Two frames with print direction as down and One frame with print direction as Across is not possible.
    Regards
    Arif

  • Printing Reports to Dot-Matrix Printer

    I have a customer that is trying to print a report to my company's dot-matrix printer and we keep seeing a "bold/unbold" command (7B, OB) where we should be getting actual bolded text. Is there anyone who has experience printing Oracle reports to a simple dot-matrix text printer? Can you suggest a printer emulation or fix?

    The dflt132,dflt like.. files in c:\orawin95\rdbms\reports\print(may be dir is correct) for the printer and make sure that the file contains the correct escape sequence
    like if bold escape "70",etc..
    if you know Foxpro Special Char values,the samething you can apply in the dflt files.
    Hope this helps.
    null

  • PRO*C VERSION MATRIX 및 VERSION 별 특성

    제품 : PRECOMPILERS
    작성날짜 : 1998-02-19
    PRO*C version matrix 및 version 별 지원 내용
    ===========================================
    [1] PRO*C 의 version 별 지원 내용
    RDBMS 의 version 과 PRO*C 의 version 별 지원내용은 다음과 같다.
    PRO*    Last    RDBMS    Languages
    Version Version Version
    ======================================================================
    1.3     1.3.20  <6.0.35      PRO*C
    1.4     1.4.15/6 6.x          "
    1.5     1.5.10   7.0.x        "
    1.6     1.6.7    7.1.x        "
    1.6     1.6.9    7.2.x        "
    2.0     2.0.6    7.1.x        "
    2.1     2.1.3    7.2.x        "
    2.2     2.2.?    7.3.x        "
    [2] 각 version 의 pro*c의 precompile option 추가 부분과 header file
    위치는 다음과 같다.
    (1) version 1.4
    Location: $ORACLE_HOME/proc/demo
    File: proc.mk
    Build from "prog.pc":  make -f proc.mk prog
    Where to add options:  edit PRO14FLAGS
    Header files in:       $ORACLE_HOME/proc/lib
    (2) version 1.5
    Location: $ORACLE_HOME/proc/demo
    File: proc.mk
    Build from "prog.pc":  make -f proc.mk prog
    Where to add options:  edit PROFLAGS
    Header files in:       $ORACLE_HOME/proc/lib
    (3) verion 1.6 , 1.7,1.8
    Location: $ORACLE_HOME/proc16/demo
    File: proc16.mk
    Build from "prog.pc":  make -f proc.mk prog
    Where to add options:  edit PCCFLAGS
    Header files in:       $ORACLE_HOME/sqllib/public
    (4) version 2.0, 2.1
    Location: $ORACLE_HOME/proc/demo
    File: proc.mk
    Build from "prog1.pc": make -f proc.mk EXE=prog OBJS="prog1.o prog2.o"
      and "prog2.pc"
    Where to add options:  add PROFLAGS
    Header files in:       $ORACLE_HOME/sqllib/public
    (5) version 2.2
    Location: $ORACLE_HOME/precomp/demo/proc
    File: proc.mk
    Build from "prog1.pc": make -f proc.mk build EXE=prog OBJS="prog1.o
    prog2.o"
      and "prog2.pc"
    Where to add options:  add PROCFLAGS
    Header files in:       $ORACLE_HOME/precomp/public
    [3]다음은 각 VERSION 별 지원 내용을 살펴 보기로 한다.
    (1) VERSION 1.4
    1. precompiler option 의 추가된 부분은 LINES=YES option지정시 outpute 에
    #line directives 생성 지원되어debugging 에 도움울 줄수 있게
    되었으며, dynamic method 사용시 HOLD_CURSOR=YES option을 사용하여
    cursor의 재사용을 방지할 수 있게 되었다. AREASIZE,REBIND option 이
    없어지고 MODE=ANSI14 option 을 지원 가능하게 되었다. 그러나 이 ANSI14
    option 을 사용시는 4byte inter 인 SQLCODE 를 반드시 declare 해야 한다.
    SQLCHECK=SEMANTICS/SYNTAX/NONE (Default는 SYNTAX) 가 사용되고, 더이상
    log를 db에 기록하지 않게 되었다.
    2  Datatype equivalencing 지원 한다.
        EXEC SQL VAR host_variable IS datatype ;
        EXEC SQL TYPE type is datatype REFERENCE ;
    3. Indicator 변수를 사용가능 ( :host INDICATOR :indicator ) 하게
    되었으며 또한 AT 절에 host 변수를 사용가능하게 되었다. 또host변수
    선언시 auto, extern, static, const, volatile 사용 가능하다.
    4. SQLCA 의 sqlerrd(5) 에 0 based parse offset을 저장하였으나, v2.x 의
    현재 version 에서는 사용되어지지 않고있다..
    5 procedure call 이 가능하게 되었다. (EXEC SQL WHENEVER ... DO
    procedure) .
      또한 EXEC SQL WHENEVER ... DO break; 문이 사용가능하다 .
    6. Precompiler 실행모듈이 각 언어마다 구분되어 pro*c 의 경우function의
    prototypes 생성
       가능하다.
    (2) Version 1.5
    ============
    이 version 은 ORACLE RDBMS 7.x 를 지원하는 pro*c version 으로 완벽한
    ANSI SQL을 지원한다. 또한 NLS 의 support 도 지원가능하다
    1. precompile option 의 변경사항으로는 DBMS=NATIVE/V6/V7 option
    지원하며 FIPS=YES로 설정시 ANSI extension 지원한다.
    2.  data type 변경사항으로는 fixed length datatypes 지원하는 CHARF,
    CHARZ가 사용가능하며 LONG VARCHAR,LONG VARRAW datatypes 지원가능하다.
    또한 MLSLABEL 데이타 타입사용 가능하게 되었는데 이는 variable_lengrh
    의 binary OS label 을 저장할때 사용가능하다.
    3. indicators 없는 host 변수가 null을 fetch하면, DBMS=V6으로
    설정하지 않은 경우는
       ORA-1405를 return 함. PL/SQL table을 파라미터로 하는 stored
    procedures 호출 가능.
    4. 이전 version 에서 space 만 가능했던 (bug) input character string
    데이타 타입이
       terminator를 포함하는 경우도 이를 데이타로 인식 가능
    (3) version 1.6
    ==================
    1.변경된 precompile option 으로 AUTO_CONNECT=YES option
    지원하는데
    이를 지정시는 처음 sql 문 수행시 OPS$<username>으로 자동 connect 된다. 
    또한 CONFIG=<file> option 지원으로 user 의 configuration 의 name 과
    위치를 지정할수 있다. 또한 시스템 config file 사용 가능한데 이의 위치는
    UNIX = $ORACLE_HOME/proc16/pccc.cfg, VMS=ora_pcc:pccc.cfg. 이다.
    2. SQLSTATE 변수는 SQL문 실행 이후에 값이 설정된다. MODE=ANSI로 설정이
    되어 있고, declare section안에 선언되어 있는 경우에만 이값이 설정된다. 
    만일 그렇지 않으면 이 값은 무시된다.만약 SQLCODE가 안에 선언되어 있다면,
    이 두 변수 모두 값이 설정된다.
     만약 SQLCODE가 밖에 선언되어 있다면 SQLSTATE만 설정된다. SQLSTATE는
    coding scheme를 표준화하는데 사용된다. SQLCODE는 declare section
    내부에 선언되거나, SQLSTATE, SQLCA가 사용되지 않는 경우에 사용하게 된다.
    이 점은 1.5 버젼에서 SQLCA를 declare section 밖에 선언하여, SQLCA와
    같이 사용되었던 것과는 차이가 있다.
    3. SQLGLS 함수 지원하는데 이는 마지막 문장을 parse 한 후, 문장의 길이
    및 타입을 return한다. 
    eg) int sqlgls(char *sqlstm ,size_t
    *stmlen,size_t *sqlfc)
    4. select 문에서 stored function 을 call 할수 있다.
    5. 단 SQLCHECK=FULL/SEMANTICS 가 아닌 경우에 FROM 절에서 subquery 가
    가능하다. 이는 PL/SQL 의 semantic check 인 경우는 v7.3 에서 가능하다 .
    (4) Version 1.8
    ================ 
    1. INDICATOR VARIABLE을 사용하지 않고도 NULL FETCH시 ORA-1405 에러가
    발생하지 않도록 UNSAFE_NULL=YES 옵션이 추가됨. UNSAFE_NULL=YES로
    설정하면 ORA-1405 를 방지하기 위해서 DBMS=V6 으로 세팅할 필요없이
    DBMS=V7 으로 할 수 있음. 단, UNSAFE_NULL=YES를 사용하기 위해서는
    MODE=ORACLE 로 설정해야 함.
    2. PACKAGE ARGUMENT로 PL/SQL CURSOR(WEAKLY TYPED)를 사용할 수 있는데
    예를 들면 TYPE GeneralCurTyp IS REF CURSOR;
    3. FROM 절에서 SUBQUERY를 사용할 수 있고 SQLCHECK=SEMANTICS 또는
    SQLCHECK=FULL 옵션을 사용할 수 있음.
    4. PL/SQL 블럭에서 PL/SQL TABLE과 이와 관련된 다음 함수를 지원.
     a_table(index).EXISTS, a_table.COUNT, a_table.FIRST, a_table.LAST,
    a_table.PRIOR(index), a_table.NEXT(index),
    a_table.DELETE(start_index,_index), a_table.DELETE.
    5. WHERE CURRENT OF CURSOR를 이용해서 MULTI-TABLE VIEW를 통해
    KEY-PRESERVED TABLE을 UPDATE 가능.
    (5) version 2.0
    ==================
    RDBMS version 7.3에서 부터 makefile 은
    ins_precomp.mk,env_precomp.mk, proc.mk의 3 개로 나뉘었다.
    Ins_precomp.mk 는 기존의 proc.mk 처럼 precompiler executables 를 build
    하기 위한 routine 이고 env_precomp.mk 는 모든 environment 의 변수와
    libraray 를 포함한다.
    이 file 은 Ins_precomp.mk 와 proc.mk 에 포함되어 사용되어진다.
    1. V1.6과 같이 AUTO_CONNECT, CONFIG 옵션 지원. SYSTEM CONFIGURATION
    FILE은 UNIX에서는 $ORACLE_HOME/proc/pmscfg.h 이고 VMS에서는
    ora_proc20:pmscfg.cfg
    2. V1.6과 같이 SQLSTATE 변수와 SQLGLS 함수가 제공된다.
    3. C PREPROCESSOR가 포함되어서 #define이 EMBEDDED SQL과 함께 이용될 수
    있고 #include 로 PRO*C 헤더화일을 INCLUDE 가능.
    4. 구조체를 HOST 변수로 사용 가능. 이것은 SELECT INTO, FETCH INTO 
    또는 INSERT시 VALUES 절에 사용될 수 있으나 PL/SQL PROCEDURE에 PL/SQL
    RECORD ARGUMENT로 사용할 수는 없음. 구조체 내에 또다른 구조체를 포함할
    수는 없지만 ARRAY는 포함할 수 있음.
    5. HOST 변수를 BEGIN/END DECLARE SECTION 안에 넣을 필요가 없음.
    6. V1.6에서 처럼 SELECT LIST에 STORED FUNCTION의 사용이 가능.
    7. SQLCHECK=FULL/SEMANTOCS를 사용하지 않는 경우 FROM 절에 SUBQUERY를
    쓸 수 있음.
    8. CHARACTER 변수의 BIND TYPE은 MODE 옵션이 아니라 DBMS 옵션에 따라서
    결정됨. DBMS=V6/V6_CHAR 인 경우, CHARACTER는 TYPE 1, DBMS=V7(또는
    NATIVE이고 ORACLE7에 접속할 때) 에서는 TYPE 97.
    9. DBMS=V6_CHAR 는 CHARACTER 변수가 가변 길이 문자열로 다루어질 수
    있도록 함.
    10. SQLVCP 함수는 VARCHAR ARR 변수를 지정한 길이로 만들어 주므로
    VARCHAR를 동적으로 할당할 때 COMPILER가 BYTE ALIGNMENT를 가능하게 함.
    11. PRO*C의 PARSE LEVEL을 설정하는 PARSE 옵션.
    a) NONE - PRO*C V1과 같음(HOST 변수를 DECLARE SECTION에 넣어야 함.
    #define 인식 안함 등)
    b) PARTIAL - HOST 변수를 DECLARE SECTION에 넣어야 함
    c) FULL - PRO*C V2의 기능 모두 지원
    12. EXEC SQL WHENEVER ... DO 함수명(args,...); 와 같이 함수호출시UMENT를
    주고 받을 수 있음.
    13. #ifdef/#ifndef 와 EXEC ORACLE IFDEF/IFNDEF 에서 사용하기 위한
    DEFINE 옵션 지원.
    (6) version 2.1
    ================
    1. PRO*C V1.7에서와 같이 char와 IMPLICIT VARCHAR (VARCHAR=YES 옵션과
    함께 적절한 C 구조체로 선언된 변수) HOST 변수에서 MULTI-BYTE NLS
    CHARACTER 데이타와 MULTI-BYTE 문자열을 지원.
     NLS_CHAR=var1,var2,... 옵션으로 MULTI-BYTE HOST 변수를 지정함.
    MULTI-BYTE 리터럴은 다음과 같이 사용된다.
     EXEC SQL SELECT ... WHERE ENAME = N*이경구*;
     단, 이것은 SQLLIB RUNTIME LIBRARY를 통해서 지원되기 때문에 MULTI-BYTE
    NLS 문자열은 DYNAMIC SQL에서 사용될 수 없음. NCHAR 데이타타입은 DDL 과
    함께 사용될 수 없음.
    2. PRO*C V1.7과 같이 NLS_LOCAL 옵션 지원
    3. DEF_SQLCODE=YES 로 설정하면 PRO*C는 다음 문장을 생성한다.
     #define SQLCODE sqlca.sqlcode
     SQLCA는 반드시 INCLUDE 되어야 하며 SQLCODE 변수는 선언되어서는 안됨.
    4. PRO*C V1.7 과 같이 CURSOR VARIABLE 지원.
    5. VARCHAR=YES 로 설정하면 특정한 구조체를 VARCHAR로 인식할 수 있다. 
    구조체의 형태를 보면
     struct
     short len;
     char arr[n];
     } host_var;
    6. CODE=CPP 로 설정하면 SQLLIB 함수 원형(PROTOTYPE)은 다음과 같이
    extern "C" 형식으로 생성됨.
     extern "C" {
     void sqlora( unsigned long *, void *);
     그리고 "//" 와 같은 COMMENT 처리명령을 인식함. 단, CODE=CPP인 경우
    PARSE 는 자동적으로 PARTIAL로 설정됨.
     CPP_SUFFIX 옵션은 PRECOMPILE된 화일의 확장자를 지정.
    SYS_INCLUDE=(dir1,dir2,...) 옵션은 C 헤더 화일과 다른 위치에 있는 C++
    헤더 화일이 있는 디렉토리를 지정. 이 옵션은 PARSE 옵션이 NONE이 아닌
    경우에만 필요하다. HEADER 화일을 찾는 위치는 SYS_INCLUDE, 현재 디렉토리,
    표준 SYSTEM 디렉토리(UNIX에서 PRO*C 헤더 화일의 위치는
    $ORACLE_HOME/sqllib/public), 그리고 INCLUDE 옵션에 지정된 디렉토리이다.

    제품 : PRECOMPILERS
    작성날짜 : 1998-02-19
    PRO*C version matrix 및 version 별 지원 내용
    ===========================================
    [1] PRO*C 의 version 별 지원 내용
    RDBMS 의 version 과 PRO*C 의 version 별 지원내용은 다음과 같다.
    PRO*    Last    RDBMS    Languages
    Version Version Version
    ======================================================================
    1.3     1.3.20  <6.0.35      PRO*C
    1.4     1.4.15/6 6.x          "
    1.5     1.5.10   7.0.x        "
    1.6     1.6.7    7.1.x        "
    1.6     1.6.9    7.2.x        "
    2.0     2.0.6    7.1.x        "
    2.1     2.1.3    7.2.x        "
    2.2     2.2.?    7.3.x        "
    [2] 각 version 의 pro*c의 precompile option 추가 부분과 header file
    위치는 다음과 같다.
    (1) version 1.4
    Location: $ORACLE_HOME/proc/demo
    File: proc.mk
    Build from "prog.pc":  make -f proc.mk prog
    Where to add options:  edit PRO14FLAGS
    Header files in:       $ORACLE_HOME/proc/lib
    (2) version 1.5
    Location: $ORACLE_HOME/proc/demo
    File: proc.mk
    Build from "prog.pc":  make -f proc.mk prog
    Where to add options:  edit PROFLAGS
    Header files in:       $ORACLE_HOME/proc/lib
    (3) verion 1.6 , 1.7,1.8
    Location: $ORACLE_HOME/proc16/demo
    File: proc16.mk
    Build from "prog.pc":  make -f proc.mk prog
    Where to add options:  edit PCCFLAGS
    Header files in:       $ORACLE_HOME/sqllib/public
    (4) version 2.0, 2.1
    Location: $ORACLE_HOME/proc/demo
    File: proc.mk
    Build from "prog1.pc": make -f proc.mk EXE=prog OBJS="prog1.o prog2.o"
      and "prog2.pc"
    Where to add options:  add PROFLAGS
    Header files in:       $ORACLE_HOME/sqllib/public
    (5) version 2.2
    Location: $ORACLE_HOME/precomp/demo/proc
    File: proc.mk
    Build from "prog1.pc": make -f proc.mk build EXE=prog OBJS="prog1.o
    prog2.o"
      and "prog2.pc"
    Where to add options:  add PROCFLAGS
    Header files in:       $ORACLE_HOME/precomp/public
    [3]다음은 각 VERSION 별 지원 내용을 살펴 보기로 한다.
    (1) VERSION 1.4
    1. precompiler option 의 추가된 부분은 LINES=YES option지정시 outpute 에
    #line directives 생성 지원되어debugging 에 도움울 줄수 있게
    되었으며, dynamic method 사용시 HOLD_CURSOR=YES option을 사용하여
    cursor의 재사용을 방지할 수 있게 되었다. AREASIZE,REBIND option 이
    없어지고 MODE=ANSI14 option 을 지원 가능하게 되었다. 그러나 이 ANSI14
    option 을 사용시는 4byte inter 인 SQLCODE 를 반드시 declare 해야 한다.
    SQLCHECK=SEMANTICS/SYNTAX/NONE (Default는 SYNTAX) 가 사용되고, 더이상
    log를 db에 기록하지 않게 되었다.
    2  Datatype equivalencing 지원 한다.
        EXEC SQL VAR host_variable IS datatype ;
        EXEC SQL TYPE type is datatype REFERENCE ;
    3. Indicator 변수를 사용가능 ( :host INDICATOR :indicator ) 하게
    되었으며 또한 AT 절에 host 변수를 사용가능하게 되었다. 또host변수
    선언시 auto, extern, static, const, volatile 사용 가능하다.
    4. SQLCA 의 sqlerrd(5) 에 0 based parse offset을 저장하였으나, v2.x 의
    현재 version 에서는 사용되어지지 않고있다..
    5 procedure call 이 가능하게 되었다. (EXEC SQL WHENEVER ... DO
    procedure) .
      또한 EXEC SQL WHENEVER ... DO break; 문이 사용가능하다 .
    6. Precompiler 실행모듈이 각 언어마다 구분되어 pro*c 의 경우function의
    prototypes 생성
       가능하다.
    (2) Version 1.5
    ============
    이 version 은 ORACLE RDBMS 7.x 를 지원하는 pro*c version 으로 완벽한
    ANSI SQL을 지원한다. 또한 NLS 의 support 도 지원가능하다
    1. precompile option 의 변경사항으로는 DBMS=NATIVE/V6/V7 option
    지원하며 FIPS=YES로 설정시 ANSI extension 지원한다.
    2.  data type 변경사항으로는 fixed length datatypes 지원하는 CHARF,
    CHARZ가 사용가능하며 LONG VARCHAR,LONG VARRAW datatypes 지원가능하다.
    또한 MLSLABEL 데이타 타입사용 가능하게 되었는데 이는 variable_lengrh
    의 binary OS label 을 저장할때 사용가능하다.
    3. indicators 없는 host 변수가 null을 fetch하면, DBMS=V6으로
    설정하지 않은 경우는
       ORA-1405를 return 함. PL/SQL table을 파라미터로 하는 stored
    procedures 호출 가능.
    4. 이전 version 에서 space 만 가능했던 (bug) input character string
    데이타 타입이
       terminator를 포함하는 경우도 이를 데이타로 인식 가능
    (3) version 1.6
    ==================
    1.변경된 precompile option 으로 AUTO_CONNECT=YES option
    지원하는데
    이를 지정시는 처음 sql 문 수행시 OPS$<username>으로 자동 connect 된다. 
    또한 CONFIG=<file> option 지원으로 user 의 configuration 의 name 과
    위치를 지정할수 있다. 또한 시스템 config file 사용 가능한데 이의 위치는
    UNIX = $ORACLE_HOME/proc16/pccc.cfg, VMS=ora_pcc:pccc.cfg. 이다.
    2. SQLSTATE 변수는 SQL문 실행 이후에 값이 설정된다. MODE=ANSI로 설정이
    되어 있고, declare section안에 선언되어 있는 경우에만 이값이 설정된다. 
    만일 그렇지 않으면 이 값은 무시된다.만약 SQLCODE가 안에 선언되어 있다면,
    이 두 변수 모두 값이 설정된다.
     만약 SQLCODE가 밖에 선언되어 있다면 SQLSTATE만 설정된다. SQLSTATE는
    coding scheme를 표준화하는데 사용된다. SQLCODE는 declare section
    내부에 선언되거나, SQLSTATE, SQLCA가 사용되지 않는 경우에 사용하게 된다.
    이 점은 1.5 버젼에서 SQLCA를 declare section 밖에 선언하여, SQLCA와
    같이 사용되었던 것과는 차이가 있다.
    3. SQLGLS 함수 지원하는데 이는 마지막 문장을 parse 한 후, 문장의 길이
    및 타입을 return한다. 
    eg) int sqlgls(char *sqlstm ,size_t
    *stmlen,size_t *sqlfc)
    4. select 문에서 stored function 을 call 할수 있다.
    5. 단 SQLCHECK=FULL/SEMANTICS 가 아닌 경우에 FROM 절에서 subquery 가
    가능하다. 이는 PL/SQL 의 semantic check 인 경우는 v7.3 에서 가능하다 .
    (4) Version 1.8
    ================ 
    1. INDICATOR VARIABLE을 사용하지 않고도 NULL FETCH시 ORA-1405 에러가
    발생하지 않도록 UNSAFE_NULL=YES 옵션이 추가됨. UNSAFE_NULL=YES로
    설정하면 ORA-1405 를 방지하기 위해서 DBMS=V6 으로 세팅할 필요없이
    DBMS=V7 으로 할 수 있음. 단, UNSAFE_NULL=YES를 사용하기 위해서는
    MODE=ORACLE 로 설정해야 함.
    2. PACKAGE ARGUMENT로 PL/SQL CURSOR(WEAKLY TYPED)를 사용할 수 있는데
    예를 들면 TYPE GeneralCurTyp IS REF CURSOR;
    3. FROM 절에서 SUBQUERY를 사용할 수 있고 SQLCHECK=SEMANTICS 또는
    SQLCHECK=FULL 옵션을 사용할 수 있음.
    4. PL/SQL 블럭에서 PL/SQL TABLE과 이와 관련된 다음 함수를 지원.
     a_table(index).EXISTS, a_table.COUNT, a_table.FIRST, a_table.LAST,
    a_table.PRIOR(index), a_table.NEXT(index),
    a_table.DELETE(start_index,_index), a_table.DELETE.
    5. WHERE CURRENT OF CURSOR를 이용해서 MULTI-TABLE VIEW를 통해
    KEY-PRESERVED TABLE을 UPDATE 가능.
    (5) version 2.0
    ==================
    RDBMS version 7.3에서 부터 makefile 은
    ins_precomp.mk,env_precomp.mk, proc.mk의 3 개로 나뉘었다.
    Ins_precomp.mk 는 기존의 proc.mk 처럼 precompiler executables 를 build
    하기 위한 routine 이고 env_precomp.mk 는 모든 environment 의 변수와
    libraray 를 포함한다.
    이 file 은 Ins_precomp.mk 와 proc.mk 에 포함되어 사용되어진다.
    1. V1.6과 같이 AUTO_CONNECT, CONFIG 옵션 지원. SYSTEM CONFIGURATION
    FILE은 UNIX에서는 $ORACLE_HOME/proc/pmscfg.h 이고 VMS에서는
    ora_proc20:pmscfg.cfg
    2. V1.6과 같이 SQLSTATE 변수와 SQLGLS 함수가 제공된다.
    3. C PREPROCESSOR가 포함되어서 #define이 EMBEDDED SQL과 함께 이용될 수
    있고 #include 로 PRO*C 헤더화일을 INCLUDE 가능.
    4. 구조체를 HOST 변수로 사용 가능. 이것은 SELECT INTO, FETCH INTO 
    또는 INSERT시 VALUES 절에 사용될 수 있으나 PL/SQL PROCEDURE에 PL/SQL
    RECORD ARGUMENT로 사용할 수는 없음. 구조체 내에 또다른 구조체를 포함할
    수는 없지만 ARRAY는 포함할 수 있음.
    5. HOST 변수를 BEGIN/END DECLARE SECTION 안에 넣을 필요가 없음.
    6. V1.6에서 처럼 SELECT LIST에 STORED FUNCTION의 사용이 가능.
    7. SQLCHECK=FULL/SEMANTOCS를 사용하지 않는 경우 FROM 절에 SUBQUERY를
    쓸 수 있음.
    8. CHARACTER 변수의 BIND TYPE은 MODE 옵션이 아니라 DBMS 옵션에 따라서
    결정됨. DBMS=V6/V6_CHAR 인 경우, CHARACTER는 TYPE 1, DBMS=V7(또는
    NATIVE이고 ORACLE7에 접속할 때) 에서는 TYPE 97.
    9. DBMS=V6_CHAR 는 CHARACTER 변수가 가변 길이 문자열로 다루어질 수
    있도록 함.
    10. SQLVCP 함수는 VARCHAR ARR 변수를 지정한 길이로 만들어 주므로
    VARCHAR를 동적으로 할당할 때 COMPILER가 BYTE ALIGNMENT를 가능하게 함.
    11. PRO*C의 PARSE LEVEL을 설정하는 PARSE 옵션.
    a) NONE - PRO*C V1과 같음(HOST 변수를 DECLARE SECTION에 넣어야 함.
    #define 인식 안함 등)
    b) PARTIAL - HOST 변수를 DECLARE SECTION에 넣어야 함
    c) FULL - PRO*C V2의 기능 모두 지원
    12. EXEC SQL WHENEVER ... DO 함수명(args,...); 와 같이 함수호출시UMENT를
    주고 받을 수 있음.
    13. #ifdef/#ifndef 와 EXEC ORACLE IFDEF/IFNDEF 에서 사용하기 위한
    DEFINE 옵션 지원.
    (6) version 2.1
    ================
    1. PRO*C V1.7에서와 같이 char와 IMPLICIT VARCHAR (VARCHAR=YES 옵션과
    함께 적절한 C 구조체로 선언된 변수) HOST 변수에서 MULTI-BYTE NLS
    CHARACTER 데이타와 MULTI-BYTE 문자열을 지원.
     NLS_CHAR=var1,var2,... 옵션으로 MULTI-BYTE HOST 변수를 지정함.
    MULTI-BYTE 리터럴은 다음과 같이 사용된다.
     EXEC SQL SELECT ... WHERE ENAME = N*이경구*;
     단, 이것은 SQLLIB RUNTIME LIBRARY를 통해서 지원되기 때문에 MULTI-BYTE
    NLS 문자열은 DYNAMIC SQL에서 사용될 수 없음. NCHAR 데이타타입은 DDL 과
    함께 사용될 수 없음.
    2. PRO*C V1.7과 같이 NLS_LOCAL 옵션 지원
    3. DEF_SQLCODE=YES 로 설정하면 PRO*C는 다음 문장을 생성한다.
     #define SQLCODE sqlca.sqlcode
     SQLCA는 반드시 INCLUDE 되어야 하며 SQLCODE 변수는 선언되어서는 안됨.
    4. PRO*C V1.7 과 같이 CURSOR VARIABLE 지원.
    5. VARCHAR=YES 로 설정하면 특정한 구조체를 VARCHAR로 인식할 수 있다. 
    구조체의 형태를 보면
     struct
     short len;
     char arr[n];
     } host_var;
    6. CODE=CPP 로 설정하면 SQLLIB 함수 원형(PROTOTYPE)은 다음과 같이
    extern "C" 형식으로 생성됨.
     extern "C" {
     void sqlora( unsigned long *, void *);
     그리고 "//" 와 같은 COMMENT 처리명령을 인식함. 단, CODE=CPP인 경우
    PARSE 는 자동적으로 PARTIAL로 설정됨.
     CPP_SUFFIX 옵션은 PRECOMPILE된 화일의 확장자를 지정.
    SYS_INCLUDE=(dir1,dir2,...) 옵션은 C 헤더 화일과 다른 위치에 있는 C++
    헤더 화일이 있는 디렉토리를 지정. 이 옵션은 PARSE 옵션이 NONE이 아닌
    경우에만 필요하다. HEADER 화일을 찾는 위치는 SYS_INCLUDE, 현재 디렉토리,
    표준 SYSTEM 디렉토리(UNIX에서 PRO*C 헤더 화일의 위치는
    $ORACLE_HOME/sqllib/public), 그리고 INCLUDE 옵션에 지정된 디렉토리이다.

  • Dynamic Smartform - Matrix structure

    Hi All
    i have a requirement to create a table dynamically in a matrix format. i am new to smartforms
    scenario is something like
    1) My internal table structure
    *Article   Store     Quantity*
    1a         S303         2
    2a         S304            3
    3a          S305         2
    4a          S306         4
    5a         S307         5
    1b         S303         2
    2b         S304         3
    3b         S305         2
    4b         S306         4
    5b         S307         5
    i want my smartform to be like
    *Article     S303         S304     S305         S306     S307*
    1a              2          3               2           4                5
    1b              2          3               2           4            5
    suggest me how can i achieve this.thanks in advance.
    Internal table structure may vary time to time
    Regards
    Chaitanya.A

    Article   Store     Quantity
    1a         S303         2
    2a         S304         3
    3a          S305         2
    4a          S306         4
    5a         S307         5
    1b         S303         2
    2b         S304         3
    3b         S305         2
    4b         S306         4
    5b         S307         5
    for this same internal table you have one more filed like char1.
    new internal table is
    Article   Store     Quantity   char1
    1a         S303         2           a
    2a         S304         3           a
    3a          S305         2            a
    4a          S306         4            a
    5a         S307         5            a
    1b         S303         2             b
    2b         S304         3            b
    3b         S305         2             b
    4b         S306         4          b
    5b         S307         5           b
    here you can take 2 varibles like
    data: var1 type char 250,
            var2 type char250,
            lv_n(3)   type n.
    lv_n = 20
    loop at newitab into wa_itab.
    concatenate ' 10 char space'  wa_itab-store  into var1+lv_n(20).
    concatenate ' 10 char space'  wa_itab-Quantity into var2+lv_n(20). .
    at end of char1.
    append var1 to final  interbal table
    append var2 to final  interbal table
    clear lv_n.
    lv_n = 20.
    endat.
    lv_n = lv_n + 20.
    endloop.

  • Matrix Reports and Graphs

    I have been trying to add a graph to a matrix report (v. 9.0.2.0.5), with Region (char value) on the x-axis and numerics on the y-axis, but in the picklists, none of the char fields show up. Is there a solution/workaround?
    Thanks in advance,
    Martin Hoerchner

    My work around was to copy my matrix query and put a graph-friendly version(ie: one without all the grouping) of the query in my report along with the matrix query.

  • Passing Jbytearray to unsigned char

    Hello Group:
    I am newer in JNI and I have a little problem:
    I have a native method with the follow signature:
    public native int enroll(byte[] template);
    now I have it type data in C:
    typedef unsigned char FPIMAGE; /* fp image data object */
    Implementing my native method i need to call a function of a library to proccess this image(in this case the byte[]) but the signature of this method is:
    FPCODE *cA = bd_fpCode(FPIMAGE *A, int xh, int yw, FPCODE buf, int               qval);
    A = pointer to the fingerprint image pixel matrix
    xh = number of rows (height)
    yw = number of columns (width)
    buf = pointer to an external buffer with minimum size of FPC_MAXLEN bytes as destination for the created fingerprint code
    qval = fingerprint image quality value (in %)
    cA = pointer to fp-code (cA == buf) or NULL, if processing failed
    There is my problem i don't now how to pass o convert my byte[] template to a object FPIMAGE.
    you can help me please!

    Hi,
    bd_fpCode() function is a 3rd party library, right ?
    You can use a JNI wapper to do that, so you do not have to write C code.
    Look at http://jnative.free.fr/SPIP-v1-8-3/article.php3?id_article=4 how to pass pointers to your functions and how to handle structures.
    Alternatively, you can use env->GetByteArrayElements() in your own JNI wrapper lib see (http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jnistring.html).
    --Marc (http://jnative.sf.net)
    Message was edited by:
    mdenty

Maybe you are looking for