Create Tree from Preordered data

Here is a quick summary of what I'm trying to do:
I have a file with formatted like this
Does it have legs?
Dog
Fish
and the resulting tree for it should look like this
     Does it have legs?
     Dog        Fishand I'm trying to write a function that takes in a Scanner object that should already be tied to the data file and create a tree from this data that is already listed in Preorder fashion. I know tha recurison is probably the best way to go about this but everything that I have written hasn't worked. Also, I cant really figure out a way to use recursion when the function is taking in a Scanner I dont know how it would work.
Any help would be greatly appreciated.
Here is what I have now:
     public BinaryTree<String> readTree(Scanner data)
          BinaryTree<String> temp = new BinaryTree<String>();
          temp.attachLeft(data.next());
          temp.attachRight(data.next());
          return temp;
     }I know this function wont go through the whoel file, but I've tried many loops but I cant figure out how to get it to work so I'm convinced that I need to figure out how to make it recursive
(yes I know that everything that can be done through recursion can be done with a loop)

@OP:
Here's how you could do it:
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.Stack;
class Main {  
    public static void main(String[] args) throws FileNotFoundException {
        Scanner file = new Scanner(new File("data.txt"));
        BinTree tree = new BinTree(file);
        System.out.println(tree);
class BinTree  {
    private BinNode root;
    public BinTree(Scanner file) {
        // create the root (first line in the file)
        root = new BinNode(file.nextLine());
        // create a stack
        Stack<BinNode> stack = new Stack<BinNode>();
        // push the root on the stack: we need it to add nodes to the left and right of it
        stack.push(root);
        // call the insert method to build the tree
        insert(stack, file);
    private void insert(Stack<BinNode> stack, Scanner file) {
        IF 'file' has no more lines left
            stop this method
        END IF
        BinNode 'next' <- the next line in 'file'
        IF the left node of the last node on the 'stack' equals null
            the left child of last node of the stack <- 'next' (but leave the stack in tact)
        ESLE
            the right child of last node of the stack <- 'next' (remove the last node of the stack)
        END IF
        IF 'next' is a question
            push 'next' on the stack
        END IF
        recursively call the insert(...) method here
class BinNode {
    String data;
    BinNode right, left;
    public BinNode(String data) { this.data = data; }
    public String toString() { return this.data; }
}

Similar Messages

  • Creating XML from raw data

    I am trying to create xml from raw data. It works well in the format builder but
    when I instanciate the MFLObject and run convert to xml, the output only contains
    wrappers for my first field described in the mfl. Are there any known issues
    using this progmattic conversion to XML.
    My mfl is the following:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE MessageFormat SYSTEM 'mfl.dtd'>
    <!-- Enter description of the message format here. -->
    <MessageFormat name='BossRecord' version='2.01'>
    <FieldFormat name='Header' type='String' length='102' codepage='windows-1252'/>
    <StructFormat name='TransactionControlRecord' delim='999'>
    <FieldFormat name='TransactionTypeNumber' type='String' length='3' codepage='windows-1252'/>
    <FieldFormat name='TransactionData' type='String' codepage='windows-1252'>
    <LenField type='Numeric' length='4'/>
    </FieldFormat>
    </StructFormat>
    <StructFormat name='Generic' repeat='*'>
    <FieldFormat name='GenericTypeNumber' type='String' length='3' codepage='windows-1252'/>
    <FieldFormat name='GenericData' type='String' codepage='windows-1252'>
    <LenField type='Numeric' length='4'/>
    </FieldFormat>
    </StructFormat>
    <FieldFormat name='IgnoreTheRest' type='Filler' optional='y' length='1' repeat='*'>
    <!--
    This field is useful for testing partially constructed formats. Adding
    this field to the
    end of a format will cause any leftover bytes on the end of a binary file to be
    ignored when the data is converted to XML.
    -->
    </FieldFormat>
    </MessageFormat>
    Are there any issues with this that are easy to spot?
    Here is some sample output:
    _BossRecordDoc : <BossRecord>
    <Header>0601uskyloupw7vu0 IBVRTR 000006RSQ1010246000000000000020436000001-01-01-00.00.00.00000000000100170</Header>
    <Header>90100581D4EBC00AA3C18629ACA0004AC02E54BD289357023141961111F1111 99900207141D4EBC00AA3C18629ACA0004AC0</Header>
    <Header>2E54BD2893570231RIBBONS & BUTTONS 9 00000000000010.50CAD00000000000000.5</Header>
    <Header>0USD00000000000000.00USD00000000000077.00CAD 0CAUS00000000000000.91KGSA215D100CF3C18619AC</Header>
    <Header>90004AC02E54B 01 0001-0</Header>
    <Header>1-012003-04-072003-06-2501P/P03003984196000010100000000000000.00CAD 00
    FR00000000000000</Header>
    <Header>.0000000000000000000.00KGS00000000000000.00USD 00UPS T1</Header>
    <Header>0001-01-010001-01-01 0 000000000000000.00000000000000000.00USD0</Header>
    <Header>000000000000000.00 1 22222222222220 0100304061DC30500AA3C18629ACA</Header>
    <Header>0004AC02E54B1D4EBC00AA3C18629ACA0004AC02E54B</Header>
    <Header> 0010001-01-01 00000000000000.00USD00</Header>
    <Header>000000000000.00CAD00000000000010.00CAD</Header>
    <Header> 00000000000010.00CAD000000000000000010001-01-01K00404862A8D2C00AA3C186</Header>
    <Header>29ACA0004AC02E54B1DC30500AA3C18629ACA0004AC02E54B001 PURPLE RIBBONS</Header>
    It just keeps finding my first record instead of finding the remaing structure.
    I appreciate any help.
    Thanks,
    Michael

    Okay, I've got some coding off a site that looks like it will do what I want. It's quite a robust applications which will do more than I need but as long as it does at least what I want, i could care less. As it will extract files from the datastream for me, it is going to save them to disk.
    I believe I have to specify a directory to save it to. I believe this is the line I'm going to modify, so assuming that's the case, how do I specify a directory here:
    private File fileOutPutDirectory = null;
    Do I have to use absolute paths or can I use relative. Also, what directory construct is expected by java? Anyone with an example of what urls are supposed to look like in this case?
    Thanks,
    destin

  • Create Report from HFM Data Grid

    Hi All,
    I need to create a report out of the Data Grid created in HFM and then publish that as a PDF. I found the Reporting feature in Manage Documents that uses system reports.
    And if I want a report from a data grid the Data Explorer option has to be selected for Report Type.But in this case I guess I need to create a Report Definition File and then upload it which seems to be complex.
    But am not able to figure out how I can directly take a HFM Data Grid as the source and generate a PDF Report out of it.
    Can this be done using BI Publisher? If so can anyone please provide the steps?
    Or, can it be done using the Financial Reporting Studio ?
    I sincerely appreciate any help!
    Thanks in advance!
    Chella

    select
    decode( abs((sysdate - end_time)-1), (sysdate - end_time)-1, 'TOO LONG AGO', '-' ) "Check" ,
    b.database_name , t.type_qualifier1 , b.host ,
    to_char(b.end_time, 'YYYYMMDD-HH24:MI:SS') , b.time_taken_display , b.output_bytes_display
    from mgmt$ha_backup b, mgmt$target t
    where b.target_guid = t.target_guid
    order by type_qualifier1, end_time;

  • Create Spool From OTF Data

    Hi all,
    Is there any way of creating a spool request or printing OTF data directly from an internal table.
    Scenario is that I have read a spool request with multiple pages into OTF format and now have an internal table with OTF data. I have then split the spool data at page level into another internal table.
    This table also contains OTF data . Is there anyway of printing this internal table directly to printer. If not is there any way of creating a spool request from this internal table?
    Regards,
    Preet

    May be i can help to some extent. I will just tell you how to convert a internal table into spool. I have done the coding
    REPORT  zpmm_pdf                                .
    TYPES : BEGIN OF itab,
            name(20) TYPE c,
            age TYPE i,
            *** TYPE c,
            END OF itab.
    DATA : gt_itab TYPE STANDARD TABLE OF itab,
           gw_itab TYPE itab.
    DATA : counter  TYPE i.
    ********************Data declaration for use in converting to pdf
    DATA : pripar LIKE pri_params.
    DATA : lw_space VALUE ''.
    DATA : itab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    <b>*To get spool info</b>
    DATA : rqident LIKE tsp01-rqident ,
           rqcretime LIKE tsp01-rqcretime .
    <b>DATA: spool_id LIKE tsp01-rqident.</b>
    DATA : numbytes TYPE i,
           cancel.
    DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\swet.pdf'.
    ********************END of Data declaration for use in converting to pdf
                           START-OF-SELECTION
    DO 20 TIMES.
      gw_itab-name = 'swetabh_shukla'.
      gw_itab-age = counter + 1.
      gw_itab-***  = 'M'.
      counter = counter + 1.
      APPEND gw_itab TO gt_itab.
      CLEAR : gw_itab.
    ENDDO.
    <b>* Gt_itab is the internal table that we will write to spool</b>
    *Start
    SET PARAMETER ID 'ZPDF' FIELD lw_space.
    <b>CALL FUNCTION 'GET_PRINT_PARAMETERS'</b>
      EXPORTING
        in_parameters          = pripar
        line_size              = 255
        layout                 = 'X_65_132'
        no_dialog              = 'X'
      IMPORTING
        out_parameters         = pripar
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    <b>*********To write data in spool</b>
    NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG .
    RESERVE 5 LINES.
    <b>*********From here data will be written in spool</b>
    WRITE : 'Name',
            'Age',
    LOOP AT gt_itab INTO gw_itab.
      WRITE : / gw_itab-name,
                gw_itab-age,
                gw_itab-***.
    ENDLOOP.
    <b>*****To switch off spool writing</b>
    NEW-PAGE PRINT OFF.
    ************End of spool writing
    <b>******To get the latest spool id of spool written by us</b>
    SELECT  rqident  rqcretime FROM tsp01
                 INTO (rqident,rqcretime)
                 WHERE rqowner = sy-uname
                 ORDER BY rqcretime DESCENDING.
      EXIT.
    <b>********  It will just read the latest spool id and exit</b>
    ENDSELECT.
    MOVE  rqident TO spool_id. <b>" We get the spool id here of the spool we wrote</b>
    <b>*Now  spool_id contains the spool id. We can convert this spool to pdf also as given *below</b>
    ****************************************************To convert spool to pdf
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
             src_spoolid = spool_id
          NO_DIALOG =
          DST_DEVICE =
          PDF_DESTINATION =
          IMPORTING
             pdf_bytecount = numbytes
          PDF_SPOOLID =
          LIST_PAGECOUNT =
          BTC_JOBNAME =
          BTC_JOBCOUNT =
           TABLES
             pdf = itab_pdf
          EXCEPTIONS
            err_no_abap_spooljob = 1
            err_no_spooljob = 2
            err_no_permission = 3
            err_conv_not_possible = 4
            err_bad_destdevice = 5
            user_cancelled = 6
            err_spoolerror = 7
            err_temseerror = 8
            err_btcjob_open_failed = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed = 11
            OTHERS = 12.
                           END-OF-SELECTION
    To download the pdf file as local file
    CALL FUNCTION 'DOWNLOAD'
               EXPORTING
                    bin_filesize     = numbytes
                    filename         = gv_filename
                    filetype         = 'BIN'
                    filetype_no_show = 'X'
               IMPORTING
                    act_filename     = gv_filename
                    filesize         = numbytes
                    cancel           = cancel
               TABLES
                    data_tab         = itab_pdf.
    <b> I think i gave a lot of extra code, but i just gave it for proper understanding.
    Only a few days ago i came across this concept. So had the ready made code.</b>
    <b>Please do reward point if helpful</b>
    Regards
    swetabh

  • Creating tree from HTTPService

    Hi, I'm new under flex builder and I have a simple (?)
    problem :
    I would like to generate a tree from a XML file generate by
    PHP. I can display items (source) in tree but not subitems
    (playlist)...
    Here my XML file generated by PHP :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <sourcelist>
    <source id="3" nom="WarholinDaMix">
    <playlist id="0" nom="Tous les
    fichiers"></playlist>
    </source>
    <source id="2" nom="YoyesGirl">
    <playlist id="0" nom="Tous les
    fichiers"></playlist>
    <playlist id="2" nom="Yo la liste
    Girly"></playlist>
    </source>
    <source id="1" nom="Yoyesman">
    <playlist id="0" nom="Tous les
    fichiers"></playlist>
    <playlist id="1" nom="Yo ma liste 1"></playlist>
    <playlist id="3" nom="Yo ma liste 2"></playlist>
    </source>
    </sourcelist>
    Here the code I use :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="GetSource.send(null);">
    <mx:HTTPService id="GetSource" url="
    http://127.0.0.1/SchmittTunes/bin/music.php?gettype=source"
    useProxy="false"/>
    <mx:Panel layout="absolute" left="10" right="10">
    <mx:Tree labelField="nom"
    dataProvider="{GetSource.lastResult.sourcelist.source}"
    width="100%" x="0" height="100%" y="0"
    showRoot="false"></mx:Tree>
    </mx:Panel>
    </mx:Application>
    How I said, I have 3 items displaying the 'source' on my
    tree, but I can't expand them. There is no arrow on the left side.
    So subitems like 'playlist' are not display.
    Does anyone know why or have an idea ?
    Thanks for your help
    Mika

    Thanks ! it's working with resultFormat="e4x" tag in my
    HTTPService, but with some adaptations :
    I change the following :
    <mx:Tree labelField="nom"
    dataProvider="{GetSource.lastResult.sourcelist.source}"
    width="100%" x="0" height="100%" y="0"
    showRoot="false"></mx:Tree>
    By :
    <mx:Tree labelField="@nom"
    dataProvider="{GetSource.lastResult}" width="100%" x="0"
    height="100%" y="0" showRoot="false"></mx:Tree>
    Changes are about labelfield and dataprovider.
    Thanks for your help !

  • Having difficulty creating pdf from XML data source

    I have a 'rpt' file built with a classic install of Crystal 10, using xml as a data source. I have tried using both ADO.NET(XML) connection and ODBC CR ODBCXML Driver 4.20.
    The rpt file was built on Windows2000 NT platform. The report runs, and displays data from the sample xml file in the preview tab.
    I am attempting to feed xml data into the rpt file with the intent to create pdf formatted output. I am using java with the Crystaldecisions packages. I am running this app out of an Apache server on an Ubuntu VM Hardy Heron release. This does not have any version of Crystal Reports installed on it.
    I have followed the examples and I am comfortable that I have the correct package imports, I am able to open the rpt file, and convert both the xml and xsd to byte arrays. When I issue the command
    reportClientDocument.getDatabaseController().setDataSource(xmlDataSet, '', '')
    I get the response
    Cannot find corresponding table information in the XML file
    Set data source failed: The table 'criminal_case' could not be found.
    Request failed and JRC Command failed to be undone
    JRCAgent1 detected an exception: The table 'criminal_case' could not be found.
    at com.crystaldecisions.reports.reportdefinition.datainterface.g.a(Unknown Source)
    The xsd does validate the xml which contains a noNamespaceSchemaLocation pointer to the xsd.
    The xml is the same data that was used to design the report on the NT box. This means that I see the same elements being byte streamed as were used to create the rpt file.
    Is this as simple as I am running my webserver on Linux? I do see the connection attribute properties reference a Database DLL that is clearly windows based. What can I do?

    So why develop a report if there is no data? I can only think that you have a bunch of static text, maybe an instruction page you want to publish? If so, you still need a data source, it can be a dummy source
    <?xml version="1.0"?>
    <ROOT/>
    ie no data per se. BIP needs a source even if there is not data to merge.
    Cheers
    Tim

  • Create table from external data with dates

    I have a CSV that looks somewhat like this:
    abcuser,12345,5/12/2012,5,250.55
    xyzuser,67890,5/1/2012,1,50
    ghjuser,52523,1/1/1900,0,0
    When I create the external table, then query it I get a date error:
    CREATE TABLE xtern_ipay
    userid VARCHAR2(50),
    acctnbr NUMBER(20, 0),
    datelastused DATE,
    number_rtxns NUMBER(12, 0),
    amtused NUMBER(12, 0)
    organization external ( TYPE oracle_loader DEFAULT directory "XTERN_DATA_DIR"
    ACCESS parameters (
    records delimited BY newline fields terminated BY "," )
    location ('SubscriberStatistics.csv') ) reject limit UNLIMITED;
    Error I see in the reject log:
    Field Definitions for table XTERN_IPAY
    Record format DELIMITED BY NEWLINE
    Data in file has same endianness as the platform
    Rows with all null fields are accepted
    Fields in Data Source:
    USERID CHAR (255)
    Terminated by ","
    Trim whitespace same as SQL Loader
    ACCTNBR CHAR (255)
    Terminated by ","
    Trim whitespace same as SQL Loader
    DATELASTUSED CHAR (255)
    Terminated by ","
    Trim whitespace same as SQL Loader
    NUMBER_RTXNS CHAR (255)
    Terminated by ","
    Trim whitespace same as SQL Loader
    AMTUSED CHAR (255)
    Terminated by ","
    Trim whitespace same as SQL Loader
    error processing column DATELASTUSED in row 1 for datafile g:\externaltables\SubscriberStatistics.csv
    ORA-01858: a non-numeric character was found where a numeric was expected
    error processing column DATELASTUSED in row 2 for datafile g:\externaltables\SubscriberStatistics.csv
    ORA-01858: a non-numeric character was found where a numeric was expected
    error processing column DATELASTUSED in row 3 for datafile g:\externaltables\SubscriberStatistics.csv
    ORA-01858: a non-numeric character was found where a numeric was expected
    Any ideas on this? I know I need to tell oracle the format of the date on the external file, but I can't figure it out.

    Try this:
    CREATE TABLE xtern_ipay
       userid         VARCHAR2 (50)
    , acctnbr        NUMBER (20, 0)
    , datelastused   DATE
    , number_rtxns   NUMBER (12, 0)
    , amtused        NUMBER (12, 2)
    ORGANIZATION EXTERNAL
        ( TYPE oracle_loader DEFAULT DIRECTORY "XTERN_DATA_DIR"
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE FIELDS TERMINATED BY "," MISSING FIELD VALUES ARE NULL
    (   userid
      , acctnbr
      , datelastused DATE 'mm/dd/yyyy'
      , number_rtxns
      , amtused)
    location ('SubscriberStatistics.csv') ) reject LIMIT unlimited;
    select * from xtern_ipay;
    USERID                                                ACCTNBR DATELASTU NUMBER_RTXNS    AMTUSED
    abcuser                                                 12345 12-MAY-12            5     250.55
    xyzuser                                                 67890 01-MAY-12            1         50
    ghjuser                                                 52523 01-JAN-00            0          0
    {code}
    Sorry I had to correct the previous statement again for the date format and for the column amtused that was defined without decimals.
    Regards
    Al
    Edited by: Alberto Faenza on May 31, 2012 6:34 PM
    wrong date format mm/dd/yy instead of dd/mm/yy
    Edited by: Alberto Faenza on May 31, 2012 6:40 PM
    Fixed again the date format and the amtused defined with 2 decimals                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Unable to create Model from DOE Data Object

    Hi,
    I created a Mobile Laptop WebDynpro DC in NWDS 7.1, the build and deploy work fine.
    The problem is that when I attempt to create a Model based on a Data Object from the
    Mobile Middleware 7.1 DOE, I always get an exception when the Data Object metadata is
    imported (the last step of the Model Creation Wizard).
    Here's the exception :
    Status ERROR
    Plugin : com.sap.ide.cmi.core
    code=0
    Internal error
       Plugin name: Common Model Tools Core
       Internal error  : com.sap.ide.cmi.core
       Class      : com.sap.tc.mobile.dt.metaimp.ModelImportWizard
       Method     : run(IProgressMonitor)
       Message    : Failed to create model
       Exception  : com.sap.ide.metamodel.general.exception.ObjectRequiredException: ModelClassPropertySetting "//WebDynpro/ModelClass:ca.test.sandbox.mitest1.test3.ZTESTDATAOBJ/Property:ACTUAL/Setting:backendKey", Role "SettingDefinition": A minimum of 1 object(s) is required
    ObjectRequiredException: ModelClassPropertySetting "//WebDynpro/ModelClass:ca.test.sandbox.mitest1.test3.ZTESTDATAOBJ/Property:ACTUAL/Setting:backendKey", Role "SettingDefinition": A minimum of 1 object(s) is required
    at com.sap.ide.metamodel.webdynpro.implementation.ModelClassPropertySettingProxy._validate(ModelClassPropertySettingProxy.java:358)
    at com.sap.ide.metamodel.core.DevelopmentObjectProxy.validate(DevelopmentObjectProxy.java:825)
    at com.sap.tc.mobile.dt.metaimp.MBOModelImporter.doImport(MBOModelImporter.java:170)
    at com.sap.tc.mobile.dt.metaimp.ModelImportWizard.createModel(ModelImportWizard.java:200)
    at com.sap.ide.cmi.core.model.importer.CMIWizard$2.run(CMIWizard.java:197)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
    I know this is not related to Middleware authorization, I tested with a userid with full DOE authorization.
    When I display the Data Object metadata from the Middleware, it shows as status 'active'.
    The exception seems to complain about the backend key, but there is a backend key field in
    the Data Object.
    I have the same exception even with any SAP delivered Data Objects (MAM30_001, etc..).
    any thoughts on what the problem is ?
    thanks,
    Yanick.

    Hi Yannick,
    This type of error can occur with local non-dc Mobile App when some jars required for the model generation are missing.                                                         
    The easiest way to fix this is to create a DC for your Mobile app from the
    Mobile App Offline perspective. 
    Let me know if it works
    Genevieve

  • BPS: Create records from reference data in FOX

    As writed in "How to Loop over Reference Data in Fox Formulas", I create FOX Function with DO statements, but unfortunetely if I have no data yet in the subset my fox formulas can't be executed at all.
    It's write "0 data records were read, 0 of them were changed, 0 generated". Even if I put Break-point in fox formula, it doesn't take place. When I input somehow one or so "test" record, it works perfect, and creates new lines from reference as I want.
    How can I execute fox formula at list one time with empty subset?

    Hello,
    use a copy function to create one (dummy) record. Then call your FOX function (and delete the dummy record). You can combine them in a sequence.
    Also see SAP Note <a href="http://service.sap.com/sap/support/notes/646618">646618</a> for looping over reference data.
    Regards,
    Marc
    SAP Techology RIG

  • Creating childSymbol from JSON data

    Hi
    This is a bit tricky one, i think.
    I am trying to make a menu, from some JSON data. I want to make a function, that takes, in this case the id (this is not to be confused with Javascripd id. This is just the name in the JSON file) and creating a symbol. But i don't want it to repeat itself. Right now, it only says placeholder, in those places, it shouldn't create a symbol at all.
    http://torbenvf.dk/ledelsehelehistorien/test/index.html
    Heres the code from the ComposisionReady
    (function($, Edge, compId){
    var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
       //Edge symbol: 'stage'
       (function(symbolName) {
          Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
             $.getJSON('slides.json', function(data) {
                     for(var i=0; i<data.length; i++)
                var s = sym.createChildSymbol("slide", "Stage");
                                 if(i)
                                     { if(repeat != data[i].id)
                                         {s.$("title").html(data[i].id);}
                                 else
                                                         else{
                                     s.$("title").html(data[i].id);}
                                 repeat = data[i].id;
    Eventually, the whole thing is going to look something like this, just using dynamic data
    http://torbenvf.dk/ledelsehelehistorien/grafiskprototype1koma5.html
    Kind Regards

    1) So, the html() function is no longer available. See ==> Adobe Edge Animate CC JavaScript API
    2) I looked at your json file.
    Findings: Your json items have no html tags, therefore you can replace .html() by .text()
    Note: i will test your website with iOS8 (iPad) and Mac OS X (MacBook Pro).

  • Create Table from XML Data

    XML info: D:\XMLDATA\mytable.xml
    create directory XML_dir as 'D:\XMLDATA';
    <INFO>
    <Column_Name>Col1</Column_Name>
    <Data_Type>Char(1)</Data_Type>
    </INFO>
    <INFO>
    <Column_Name>Col2</Column_Name>
    <Data_Type>VARCHAR2(50)</Data_Type>
    </INFO>
    I need to create a table based on the XML data.
    Create Table mytable
    Col1 Char(1),
    Col2 Varchar2(50)
    How to read and execute the xml data to create a table.
    Thanks!    

    Something like this :
    SQL> declare
      2 
      3    v_xmlinfo      clob;
      4    v_ddl          varchar2(32767) := 'CREATE TABLE mytable ( #COLUMN_LIST# )';
      5    v_column_list  varchar2(4000);
      6 
      7  begin
      8 
      9    v_xmlinfo := dbms_xslprocessor.read2clob('TEST_DIR', 'info.xml');
    10 
    11    select column_list
    12    into v_column_list
    13    from xmltable(
    14           'string-join(
    15              for $i in /INFO
    16              return concat($i/Column_Name, " ", $i/Data_Type)
    17            , ", "
    18            )'
    19           passing xmlparse(content v_xmlinfo)
    20           columns column_list varchar2(4000) path '.'
    21         ) ;
    22 
    23 
    24    v_ddl := replace(v_ddl, '#COLUMN_LIST#', v_column_list);
    25    --dbms_output.put_line(v_ddl);
    26 
    27    execute immediate v_ddl;
    28 
    29  end;
    30  /
    PL/SQL procedure successfully completed
    SQL> select * from mytable;
    COL1 COL2

  • User Defined field in UDT - how to create select from existing data

    Hi
    I want to create User Defined Table for purpose of storing records of sales visits made to customers.
    I want to record detail for example: Date of Visit; Sales Employee; Activity number ref (which has attached PDF visit report); Related Opps)
    I am not sure exact detail as I have never created User Defined Table before so I am not sure how best to achieve my requirement.
    But I want one of the fields to be Business Partner code.
    My question is How should I set the BP field so that available options are existing Business Partner codes?
    I would like to set field so that if I enter for example:
    "CAQ"... and I click Tab key then SAP will bring list of BP Codes which begin with CAQ (eg. CAQU001; CAQF001 etc) for my selection.
    Is this possible?
    Regards,
    Karen

    hi.
    u can create a user defined table enter your values..by creating columns like..
    Customercode, customer name, vitst time, attachnment.
    but
    "CAQ"... and I click Tab key then SAP will bring list of BP Codes which begin with CAQ (eg. CAQU001; CAQF001 etc) for my selection.
    above one u can not do it..
    all the cutomer codes will come if u use coding........are u can filter as per ur requirement
    else
    if u say i  am not using the coding..
    u can get all the  business master codes... but u have to use fms  u have to put it..otherwise u can not do it...

  • Creating PDF from ERD (Data Modeler) in readable format

    I created an entity relationship diagram (ERD) using Toad Data Modeler.  I want to save/print it to PDF, which I can just fine.  However, it cuts off tables and is very hard to read.  I'm looking for a format to use that will not cut off the tables.  I've played around with various settings, but can't get it to look right.  Are there specific settings I should be targeting so it won't cut off the diagram?  Thank you!

    Thank you.  I've been playing around with the page size, but it still wants to cut off some of my tables, almost as if I can't get the diagram to size into the size of the PDF margins.  I can't seem to find the magic combination so I figured I must be missing a parameter setting somewhere.  Thank you for your time.
    Brian

  • Creating Report from Activity Data Collector

    Hi all,
    I have used  Activity Data Collector to get the potal user's activities. All informations are in text file only. I want to create formatted report. How can I achieve this?
    Help me in this regard.
    Thanks & Regards,
    Hemalatha J

    Hi Hema,
    You can try out the different options in this blog. It contains links to information and infosession by John Polus.
    Who's Doing What in my Portal? : Usage Analytics and the SAP Netweaver Portal - Part I
    regards,
    Shantanu

  • Problem creating  image from a data vector

    Hello i have a problem in this aplication.
    I get a image from a web cam. I want to put the original image in a file and the negative image in another file (in this example is not the negative image, is just a white image). The problem is when i use setData method. The image become black. If I use setFormat method the new image is the original image.
    Here is the code with problems:
    imageBuffer = frameGrabbingControl.grabFrame();
    theData = new int[dataLength];
    theData = (int[]) imageBuffer.getData();
    for (int y = 0; y < videoHeight - imageScanSkip; y+=imageScanSkip) {
    for (int x = 1; x < videoWidth - imageScanSkip; x+=imageScanSkip)
    theData[y*videoWidth+x]=Integer.parseInt("FFFFFF",16);
    Buffer b1=new Buffer(); //This is the new buffer in which i want to put the new pic
    b1.setData(theData);
    //here i create the 2 files frst from the original buffer and second from the new buffer b1
    Image img = (new BufferToImage((VideoFormat)imageBuffer.getFormat()).createImage(imageBuffer));
    Image img1 = (new BufferToImage((VideoFormat)b1.getFormat()).createImage(b1));
    BufferedImage buffImg = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
    BufferedImage buffImg1 = new BufferedImage(320,240, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = buffImg.createGraphics();
    Graphics2D g1 = buffImg1.createGraphics();
    g.drawImage(img, null, null);
    g1.drawImage(img1, null, null);
    try{
    ImageIO.write(buffImg, "jpg", new File("c:\\webcam.jpg"));
    ImageIO.write(buffImg1, "jpg", new File("c:\\webcam1.jpg"));
    catch (Exception e){}
    the webcam1.jpg file is black(it should be white).
    If i put "b1.setFormat(imageBuffer.getFormat());" the webcam1.jpg will be same the file as webcam.jpg

    Hello i have a problem in this aplication.
    I get a image from a web cam. I want to put the original image in a file and the negative image in another file (in this example is not the negative image, is just a white image). The problem is when i use setData method. The image become black. If I use setFormat method the new image is the original image.
    Here is the code with problems:
    imageBuffer = frameGrabbingControl.grabFrame();
    theData = new int[dataLength];
    theData = (int[]) imageBuffer.getData();
    for (int y = 0; y < videoHeight - imageScanSkip; y+=imageScanSkip) {
    for (int x = 1; x < videoWidth - imageScanSkip; x+=imageScanSkip)
    theData[y*videoWidth+x]=Integer.parseInt("FFFFFF",16);
    Buffer b1=new Buffer(); //This is the new buffer in which i want to put the new pic
    b1.setData(theData);
    //here i create the 2 files frst from the original buffer and second from the new buffer b1
    Image img = (new BufferToImage((VideoFormat)imageBuffer.getFormat()).createImage(imageBuffer));
    Image img1 = (new BufferToImage((VideoFormat)b1.getFormat()).createImage(b1));
    BufferedImage buffImg = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
    BufferedImage buffImg1 = new BufferedImage(320,240, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = buffImg.createGraphics();
    Graphics2D g1 = buffImg1.createGraphics();
    g.drawImage(img, null, null);
    g1.drawImage(img1, null, null);
    try{
    ImageIO.write(buffImg, "jpg", new File("c:\\webcam.jpg"));
    ImageIO.write(buffImg1, "jpg", new File("c:\\webcam1.jpg"));
    catch (Exception e){}
    the webcam1.jpg file is black(it should be white).
    If i put "b1.setFormat(imageBuffer.getFormat());" the webcam1.jpg will be same the file as webcam.jpg

Maybe you are looking for

  • Get event organizer in iCal

    WIth AppleScript, you can get the attendees of an event pretty easily -- it's listed in the dictionary. But, the list of attendees doesn't seem to contain the actual organizer of the event. Is there a way to get the organizer too?

  • Exchange rate difference in MIGO and MIRO

    Dear Experts, Our local currency is INR. We have created PO and MIGO on 31.03.2015 with exchange rate 62.5908 without tick on fixed exchange rate in PO. OB08  is  also same on 31.03.2015. But at the time of MIRO system showing error massage for confi

  • Private payphone: setting the rate - what is a 'un...

    Hi there, I want to use a private payphone (Solitaire 2000) on a residential BT line, and need to set the 'unit rate' for national calls, and another rate for international calls (unless I barr these). In the past BT published its tarrif in terms of

  • How to install Tiger on iBook G4

    I have been given an iBook G4 and would like to upgrade it to Tiger 10.4 using my generic Tiger 10.4 upgrade disk. iBook will not start up from the Tiger disk even holding "C" key down. Also, restarting as a Target disk holding down "T" key, icon doe

  • Can I bulk collect based on a date variable?

    I'm want to use some sort of Bulk collect to speed up this query inside a PL/SQL block (we're in 10g). I have seen examples of using a FORALL statement but I don't know how to accommodate the variable v_cal_date. My idea is to be able to run the scri