Wrap and compile code in one step...

http://tylermuth.wordpress.com/2007/09/14/wrap-and-compile-in-one-step/
This was a cool trick I discovered while writing some LDAP code for a customer recently.
Tyler

you can zip all files in one file quite convenient using tar: tar czf <name of the tarfile>.tar.gz <filenames which must be in it>
An extremely easy way to share files is using NFS, or samba mounts (that way all the network handling is transparent)

Similar Messages

  • How to validate XML against XSD and parse/save in one step using SAXParser?

    How to validate XML against XSD and parse/save in one step using SAXParser?
    I currently have an XML file and XSD. The XML file specifies the location of the XSD. In Java code I create a SAXParser with parameters indicating that it needs to validate the XML. However, SAXParser.parse does not validate the XML, but it does call my handler functions which save the elements/attributes in memory as it is read. On the other hand, XMLReader.parse does validate the XML against the XSD, but does not save the document in memory.
    My code can call XMLReader.parse to validate the XML followed by SAXParser.parse to save the XML document in memory. But this sound inefficient. Besides, while a valid document is being parsed by XMLReader, it can be changed to be invalid and saved, and XMLReader.parse would be looking at the original file and would think that the file is OK, and then SAXParser.parse would parse the document without errors.
    <Book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="book.xsd" name="MyBook">
      <Chapter name="First Chapter"/>
      <Chapter name="Second Chapter">
        <Section number="1"/>
        <Section number="2"/>
      </Chapter>
    </Book>
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Book">
    <xs:complexType>
      <xs:sequence>
       <xs:element name="Chapter" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="Section" minOccurs="0" maxOccurs="unbounded">
           <xs:complexType>
            <xs:attribute name="xnumber"/>
          </xs:complexType>
          </xs:element>
         </xs:sequence>
         <xs:attribute name="name"/>
        </xs:complexType>
       </xs:element>
      </xs:sequence>
      <xs:attribute name="name"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    public class SAXXMLParserTest
       public static void main(String[] args)
          try
             SAXParserFactory factory = SAXParserFactory.newInstance();
             factory.setNamespaceAware(true);
             factory.setValidating(true);
             SAXParser parser = factory.newSAXParser();
             parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
                                "http://www.w3.org/2001/XMLSchema");
             BookHandler handler = new BookHandler();
             XMLReader reader = parser.getXMLReader();
             reader.setErrorHandler(handler);
             parser.parse("xmltest.dat", handler); // does not throw validation error
             Book book = handler.getBook();
             System.out.println(book);
             reader.parse("xmltest.dat"); // throws validation error because of 'xnumber' in the XSD
    public class Book extends Element
       private String name;
       private List<Chapter> chapters = new ArrayList<Chapter>();
       public Book(String name)
          this.name = name;
       public void addChapter(Chapter chapter)
          chapters.add(chapter);
       public String toString()
          StringBuilder builder = new StringBuilder();
          builder.append("<Book name=\"").append(name).append("\">\n");
          for (Chapter chapter: chapters)
             builder.append(chapter.toString());
          builder.append("</Book>\n");
          return builder.toString();
       public static class BookHandler extends DefaultHandler
          private Stack<Element> root = null;
          private Book book = null;
          public void startDocument()
             root = new Stack<Element>();
          public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
             if (qName.equals("Book"))
                String name = attributes.getValue("name");
                root.push(new Book(name));
             else if (qName.equals("Chapter"))
                String name = attributes.getValue("name");
                Chapter child = new Chapter(name);
                ((Book)root.peek()).addChapter(child);
                root.push(child);
             else if (qName.equals("Section"))
                Integer number = Integer.parseInt(attributes.getValue("number"));
                Section child = new Section(number);
                ((Chapter)root.peek()).addSection(child);
                root.push(child);
          public void endElement(String uri, String localName, String qName) throws SAXException
             Element finished = root.pop();
             if (root.size() == 0)
                book = (Book) finished;
          public Book getBook()
             return book;
          public void error(SAXParseException e)
             System.out.println(e.getMessage());
          public void fatalError(SAXParseException e)
             error(e);
          public void warning(SAXParseException e)
             error(e);
    public class Chapter extends Element
       public static class Section extends Element
          private Integer number;
          public Section(Integer number)
             this.number = number;
          public String toString()
             StringBuilder builder = new StringBuilder();
             builder.append("<Section number=\"").append(number).append("\"/>\n");
             return builder.toString();
       private String name;
       private List<Section> sections = null;
       public Chapter(String name)
          this.name = name;
       public void addSection(Section section)
          if (sections == null)
             sections = new ArrayList<Section>();
          sections.add(section);
       public String toString()
          StringBuilder builder = new StringBuilder();
          builder.append("<Chapter name=\"").append(name).append("\">\n");
          if (sections != null)
             for (Section section: sections)
                builder.append(section.toString());
          builder.append("</Chapter>\n");
          return builder.toString();
    }Edited by: sn72 on Oct 28, 2008 1:16 PM

    Have you looked at the XML DB FAQ thread (second post) in this forum? It has some examples for validating XML against schemas.

  • Can I include both CSS and HTML codes in one Open HTML Editor.

    Somehow Cell phones are not properly reading css codes. Is there any way to include both CSS and HTML codes in one Open HTML Editor?

    Hammad, their code is fairly mobile friendly.  Per my other discussion with you ( http://topliners.eloqua.com/thread/8532 ), Eloqua's code is responsive for the most part.  Most of their issues lie with the styling of the email where you will get different fonts and different sized fonts throughout the email and some other minor display issues.
    What you are trying to accomplish is extremely difficult to do because you do not have the access to the HTML to better control how the responsive template works which is why the Eloqua templates (and most ESP templates) stick to the more basic side of emails.
    If you want to use Eloqua's WYSIWYG to make their responsive email you can do so, but I would recommend deleting all their body text before editing anything because of the inconsistencies in their code.  Otherwise, I think you would be better off coding the emails outside of Eloqua using a 3rd party editor whether it's something more robust like Dreamweaver or Coda, or whether you feel comfortable working in a more text environment with programs like Notepad++ or Brackets.
    At the end of the day remember you are paying Eloqua for these and if you choose to stick with the WYSIWYG and you are not getting the results you expect you need to tell Eloqua through your support channels.

  • Gzip and FTP datafiles in one step

    Gzip and FTP datafiles in one step
    i have 10 datafiles in a single dir. which are between 2GB and 3GB and i want to transfer it to another host using FTP. I want to do the following:
    1. gzip all the datafiles
    2. FTP them to target server
    i want to accomplish this via shell script. Also i want do it in single step so as to save time.. something like below example:
    mknod pipe.dmp p
    nohup gzip -cNf < pipe.dmp > exp_infdbt01.dmp.gz &
    nohup exp userid=system/xxxxx file=pipe.dmp log=exp_infdbt01_$date.log owner=INFADMIN &
    Here a pipe is used to gzip the dump file as it generates the dump file and output it to exp_infdbt01.dmp.gz simultaneously..
    How can i do something similar to above to accomplish above task in shell script in for loop.. i tried but didn't worked. Any other way?
    I have RHEL 4 edition....using BASH shell

    you can zip all files in one file quite convenient using tar: tar czf <name of the tarfile>.tar.gz <filenames which must be in it>
    An extremely easy way to share files is using NFS, or samba mounts (that way all the network handling is transparent)

  • Webservice and UI codes in one application

    Hi,
    We have two applications, one for the UI and one for web services. Both of them have Model project. Hence, we are thinking of merging then into one application which contains three projects: UI, Web services and Model so that both UI and Web services share the same Model project, no redundant codes. Just wondering is that a good design, will there be any issues? So can it be generated two deployment EARs files within one application?
    Please advise.
    Thanks
    -Mina

    you can have your approach itself.. but.. both webservice and the UI project will be have a dependency on the model project.. but you cannot reuse the model project any where else..
    the suggestion given by shay, helps you to use the model library in both UI and webservice.. and can also extend to any other project which needs to access the model project..
    in this case you are refering only the libraries of model project.. so no direct depenedency..

  • Double_click and exit SAPLSLVC_FULLSCREEN in one step ?

    I have a program where the user can click a function button on the selection screen to display a ALV list of all entries this user has made.  From the ALV list, I want to allow them to double click a line and return the values to the selection screen and exit the ALV list.
    I got the functionality working to display the list and return the values to the calling program.  But after double click the ALV list is still displayed.  I have to Green Arrow back to return to the original selection screen where the values are filled in.  What do I need to do to have SAPLSLVC_FULLSCREEN  exit as part of the double click event?  The following code is in the main program that has the selection screen.
    class lcl_event_handler definition.
      PUBLIC SECTION.
        METHODS: Constructor Importing
                            im_siteid type /BIC/AUC0ISODS00-/BIC/UC0MIDEM0
                            im_matnr  type /BIC/AUC0ISODS00-/BIC/UC0MATNH0
                            im_called type /BIC/AUC0ISODS00-/BIC/UC0CALLDT
                            im_closed type /BIC/AUC0ISODS00-/BIC/UC0CLSDAT.
        METHODS:
              on_DOUBLE_CLICK
                FOR EVENT DOUBLE_CLICK OF cl_salv_events_table
                  IMPORTING
                    row
                    column.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD constructor.
      ENDMETHOD.                    "constructor
      METHOD on_double_click.
        READ TABLE it_alvtab into wa_alvtab
         index row.
        WX_SITEID = wa_alvtab-/bic/uc0midem0.
        WX_MATNR = wa_alvtab-/BIC/UC0MATNH0.
        WX_CALLED = wa_alvtab-/BIC/UC0CALLDT.
        WX_CLOSED = wa_alvtab-/BIC/UC0CLSDAT.
      ENDMETHOD.                    "on_double_click
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    in the above code, the event gets triggered on double click and when it exits the "on_double_click" method, it returns to CL_SALV_EVENTS_TABLE==========CP   method  RAISE_DOUBLE_CLICK and then continues with additional code in SAPLSLVC_FULLSCREEN  then redisplays the ALV list.   If I do a Green Arrow from the list, it returns to the original program code below ( line after PERFORM DISPLAY_USERS_RECORDS )
    AT SELECTION-SCREEN.
    **@@@@@@  CHECK IF USER CLICKED TO DISPLAY Previous Records   @@@@@@**
      IF SSCRFIELDS-UCOMM = 'DSPL'.
        Clear: WX_SITEID,
               WX_MATNR,
               WX_CALLED,
               WX_CLOSED.
        PERFORM DISPLAY_USERS_RECORDS.
        P_SITEID = WX_SITEID.
        P_MATNR = WX_MATNR.
        P_CALLED = WX_CALLED.
        P_CLOSED = WX_CLOSED.

    Hi
    Try to insert SET SCREEN 0. LEAVE SCREEN in the method of the event for doubleclick
    But why have you used that event?
    SAPLSLVC_FULLSCREEN is main program of ALV GRID function module, you should manage the doubleclick on USER_COMAND
    Max

  • Script for copy and compile objects from one schema to another

    Hi,
    I have 2 schemas like schema1 and schema2 in both schemas i have same procedures/function like p_test1 .If i modify a procedure in schema1 i want same modifications in schema2 so i want a script to apply these changes to schema 2.
    except bellow process  any alternative
      SET PAGESIZE 10000
      SET feedback OFF
      SET heading OFF
      SET echo OFF
      spool d:\SQL.OUT
       SELECT TEXT
        FROM USER_SOURCE
        WHERE NAME = 'MY_PROCEDURE';
      spool OFF
      SET echo ON
      SET feedback ON
      SET heading ON
    CONNECT OTHER_USER/OTHER_PASSWORD@OTHER_DATABASE;
    @d:\SQL.OUT

    All what you have to know about that function :
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#sthref3536
    Nicolas.

  • 101 & 541 in one step, SC vendor indicator

    we have 2 plants in same company code, and using STO (stock transport order, order type UB) to transfer goods from plant A to plant B, now there is one case, plant B ask for a material from plant A, but need it shipped directly to a external vendor, could it be possible to combine GR 101 and transfer 541 in one step? I know it's possible for PO type NB, just use the 'SC vendor' indicator in item detail, tab 'delivery address'. but it seems not working for type UB (or not working for item category U). I can't find the indicator, even set the field to 'required entry' in PO screen layout configuration. So does anybody has any suggestion? is there other solution to do 101 & 541 in one step? or is the indicator 'SC vendor' possible for PO type UB?
    thanks for any idea!

    Hi
    I dont think this will be possible as it is trying to club the two different functionalities. When we define STO means stock has to be received at the receiving plant.
    Once received please move the stock to Vendor.
    Please let me know if you have any questions.

  • One step DVD won't finalize

    What am I doing wrong? Thank you.
    Recently installed iDVD 5 as part of iLife for the 'One Step DVD' capability, installed over the original iDVD 3. Sony miniDV deck is firewired to my G4 Powerbook. iDVD operates the deck and goes through the One Step protocol just fine until the last step...then freezes up at 'writing leadout' operation. MiniDV clips I've tried are simple and short...no transitions or graphics just straight-from-the-camera miniDV.

    Can you check the audio on the DV tape. Is it 12 bit or 16 bit?
    How much free space is on your startup drive and how much tape (minutes) are you trying to import?
    I'm not a big fan of one step - in my view it just triples your chances for errors.
    I think importing/saving as disk image/burning is three steps, but those extra two steps will save you trouble.
    John

  • One Step iDVD does  not start

    I am using a Sony Digital 8 Handycam DCR-TRV530. I can't get the One Step iDVD function to work. I am using a Pioneer DVR-XD10 DVD/CD writer. The camera is also directly connected by Firewire to the computer. I click on the drop down menu and click on the One Step IDVD function and nothing happens. The camera is supposed to rewind and begin playing the tape while in VCR mode but nothing happens. I don't think the camera is at fault but I'm open to any suggestions.

    Yes, I did. To be more exact, however, the camera detects if you are using Hi-8 tape and will automatically begin recording in digital format. What is weird, though, is that about 20 minutes after posting my message the One Step iDVD process began working as expected.
    Thanks for your response! Greatly appreciated.

  • Display Blocked BPs-Can we see all detailed analyses in a one step process?

    Hi
    Before releasing any BPs blocked by the system our compliance users check the details of the blocks.
    Currently it is a 2 step process (after they are in the detailed screen of the Display Blocked Business Partners menu):
    1 u2013 Double click on the name of the blocked BPs.
    2 u2013 Click on icon u201CDisplay All Detailed Analysesu201D to show detailed analysis of all hits.
    Is there any way we can make it a one step process and see all details analysis immediately after selecting the blocked BPs?
    SAP Compliance Management -> Sanctioned Party List Screening -> Monitoring -> Business Partner -> Display Blocked Business Partners.
    Thanks!

    We can go to the SPL BP blocked list from the path you have mentioned. In the list select a line item and at the header there is partner. If you click on that you can see detailed analysis in there. Just click on it and it would be one step for you. But from here you can't release.

  • Cannot find anyplace to tell a page to wrap within browser margins, so one does not have to slide it back and forth to read each line.

    Cannot find anyplace to tell a page to wrap within browser margins, so one does not have to slide it back and forth to read each line::::::::::::
    Yes, there are so many pages on-line that -- when made small enough to fit within the margins so one does no have to use a scroll bar on EVERY line, moving it back and forth, back and forth -- look like a FINE-print Bible page (!! tiny !!) if you keep reducing it to fit within the margins.
    ALL because we cannot find a place to tell it to WRAP to FIT. Could have sworn I've seen some feature like that somewhere at one time, but if it is here, I cannot find it.
    Thank you.
    gina

    Maybe use a style.
    Add code to userContent.css
    * http://kb.mozillazine.org/userContent.css
    <pre><nowiki>body, body *{ white-space:pre-wrap!important; word-wrap:break-word; }
    </nowiki></pre>
    You can use the ChromEdit Plus or Stylish extension to have easier access to the customization files.
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    * http://kb.mozillazine.org/Editing_configuration

  • Wrapping and unwrapping source code

    Hi All,
    I'm having a security issue. I wanna do some wrapping thing for database objects like procedures,packages and functions.
    can anybody tell me how can i wrap my source codes. And also how can i unwrap these wrapped codes whenever i need..???
    can anybody help me to solve this issue please.
    Thanks in advance,
    Max

    Dear Max,
    if you have wrapped code, you can use this url: http://hz.codecheck.ch/UnwrapIt/Unwrap.jsp
    and unwrapped code.
    If you want wrap your code, just read:
    c:\ora9i\bin> wrap iname=input_file_name
    Running the Wrap Utility
    To run the Wrap Utility, enter the wrap command at your operating system prompt using the following syntax:
    wrap iname=input_file [oname=output_file]
    Leave no space around the equal signs because spaces delimit individual arguments.
    The wrap command requires only one argument, which is
    iname=input_file
    where input_file is the name of the Wrap Utility input file. You need not specify the file extension because it defaults to sql. For example, the following commands are equivalent:
    wrap iname=/mydir/myfile
    wrap iname=/mydir/myfile.sql
    However, you can specify a different file extension as the following example shows:
    wrap iname=/mydir/myfile.src

  • After reload and "one-step-back-funtion" start from the begining of the site.

    Hi guys!
    I build a Website in Muse. So i wanna reach that if someone reload the browser or go one step back the page automatically starts from the top.
    I tried to insert a HTML-Code like this
    $(document).ready(function(){
      $(this).scrollTop(0);
    but it doesn't work:(
    so can someone help me please and give me a code which create this effect?
    Thanks guys!

    Read this
    https://discussions.apple.com/docs/DOC-3251

  • How to get code and compile by different remote machine's?

    Hi all,
    I want to connect(as ssh) to svn server (Linux) from my pc (windows), to get C++ source and bring it in my pc and compile it by another remote machine (Linux) and finally I want to commit the changes to svn server,
    is there a "step by step" instruction in CDT? I can not do this by my own,

    > changing the Flex Compiler options from "-locale en_CA" to "-locale  en_US"
    We hear you. This has been fixed in the coming release.
    Try this for code-behind:
    1. Create a new AS class (say MyClass) extending from WindowedApplication.
    2. Right click your project, choose properties, go to Flex Applications.
    3. Select MyClass, hit remove.
    4. Now change the root tag of your existing MXML file to <local:MyClass by adding a namespace xmlns:local="*"
    That should work.
    Cheers,
    Anirudh

Maybe you are looking for

  • Bug report: Screen times out when other side is no...

    Bug report: Screen times out when other side is not sharing video. The phone locks and of course the other party cannot see anything. Please fix. Using WP 8.1.1 Developers Preview.

  • Create an Answers Prompt not based on an Answers Column

    Hello, I want to create an answers prompt that is not based on a column in my request and i want to use that prompt to do calculations in my request. For example, i want to create an 'As of date' parameter where the user would fill a specific date (f

  • Problem inserting special Hungarian characters into db

    Hi, I've posted this question in the database connection forum but put it here too because I don't know where to fit better. I read that it would be the most straightforward way to do everything in UTF-8 because it handles well special characters so

  • For upgrade fastload, can you have CI in Windows and AS in zLINUX

    Hello, Based on the DB2 Cookbook, the fastload feature during upgrade is not available in Windows server and only in zLINUX. Questions please - can you have the CI in Windows and the apps server in zLINUX in the source and target systems? - if possib

  • One row expected but not counted with resultSet.next()

    Hi all, I am using the following method to check an entry in my database. The problem is that the while(rs.next()) loop is not entered and therefore not counting the rows within the resultSet. This only occurs when one row is retrieved from the db. T