Using pattern in Index function

Hi, We have a requirement where we want to get first alphabet wherever it appears in the string. For e.g. if we have 12XOF then we want to take out first occurance of Alphabet which is X. If string is 1234y then we want y to be in out output field. It can be anywhere in the alphanumeric string.
I was thinking of using pattern matching in Index function but realized I can not do that. So now I am not sure what I can use to get the first occurance of alphabet in the input string of  alphanumeric. Match can say it matches or not but can not give me the value of that alphabet.
Thanks,

You can create a custom function to strip out the numbers, and give you the first occurence of the alphabet.
$Letter = '';
$Out_String = '';
while(length($P_Input_String) <> 0 and length($Out_String) < 1)
begin
$Letter = substr($P_Input_String,1,1);
if (match_pattern($Letter,'9') = 0)
     begin
     $Out_String = $Out_String||$Letter;
     end
$P_Input_String = substr($P_Input_String,2,length($P_Input_String)-1);
end
Return $Out_String;
$P_Input_String should be an input parameter,
$Letter and $Out_String should be variables created for the function.
Use this custom function in the mapping tab and pass the input string to get the output values.
Regards,
Suneer.

Similar Messages

  • How to use the delta index in TREX?

    We have been using TREX with EP KM for 2 years.
    However we never used the delta index functionality.
    Could you share your experience on how to use delta indexes?
    Thanks!

    Hai,
    Please check the below link.....
    http://help.sap.com/saphelp_nw70/helpdata/EN/d9/0418418291a854e10000000a1550b0/frameset.htm
    Regards,
    Yoganand.V

  • Using Acrobat's Catalog (Index) function in a Browser environment

    Operating in a browser-based Microsoft Sharepoint Server environment, our shop accesses a number of large aircraft-related manuals that consist of multiple documents in Acrobat PDF format. We were stymied whenever we attempted to perform a full-search of the documents (cataloged via an index.pdx file)—the function simply did not work. Strangely, even though we linked the search function to the correct index file on the network server, Acrobat searched for a file on one's local drive.
    The documentation for Acrobat 7.0/9.0 offers the following explanation:
    "To search an Adobe PDF index, you must open Acrobat as a standalone application,not within your web browser." But this information was hardly encouraging since we had no intention of giving up the browser-based environment.
    Our IT staff has discovered there is a way to work around this restriction. The trick is to access the index file using Windows file  protocol. This step in effect launches Acrobat as a standalone app within a browser environment. For example,
         1. Add a bookmark labeled "(FULL TEXT) SEARCH" to the document's main navigation window
         2. Edit the properties of the bookmark
             a. Set the Action to "Open a web link"
             b. Edit the URL to the fully-qualified address of the index file using the file protocol:  file://..../index.pdx
              NOTE: You have to use file protocol in order for the catalog function to work
         3. Save the main document to enable the modifed link
         4. Click the bookmark to launch the Search PDF window. The default Look In target now becomes the catalog file (index.pdx) of item 2b.

    How do you access the generic PDF, directly or through an HTML page? It shouldn't make a difference. More importantly, does a user accessing this file have access to all the folders/files associated with the bookmark, that is, are they on the same server?
    Each of the slash pairs is meaningful. The notation with four slashes file://// ... implies that the host computer and a portion of the path is already known or defined, which I suspect is probably not the case for you. For details of the file URL, see http://www.cs.tut.fi/~jkorpela/fileurl.html. Attempting to access the index.pdx via http://... protocol does not work, as you point out, as it tries to locate the file in the temporary Interner folder on your local computer (as defined in the Internet Options dialog).
    The following notation works in my environment:
    file://z:\deptfolder\subfolder\subfolder\main_subfolder\pdf_subfolder\index.pdx (z: is a network drive)
    file://hostname/deptfolder/subfolder/subfolder/main_subfolder/pdf_subfolder/index.pdx (hostname is our INTRANET server)
    Added note: based on my reading of Acrobat 7.0/9.0 Help, the "Cannot find ..." error message indicates that the link relationship between the master file and the index has been broken.  An index assumes a relative path exists between the index definition file (PDX) and the folder containing the indexed documents. If this relative path remains unchanged, you don't have to do anything after moving the indexed document collection. However, if the relative path changes or the index resides on a drive or server distinct from any part of the collection, you will need to create and build the index in the same location as the collection.
    Using Relative Addressing
    The fact that the Catalog index function relies on relative addressing can simplify the task of maintaining links if the relationship between files remains unchanged in moving from one environment to another. For example,  given the following relationship
    main_subfolder (menu file)
        pdf subfolder (PDF files)
            index subfolder (index definition file)
    recreated in a browser environment, you can create the bookmark links in a menu file as:
        Action: Open a web link     ---->    ./pdf subfolder/filename.pdf  (open PDF document)      
        Action: Open a web link     ---->    ./pdf subfolder/index subfolder/index.pdx (open INDEX file)
    in which the dot notation identifies (i.e., serves as a placeholder for) the path to the main_subfolder, The Open a web link function permits you to modify the contents of the URL. (Acrobat attempts to open each link using the file:// protocol.) For some reason, Acrobat may change the bookmark Action to "Execute a menu item" after you create and save it,  but this step does not change the funtionality of the bookmark.
    Message was edited by: tarusbulba 3/18/2010

  • Not able to copying files/folders from one Document Library to another Document Library using Open with Browser functionality

    Hi All, 
    We have SharePoint Production server 2013 where users are complaining that they are not able to copy or move files from one document library to another document library using “Open with Explorer” functionality.
    We tried to activate publishing features on production server but it did not work. We users reported following errors:  
    Copying files from one document library to another document library:
    Tried to map the document libraries and still not get the error to copy files: 
    In our UAT environment we are able to copy and move folders from using “Open with Explorer” though.
    We have tried to simulate in the UAT environment but could not reproduce the production environment.  
    Any pointers about this issue would be highly appertained.
    Thanks in advance
    Regards,
    Aroh  
    Aroh Shukla

    Hi John and all,
    One the newly created web applications that we created few days back and navigated to document library, clicked on “Open with Explorer”, we get this error.
    We're having a problem opening this location in file explorer. Add this website to your trusted and try again.
    We added to the trusted site in Internet Explorer for this web application, cleared the cache and open the site with same document library but still get the same above error.
    However, another existing web application (In same the Farm) that we are troubleshooting at the moment, we are able click on “Open with Explorer”,  login in credentials opens and we entered the details we are able to open the document
    library and tried to follow these steps:
    From Windows Explorer (using with Open with Explorer), tried to copy or move a files to
    source document library.
    From Windows Explorer moved this file to another destination document library and we got this error.
    What we have to achieve is users should be able to copy files and folders using
    Open with Explorer functionality. We don’t know why Open with Explorer
    functionality not work working for our environment.  
    Are we doing something wrong? 
    We have referred to following websites.
    we hope concepts of copying / Moving files are similar as SharePoint 2010. Our production environment is SharePoint 2013.   
    http://www.mcstech.net/blog/index.cfm/2012/1/4/SharePoint-2010-Moving-Documents-Between-Libraries https://andreakalli.wordpress.com/2014/01/28/moving-or-copying-files-and-folders-in-sharepoint/
    Please advise us. Thank you.
    Regards,
    Aroh
    Aroh Shukla

  • Is there any way to create a circular buffer using the INSERT ARRAY function?

    I saw the example using the REPLACE ARRAY function, but it uses too much CPU power on my laptop. I'm using it for a very sensitive application and saw that the INSERT ARRAY function used much less CPU power.
    I am also not wiring the index on the INSERT ARRAY function so that whatever is read from the buffer is added to the array.
    However, since it is not indexed, I don't know how to set the "write" index back to 0 when it reaches a certain sized array (ie 1000 elements). I was looking for an array property node, but couldn't figure out if one exists for the "current write index".
    Can anyone help?
    Thanks

    I will try to answer this question to my best understanding. I apologize if I interpreted the question wrong.
    You are using the "Insert Array" vi without wiring the index. By doing that, new elements will be added (appended) to the array.
    If you just want to know the current index to stop your acquisition when the array reach certain amount of elements, then you can use the "Array Size" vi to keep track of the size of the growing array. Remember that Array Size = last index + 1 because the index start at zero.
    A second option is that you may want to start over the array when it hits the maximum number of elements that you will allow. If that's the case, then you may want to re-initialize the array to a NULL state by stablishing a condition (for example, when the
    size of the array is 1000, re-initialize). I provided an example attached to this message showing how this can be accomplished. In the example, an 1D array grows in size using the "Insert Array" vi and inserting a random number. When the array reach 4 elements, it is re-initialized. You can expand this example by saving the array first to a file or some other holder before re-initializing the array. The example is in LabVIEW 6.
    Finally, if you want to replace the current values with new values, I think you do not have other choice but to use the "Replace Array" vi.
    Hope this can be of help.
    Regards;
    Enrique Vargas
    www.vartortech.com
    Attachments:
    array_example.vi ‏20 KB

  • Using a Value index on XMLIndex path table.

    I am trying to understand how to capitalize on the VALUE index created on a XMLIndex path table. So far, I have not been able to successfully use it. I am not sure whether I am misunderstanding the way it is intended to be used? Or am making a mistake somewhere else along the way. Here is a use-case where I think that it should be getting picked up by the optimizer:
    CREATE TABLE TEST_TABLE
        (ID VARCHAR2(128) NOT NULL,
        XML_DATA XMLTYPE NOT NULL,
        CONSTRAINT TEST_PK PRIMARY KEY (ID))
    XMLTYPE COLUMN XML_DATA STORE AS BINARY XML;
    -- Populate the table with some random data.  Here, our single attribute should be
    -- unique for each row.
    INSERT INTO TEST_TABLE (
      SELECT dbms_random.string('A', 15), XMLElement("Test", XMLAttributes(dbms_random.string('A', 15) as "someAttr"))
      FROM DUAL
      CONNECT BY LEVEL <= 20000 );
    CREATE INDEX test_xmlindex_ix ON TEST_TABLE(XML_DATA) INDEXTYPE IS XDB.XMLIndex
      PARAMETERS('
        PATHS (Include (/Test/@someAttr))
        PATH TABLE      test_path_table
        PATH ID INDEX   test_path_id_ix
        ORDER KEY INDEX test_key_ix
        VALUE INDEX     test_value_ix ');
    -- Not sure if I need these or not?
    CALL DBMS_STATS.GATHER_TABLE_STATS ('MYSCHEMA', 'TEST_TABLE');
    CALL DBMS_STATS.GATHER_TABLE_STATS ('MYSCHEMA, 'TEST_PATH_TABLE');
    -- Now, I would expect this query to use the Value index that was created.
    -- Instead, the Explain plan indicates that TEST_PATH_ID_IX was used..
    SELECT xml_data
    FROM   test_table v
    WHERE  extractValue(v.xml_data, '/Test/@someAttr') = ?
    Here are the operations listed in the explain plan for the query:
    SELECT STATEMENT
    FILTER
    TABLE ACCESS(FULL) MYSCHEMA.TEST_TABLE
    TABLE ACCESS(BY INDEX ROWID) MYSCHEMA.TEST_PATH_TABLE
    INDEX(RANGE SCAN) MYSCHEMA.TEST_PATH_ID_IXIf I understand everything correctly, here, there is no reason why the PATH ID index should have been used. Isn't this index strictly for the XML tags themselves? Why wouldn't it use the Value index?
    Thanks,
    Jon

    PATH_TABLE
    +=======================================================+
    | PathID |  RID  | Order_Key | Locator |     Value      |
    |-------------------------------------------------------|
    |  RAW   | rowid |    RAW    |   RAW   | varchar2(4000) |
    |-------------------------------------------------------|
    |        |       |           |         |                |
    |        |       |           |         |                |
    |        |       |           |         |                |
    |        |       |           |         |                |
    |        |       |           |         |                |
    |        |       |           |         |                |
    |        |       |           |         |                |
    +=======================================================+
    XMLIndex
    1) PATH  INDEX: (PathID, RID)              - BTree
    2) ORDER INDEX: (RID, ORDER_KEY)           - BTree
    3) VALUE INDEX: (substr("VALUE",1,1599))   - Function Based
    Locator: Pointer to XML Fragments
    XMLIndex - Namespace issue...
    I believe that (although I don't know the exact mechanics) that it will use the path index first to find the needed
    tree node / path, then will look for a locator that matches the request and if not will do an full table scan
    afterwards, if not successful, trying to limit the request with the filter at hand, so see if it can be used, to
    minimize the sub-results.
    Message was edited by:
    Marco Gralike

  • Newbie : Using "this" in a function

    I have a function in my main class that spawns
    a Dialog for user input. The strange thing is, that I get
    a compiler error anytime i try to use "this" inside my
    function. Please help. Can you see anything wrong
    with the code in this function? I am calling it from
    another class.
    public static void createNewCell() {
    JDialog newDialog = new JDialog();
    newDialog.setTitle("New Cell Site");
    newDialog.setResizable(false);
    newDialog.setModal(true);
    //create txt fields
    CDBTextField txtCellID = new CDBTextField(15,10);
    //create buttons
    JButton btnOK = new JButton("OK");
    btnOK.setActionCommand("ok");
    btnOK.addActionListener(this);
    JButton btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("cancel");
    btnCancel.addActionListener(this);
    //Layout the labels in a panel
    JPanel labelPane = new JPanel();
    labelPane.setLayout(new GridLayout(0, 1));
    labelPane.add(new JLabel("Cell ID:"));
    //Layout the text fields in a panel
    JPanel fieldPane = new JPanel();
    fieldPane.setLayout(new GridLayout(0, 1));
    fieldPane.add(txtCellID);
    //Layout the buttons in a panel
    JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new GridLayout(0, 2));
    buttonPane.add(btnCancel);
    buttonPane.add(btnOK);
    //Put the panels in another panel, labels on left,
    //text fields on right
    JPanel contentPane = new JPanel();
    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    contentPane.setLayout(new BorderLayout(10,10));
    contentPane.add(labelPane, BorderLayout.CENTER);
    contentPane.add(fieldPane, BorderLayout.EAST);
    contentPane.add(buttonPane, BorderLayout.SOUTH);
    newDialog.setContentPane(contentPane);
    newDialog.pack();
    newDialog.show();
    Here is the compiler message
    CDBTest.java:152: non-static variable this cannot be referenced from a static co
    ntext
    btnOK.addActionListener(this);
    ^
    CDBTest.java:155: non-static variable this cannot be referenced from a static co
    ntext
    btnCancel.addActionListener(this);
    ^
    2 errors
    I guess I don't really understand how to use static and
    when not to use static, and how to use "this"
    But I know I need to use "this" for the actionlisteners
    on my buttons.
    THanks
    Josh

    Thank you , Thank you, Thank you!
    Here is my entire main class, and then below it I'll
    paste the class that is calling my function.
    import java.io.*;
    import java.util.StringTokenizer;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class CDBTest extends JFrame implements ActionListener {
            public static CellList cellList = new CellList();
            public static Tabs cdbTabs = new Tabs();
            public static ArrayList cellArrayList = new ArrayList();
            public static int internalCellId = 0;    
            public CDBTest() {
                    JMenuBar mainMenuBar = new JMenuBar();
                    JMenu mainMenu;
                    JMenuItem mainMenuItem;
                    JPanel mainPanel = new JPanel();
                    //Attach Menu Bar
                    setJMenuBar(mainMenuBar);
                    //Build the first menu.
                    mainMenu = new JMenu("File");
                    mainMenu.setMnemonic(KeyEvent.VK_F);
                    mainMenuBar.add(mainMenu);
                    //JMenuItems
                    mainMenuItem = new JMenuItem("New",KeyEvent.VK_N);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenuItem = new JMenuItem("Open",KeyEvent.VK_O);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenu.addSeparator();
                    mainMenuItem = new JMenuItem("Save",KeyEvent.VK_S);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenuItem = new JMenuItem("Save As",KeyEvent.VK_A);
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    mainMenu.addSeparator();
                    mainMenuItem = new JMenuItem("Exit",KeyEvent.VK_E);
                    mainMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.ALT_MASK));
                    mainMenuItem.addActionListener(this);
                    mainMenu.add(mainMenuItem);
                    //define main content panel
                    mainPanel.setPreferredSize(new Dimension(600, 350));
                    //Turn border off for now 3/19/02
                    //mainPanel.setBorder(BorderFactory.createLineBorder(Color.black));
                    setResizable(false);
                    setTitle("Cell Site Database Editor");
                    //define and add components
                    mainPanel.add(cellList);
                    mainPanel.add(cdbTabs);
                    setContentPane(mainPanel);
            public void actionPerformed(ActionEvent e) {
                    JMenuItem source = (JMenuItem)(e.getSource());
                    if (source.getText() == "Open") {
                            // "." represents current dir, NOT APP-DIR,
                            // AND worse, the "Up" feature in filechooser now broken
                            // DAMNIT!
                            //final JFileChooser fc = new JFileChooser(".");
                            final JFileChooser fc = new JFileChooser();
                            fc.addChoosableFileFilter(new CDBFileFilter());
                            int returnVal = fc.showOpenDialog(this);
                            if (returnVal == JFileChooser.APPROVE_OPTION) {
                                    File file = fc.getSelectedFile();
                                    //this is where a real application would open the file.
                                    //JOptionPane.showMessageDialog(this, "Opening " + file.getName());
                                    try {
                                            // Clear out any existing entries
                                            if (cellList.isFilled()) {
                                                    cellArrayList.clear();
                                                    cellList.removeAllFromJList();
                                                    internalCellId = 0;
                                            FileReader cdbReader = new FileReader(file);
                                            BufferedReader br = new BufferedReader(cdbReader);
                                            //JComboBox cellList = new JComboBox();
                                            //cellList.addActionListener(this);
                                            String line;
                                            while((line = br.readLine()) != null){
                                                    // Looping through each line
                                                    cellArrayList.add(internalCellId, Split(line,",")); //Add array with an index
                                                    String[] arCells = (String[]) cellArrayList.get(internalCellId); //Extract array object and cast as a String Array
                                                    cellList.AddCell(arCells[0] + " " + arCells[1]);
                                                    //cellList.addItem(arCells[0] + " " + arCells[1]);
                                                    internalCellId++;
                                            cellList.list.setSelectedIndex(0);
                                    } catch (FileNotFoundException fnf) {
                                            System.err.println("Unable to open file for reading: " + fnf.getMessage());
                                    } catch (IOException ioe) {
                                            System.err.println("unable to buffer read file: " + ioe.getMessage());
                            } else {
                                    JOptionPane.showMessageDialog(this, "Cancelled ");
                    } else if (source.getText() == "Exit") {
                            System.exit(0);
                    } else {
                            String s = "Action event detected.\n"
                               + "    Event source: " + source.getText()
                               + " (an instance of " + getClassName(source) + ")";
                            JOptionPane.showMessageDialog(this, s);
            public static String[ ] Split(String str2Split, String separator) {
                    StringTokenizer parser = new StringTokenizer(str2Split, separator);
                    int numTokens=parser.countTokens( );
                    String[ ] arString = new String[numTokens];
                    for (int i=0; i < numTokens; i++) {
                            arString[i] = parser.nextToken( );
                    return arString;
            public void createNewCell() {
                    JDialog newDialog = new JDialog();
                    newDialog.setTitle("New Cell Site");
                    newDialog.setResizable(false);
                    newDialog.setModal(true);
                    //create txt fields
                    CDBTextField txtCellID = new CDBTextField(15,10);
                    CDBTextField txtCellName = new CDBTextField(15,20);
                    CDBTextField txtSwitch = new CDBTextField(15,10);
                    CDBTextField txtSectorID = new CDBTextField(1,1);
                    CDBTextField txtSectorName = new CDBTextField(15,12);
                    //create buttons
                    JButton btnOK = new JButton("OK");
                    btnOK.setActionCommand("ok");
                    btnOK.addActionListener(this);
                    JButton btnCancel = new JButton("Cancel");
                    btnCancel.setActionCommand("cancel");
                    btnCancel.addActionListener(this);
                    //Layout the labels in a panel
                    JPanel labelPane = new JPanel();
                    labelPane.setLayout(new GridLayout(0, 1));
                    labelPane.add(new JLabel("Cell ID:"));
                    labelPane.add(new JLabel("Cell Name:"));
                    labelPane.add(new JLabel("Switch:"));
                    labelPane.add(new JLabel("Sector ID:"));
                    labelPane.add(new JLabel("Sector Name:"));
                    //Layout the text fields in a panel
                    JPanel fieldPane = new JPanel();
                    fieldPane.setLayout(new GridLayout(0, 1));
                    fieldPane.add(txtCellID);
                    fieldPane.add(txtCellName);
                    fieldPane.add(txtSwitch);
                    fieldPane.add(txtSectorID);
                    fieldPane.add(txtSectorName);
                    //Layout the buttons in a panel
                    JPanel buttonPane = new JPanel();
                    buttonPane.setLayout(new GridLayout(0, 2));
                    buttonPane.add(btnCancel);
                    buttonPane.add(btnOK);
                    //Put the panels in another panel, labels on left,
                    //text fields on right
                    JPanel contentPane = new JPanel();
                    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
                    contentPane.setLayout(new BorderLayout(10,10));
                    contentPane.add(labelPane, BorderLayout.CENTER);
                    contentPane.add(fieldPane, BorderLayout.EAST);
                    contentPane.add(buttonPane, BorderLayout.SOUTH);
                    newDialog.setContentPane(contentPane);
                    newDialog.pack();
                    newDialog.show();      
            // Returns just the class name -- no package info.
            protected String getClassName(Object o) {
                    String classString = o.getClass().getName();
                    int dotIndex = classString.lastIndexOf(".");
                    return classString.substring(dotIndex+1);
            public static void main(String args[]) {
                    final CDBTest CDBApp = new CDBTest();
                    CDBApp.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            System.exit(0);
                    CDBApp.pack();
                    CDBApp.show();
    I'm new to Java and trying tio pick it up as I code
    so please give me any recommendations you have
    some things I don't really understand.
    And here is the code of my class that calls the function
    in my main class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ActionButtons extends JPanel implements ActionListener {
            protected JButton btnNew, btnCopy, btnDelete;
            private int btnWidth = 35;
            private int btnHeight = 34;
            public ActionButtons() {
                    ImageIcon icoBtnNew = new ImageIcon("images/new.gif");
                    ImageIcon icoBtnCopy = new ImageIcon("images/copy.gif");
                    ImageIcon icoBtnDelete = new ImageIcon("images/delete.gif");
                    btnNew = new JButton(icoBtnNew);
                    btnNew.setPreferredSize(new Dimension(btnWidth,btnHeight));
                    btnNew.setToolTipText("Create a new cell site.");
                    btnNew.setActionCommand("new");
                    btnNew.addActionListener(this);
                    add(btnNew);
                    btnCopy = new JButton(icoBtnCopy);
                    btnCopy.setPreferredSize(new Dimension(btnWidth,btnHeight));
                    btnCopy.setToolTipText("Copy selected cell site.");
                    btnCopy.setActionCommand("copy");
                    btnCopy.addActionListener(this);
                    add(btnCopy);
                    btnDelete = new JButton(icoBtnDelete);
                    btnDelete.setPreferredSize(new Dimension(btnWidth,btnHeight));
                    btnDelete.setToolTipText("Delete selected cell site.");
                    btnDelete.setActionCommand("delete");
                    btnDelete.addActionListener(this);
                    add(btnDelete);
           public void actionPerformed(ActionEvent e) {
                    if (e.getActionCommand() == "new") {
                            //switch tabs to general tab
                            CDBTest.createNewCell();
    Thanks
    Josh

  • Length of a string without using any built-in functions

    code that returns the length of a string without using any built-in functions.
    thanks
    Sam

    A string is internally represented by a character array.  An array of characters will reside on the stack, not the heap.  Yes, we always learned that String is a reference type, but what goes on in your memory might still surprise you...
    A struct is internally represented by only it's private properties, sequentially on the stack.
    So basically, what I thought is happening by messing with the structlayout: is only tricking our programming a bit into thinking that the top X bytes on the stack represent a chararray, while actually we put them there as a string.
    Wrong. True. And wrong.
    A string is internally represented by, in that order, an array length, a string length, the chars. None of them resides on the stack.
    An array is internally represented by, in that order, an array length and the chars. None of them resides on the stack.
    When you use the FieldOffset attribute to handle the string as a char array, you don't get anything right:
    - the Length returned is the "array length" of the string, which is equal to the string length + 1.
    - the chars returned by the array indexer are shifted by 2 chars (the length of the "string length" field).
    You can use the FieldOffset to make that work, but it needs a little bit more work.
    unsafe static int Test()
    string myString = "This string may contain many string inside this string";
    string testString = "string";
    int countResult = 0;
    fixed (char* myChars = new StringToChar { str = myString }.chr, testChar = new StringToChar { str = testString }.chr)
    // The 2 first chars of the array are actually the string length.
    int myCharsLength = myChars[1] << 16 | myChars[0];
    int testCharLength = testChar[1] << 16 | testChar[0];
    for (int i = 0; i < myCharsLength - testCharLength + 1; i++)
    if (myChars[i + 2] == testChar[2])
    for (int j = 1; j < testCharLength; j++)
    var c = testChar[7];
    if (myChars[i + 2 + j] != testChar[j + 2])
    goto endOfCharAnalyses;
    countResult++;
    endOfCharAnalyses:
    continue;
    return countResult;

  • Why do I keep getting Error 519: Server interface error" - Server interface error "no component returned from creativewidget' Line: 479 - var test = parent.add('statictext', undefined, text)  when I try to use pattern fill/scripted patterns.  I have unin

    Why do I keep getting Error 519: Server interface error" - Server interface error "no component returned from creativewidget' Line: 479 -> var test = parent.add('statictext', undefined, text)  when I try to use pattern fill/scripted patterns.  I have uninstalled and re-installed PS CC.  I have opened holding down shift to disable third party plug-ins.  I have moved 3rd party plugins to a temp location outside of ps and it still doesn't help.  It worked once, and only once and now won't work at all.

    Unless your Photoshop question has to do with a download/install error, you should ask in Photoshop General Discussion
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • How to use Logical database in function module?

    I will create a function module in HR.
    but how to use Logical database  in function module ?  Logical database PNP always show screen.in function (RFC) code , it is a matter.

    You cannot attach the LDB to the main program of the function group.
    - So you may [SUBMIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=submit&adv=false&sortby=cm_rnd_rankvalue] a report which use the LDB and get back the data (export/import), by default in the syntax of SUBMIT the selection-screen will not be displayed
    - Use [LDB_PROCESS|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=ldb_process&cat=sdn_all], fill a structured table for selection, and get data back in another table
    - Use [HR function modules to read Infotypes|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=hrfunctionmodulestoread+Infotypes&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? Difference between Enterprise and SE?

    We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
    We have also reproduced the issue on the following stacks:
    Oracle SE One 11.2.0.3 (with Spatial enabled)
    Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
    Microsoft Windows Server 2003R2 Standard x64 Edition
    However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
    Any help or advice would be much appreciated.
    Kindest Regards,
    Kevin

    In my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
    BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late.

  • If we use DML statement in function then that function can be used inside s

    if we use DML statement in function then that function can be used inside select query or any DML query?

    select f from t2;I think you meant to query t1.
    It works if the function is an autonomous transaction:
    create or replace function f return number
    is
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
        update t1 set c=2;
        commit;
        return 1;
    end;
    select f from t1But as Billy said why would you want to do DML this way. And this is not the way autonomous procedures should be used either.
    An an answer to an interview question though nothing wrong with it.

  • Use of Procedure and Functions in ADF BC

    Hi,
    In ADF 11g
    1. can I use oracle function and procedures ( having in and OUT parameters) to expose as service interface
    2. if yes , How can this be done. and what are the allowed data types as input to procedure/function and can be returned by procedure/function
    3. How the transaction control will be achieved using ADF BC service interface.
    E.g. one ADF BC creates orders in order details and second creates Order lines in Order lines table. Now if order is created successfully but line creation fails then I want order to be rolled back also.
    Thanks.

    google it out.
    How to get two out param which is used in Procedure
    http://sameh-nassar.blogspot.in/2010/01/create-plsql-function-and-call-it-from.html
    http://adf-tools.blogspot.in/2010/09/adf-function-call-from-el-statement-in.html
    http://adf-tools.blogspot.in/2010/03/adf-plsql-procedure-or-function-call.html
    http://adfhowto.blogspot.in/2010/11/call-db-procedure-or-function-from-adf.html
    Re: use of Procedure and Functions in ADF BC

  • How To use the going back function in Safari (multitouch)? Going back on Websites ist only possible using the arrow Key on the left corner but not by using the sweep function like it is possible in macOS.

    How can i use the going back function in Safari like it is possible in MacOS? On the Mac i can chance back to previous Websites by sweeping with two Fingers. Unfortuntely is this Not possible on the ipad. I tried with one and to fingers but it doesn't work.
    The multitouch function is switched on but still Not working. What is wrong? Thx for help.

    To go back a web page in Safari touch the screen with one finger at the extreme left and swipe to the right.
    To go forward a web page in Safari touch the screen with one finger at the extreme right and swipe to the left.

Maybe you are looking for

  • MacBook Pro early2011, running slow and safari crashing

    Hi - I am a newer MAC user, and not a technical pro, but have tried several things from the community suggestions to correct a problem with system slowness and safari crashing when trying to open.  I am out of options that I comfortable with, and so

  • Changing the name of the podcast

    Hello Our podcast has been recently approved for itunes, which makes us very happy however, we have noticed that the name of the podcast had an error. Instead of "JustQualityMusic Podcast" we have "JustQuality Music Podcast" We have already updated t

  • Upload of source list data

    Do we have any BAPI for uploading the source list? Can we upload source list via LSMW and BDC? I am pretty new to upload/ migration, pl advice.

  • Oracle BAM Application Policies in EM missing

    Hello, I am trying to assign users and/or groups to the pre-seeded Oracle BAM application policies (section 26.3.2 and 26.3.3 of below support document). The way I get there is to navigate in the EM: BAM/OracleBamServer(right-click)/Security/Applicat

  • Menu bar lags in appearing after I boot up my cpu (brand new macbook pro retina display 13"

    I just bought a new cpu and i noticed that after i boot it up after shut down i will not see the top menu bar load until i force click the top of the screen where is should be. What can cause this issue?