Help needed in creating file structure

Hi friends,
- <Validity>
  <Validity Time="1">12102010</Validity>
  </Validity>
This is a node of an xml file which i need to use in my scenario.but i was stuck in creating data type for this node.how to create data type for this node?
as at target side this field should be split into 2 fields validity and time

Hello Kiran,
To add something related to split, check this out.
Re: Split a string
Regards
Pothana

Similar Messages

  • Help needed in creating File Directory if not exist

    hi, All
    I am thinking about wite files to directories based on year, month, day. if the directory for that year or month or day exists already, do not create the directory, but write the file to that directory.
    For example: 2003/02/22/file.txt --2003/02/22 exist, just write file.txt
    If the directory does not exist, the program will create the direcotry and write the file into the right directory.
    For example 2003/02/22/file.txt, ---2003/02/22/ does not exist, the program will create the directoies and write file file.txt
    If anyone can provide any example or suggestion, I really appreciate!
    Thanks
    Steve

    Hi!
    Just have a look at the class "File"
    and it's method "exists()".
    Hope, that helps.
    Thoto

  • Need help understanding Time Capsule file structure and how to get it back

    I have the original Time Capsule on which I backup both my Mac Pro and my wife’s Macbook. When Snow Leopard came out, I successfully used the ‘Restore from Time Machine’ feature on my Mac Pro so I know it has worked. However, my wife’s MacBook harddrive died the other day and I was trying to do the ‘Restore from Time Machine’ and all it would find was a backup from April (when I put her in a new larger drive). Time Machine would not find any backup files newer that April. She stated that she had seen the the Time Machine backup notices regularly and as recent as the day the haddrive died (Nov. 23) so I figured that I should have no problem. Here is what I have found in my trouble shooting and what leads to my questions below.
    This is the file structure I found: (note that our ID’s are ‘Denise’ and ‘John’)
    *Time Capsule* (the drive as listed in my Finder window sidebar under ‘shared’)
    >Folder called ‘Time Capsule’ (when logged in as either ‘Denise’ or ‘John’)
    >>Denise Sparsebundle
    >>>Backup of Denise’s iBook (mounted image)
    >>>>Folder called ‘Backups.backupdb’
    >>>>>Folder called ‘Denise’s iBook
    >>>>>>Single folder with old April backup (not the right files)
    >>John Sparsebundle
    >>>Backup of John’s Mac Pro (mounted image)
    >>>>Folder called ‘Backups.backupdb’
    >>>>>Folder called ‘John’s Mac Pro’
    >>>>>>Folders containing all my backup files
    >Folder Called ‘Denise’ (if logged as ‘Denise’)
    >>Denise’s Sparsebundle (a disk image)
    >>>Backup of Denise iBook (the mounted image. Name from old machine)
    >>>>Backups.Backupdb
    >>>>>Denise’s iBook (Contains the backup I need)
    >Folder Called ‘John’ (if logged in as ‘John’)
    >> (empty)
    For some reason, my wife’s backup files are stored within a folder located at the top level of the Time Capsule drive called ‘Denise’, however, mine are within a folder called ‘Time Capsule’ which is at the same level as the ‘Denise’ folder.
    For some reason, when trying to use Time Machine to recover, it bypasses the top level ‘Denise’ folder which contains the correct files and goes into the ‘Time Capsule’ folder and finds the outdated backup files.
    I would assume that both my backup files and my wife’s should be at the same level of the Time Capsule.
    I was eventually able to use Migration Assistant to recover the files after installing a fresh OS and mounting the correct Sparsebundle image.
    So, my question, how do I get this fixed so that if I have to recover a drive with Time Capsule, it will find the correct files.
    Sorry for the long post and thanks in advance for any help.

    John Ormsby wrote:
    What I was trying to determine is why different backups for one particular machine are located at different file structure levels on my Time Capsule and why the most resent one for that machine is at a different level that for my other machine. Also, what is the correct level that both machines backups should be at.
    well John, first can you clarify if you are on 10.4.8 as your profile suggests ? if so, i'm wondering how you can use TM at all because TM was introduced with Leo. if you're not on 10.4.8, please update your profile. if you could, please also indicate details of your machine such as available RAM, processor, etc.
    second, what OS is your wife's machine running ?
    third, i frankly don't know too much about TM's file structure or if there indeed is such a thing as the correct one. however, i do know that it is best to leave TM to do its thing (as long as it's working). FWIW, though off-topic, you may want to have a look at this read for further information.
    last but not least, i see TM backups to my TC only as a part of my backup strategy. the backbone of my strategy is to create bootable clone of my startup disk(s) using e.g. Carbon Copy Cloner on a regular basis. while TM is capable of doing a full system restore, i don't trust it as much as a working clone. i use TM to retrieve a file i accidentally trashed a week ago but you cannot boot from a TM backup if your startup disk goes belly up.
    If I have missed this information in either the FAQs or the Troubleshooting article, I would greatly appreciate being pointed to it .
    i expect you didn't miss anything and i'm sorry you didn't find any help there. perhaps if Pondini (author of the FAQ and troubleshooting user tips) reads this thread, you will get the necessary advice on the file structure and more besides.
    good luck to you !

  • Help Needed in Creating Java Class and Java Stored Procedures

    Hi,
    Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
    I have seen the Documents. But i couldn't able to understand it correctly.
    I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
    Is that possible to Create a Java class in the oracle Database itself ?.
    Where are the files located for the existing Java Class ?..
    Help Needed Please.
    Thanks,
    Murali.v

    Hi Murali,
    Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
    Configure deployment to a database to upload the java file instead of class
    The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
    Hope this helps,
    Sunil..

  • Help needed in splitting files using BPM

    Hello experts,
    I am working on an interface where i need to split files within BPM.
    I know,i can achieve it in Message Mapping by mapping Recordset to Target structure and then using Interface Mapping within Transformation step.But i dont want to follow this.Is there an alternative way to achieve this within BPM.
    I have an input file with multiple headers and i need to split for each header.My input file looks like this:
    HXXXXXABCDVN01
    MXXXXXXXXXXXXXX
    MXXXXXXXXXXXXXX
    SXXXXXXXXXXXXXX
    HXXXXXABCDVN02
    MXXXXXXXXXXXXXX
    MXXXXXXXXXXXXXX
    SXXXXXXXXXXXXXX
    HXXXXXABCDVN03
    MXXXXXXXXXXXXXX
    SXXXXXXXXXXXXXX
    Is there a way, where i can specify this condition within BPM , that split files for every H.
    Thanks in advance.
    Regards,
    Swathi

    Hi,
    have your target structure with occurence as 0...unbounded in the mapping and map the header filed to the root node (repeating parent node) of the target structure....this will create as many target messages as the header fileds....if you want to send these messages separately then use a block in BPM with ForEach option....
    Splitting and Dynamic configuration can be applied in the same mapping.
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Dec 18, 2008 12:59 PM

  • Help needed:Printing HTML file using javax.print

    Hi
    I am using the following code which i got form the forum for rpinting an HTML file.
    The folllowing code is working fine, but the problem is the content of HTML file is not getting printed. I am geeting a blank page with no content. What is the change that is required in the code? ALso is there any simpler way to implement this. Help needed ASAP.
    public boolean printHTMLFile(String filename) {
              try {
                   JEditorPane editorPane = new JEditorPane();
                   editorPane.setEditorKit(new HTMLEditorKit());
                   //editorPane.setContentType("text/html");
                   editorPane.setSize(500,500);
                   String text = getFileContents(filename);
                   if (text != null) {
                        editorPane.setText(text);                    
                   } else {
                        return false;
                   printEditorPane(editorPane);
                   return true;
              } catch (Exception tce) {
                   tce.printStackTrace();
              return false;
         public String getFileContents(String filename) {
              try {
                   File file = new File(filename);
                   BufferedReader br = new BufferedReader(new FileReader(file));
                   String line;
                   StringBuffer sb = new StringBuffer();
                   while ((line = br.readLine()) != null) {
                        sb.append(line);
                   br.close();
                   return sb.toString();
              } catch (Exception tce) {
                   tce.printStackTrace();
              return null;
         public void printEditorPane(JEditorPane editorPane) {
                   try {
                        HTMLPrinter htmlPrinter = new HTMLPrinter();
                        htmlPrinter.printJEditorPane(editorPane, htmlPrinter.showPrintDialog());
                   } catch (Exception tce) {
                        tce.printStackTrace();
         * Sets up to easily print HTML documents. It is not necessary to call any of the setter
         * methods as they all have default values, they are provided should you wish to change
         * any of the default values.
         public class HTMLPrinter {
         public int DEFAULT_DPI = 72;
         public float DEFAULT_PAGE_WIDTH_INCH = 8.5f;
         public float DEFAULT_PAGE_HEIGHT_INCH = 11f;
         int x = 100;
         int y = 80;
         GraphicsConfiguration gc;
         PrintService[] services;
         PrintService defaultService;
         DocFlavor flavor;
         PrintRequestAttributeSet attributes;
         Vector pjlListeners = new Vector();
         Vector pjalListeners = new Vector();
         Vector psalListeners = new Vector();
         public HTMLPrinter() {
              gc = null;
              attributes = new HashPrintRequestAttributeSet();
              flavor = null;
              defaultService = PrintServiceLookup.lookupDefaultPrintService();
              services = PrintServiceLookup.lookupPrintServices(flavor, attributes);
              // do something with the supported docflavors
              DocFlavor[] df = defaultService.getSupportedDocFlavors();
              for (int i = 0; i < df.length; i++)
              System.out.println(df.getMimeType() + " " + df[i].getRepresentationClassName());
              // if there is a default service, but no other services
              if (defaultService != null && (services == null || services.length == 0)) {
              services = new PrintService[1];
              services[0] = defaultService;
         * Set the GraphicsConfiguration to display the print dialog on.
         * @param gc a GraphicsConfiguration object
         public void setGraphicsConfiguration(GraphicsConfiguration gc) {
              this.gc = gc;
         public void setServices(PrintService[] services) {
              this.services = services;
         public void setDefaultService(PrintService service) {
              this.defaultService = service;
         public void setDocFlavor(DocFlavor flavor) {
              this.flavor = flavor;
         public void setPrintRequestAttributes(PrintRequestAttributeSet attributes) {
              this.attributes = attributes;
         public void setPrintDialogLocation(int x, int y) {
              this.x = x;
              this.y = y;
         public void addPrintJobListener(PrintJobListener pjl) {
              pjlListeners.addElement(pjl);
         public void removePrintJobListener(PrintJobListener pjl) {
              pjlListeners.removeElement(pjl);
         public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.addElement(psal);
         public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.removeElement(psal);
         public boolean printJEditorPane(JEditorPane jep, PrintService ps) {
                   if (ps == null || jep == null) {
                        System.out.println("printJEditorPane: jep or ps is NULL, aborting...");
                        return false;
                   // get the root view of the preview pane
                   View rv = jep.getUI().getRootView(jep);
                   // get the size of the view (hopefully the total size of the page to be printed
                   int x = (int) rv.getPreferredSpan(View.X_AXIS);
                   int y = (int) rv.getPreferredSpan(View.Y_AXIS);
                   // find out if the print has been set to colour mode
                   DocPrintJob dpj = ps.createPrintJob();
                   PrintJobAttributeSet pjas = dpj.getAttributes();
                   // get the DPI and printable area of the page. use default values if not available
                   // use this to get the maximum number of pixels on the vertical axis
                   PrinterResolution pr = (PrinterResolution) pjas.get(PrinterResolution.class);
                   int dpi;
                   float pageX, pageY;
                   if (pr != null)
                        dpi = pr.getFeedResolution(PrinterResolution.DPI);
                   else
                        dpi = DEFAULT_DPI;
                   MediaPrintableArea mpa = (MediaPrintableArea) pjas.get(MediaPrintableArea.class);
                   if (mpa != null) {
                        pageX = mpa.getX(MediaPrintableArea.INCH);
                        pageY = mpa.getX(MediaPrintableArea.INCH);
                   } else {
                        pageX = DEFAULT_PAGE_WIDTH_INCH;
                        pageY = DEFAULT_PAGE_HEIGHT_INCH;
                   int pixelsPerPageY = (int) (dpi * pageY);
                   int pixelsPerPageX = (int) (dpi * pageX);
                   int minY = Math.max(pixelsPerPageY, y);
                   // make colour true if the user has selected colour, and the PrintService can support colour
                   boolean colour = pjas.containsValue(Chromaticity.COLOR);
                   colour = colour & (ps.getAttribute(ColorSupported.class) == ColorSupported.SUPPORTED);
                   // create a BufferedImage to draw on
                   int imgMode;
                   if (colour)
                        imgMode = BufferedImage.TYPE_3BYTE_BGR;
                   else
                        imgMode = BufferedImage.TYPE_BYTE_GRAY;
                   BufferedImage img = new BufferedImage(pixelsPerPageX, minY, imgMode);
                   Graphics myGraphics = img.getGraphics();
                   myGraphics.setClip(0, 0, pixelsPerPageX, minY);
                   myGraphics.setColor(Color.WHITE);
                   myGraphics.fillRect(0, 0, pixelsPerPageX, minY);
                        java.awt.Rectangle rectangle=new java.awt.Rectangle(0,0,pixelsPerPageX, minY);
                   // call rootView.paint( myGraphics, rect ) to paint the whole image on myGraphics
                   rv.paint(myGraphics, rectangle);
                   try {
                        // write the image as a JPEG to the ByteArray so it can be printed
                        Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
                        ImageWriter writer = (ImageWriter) writers.next();
                                       // mod: Added the iwparam to create the highest quality image possible
                        ImageWriteParam iwparam = writer.getDefaultWriteParam();
                        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT) ;
                        iwparam.setCompressionQuality(1.0f); // highest quality
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ImageOutputStream ios = ImageIO.createImageOutputStream(out);
                        writer.setOutput(ios);
                        // get the number of pages we need to print this image
                        int imageHeight = img.getHeight();
                        int numberOfPages = (int) Math.ceil(minY / (double) pixelsPerPageY);
                        // print each page
                        for (int i = 0; i < numberOfPages; i++) {
                             int startY = i * pixelsPerPageY;
                             // get a subimage which is exactly the size of one page
                             BufferedImage subImg = img.getSubimage(0, startY, pixelsPerPageX, Math.min(y - startY, pixelsPerPageY));
                                                 // mod: different .write() method to use the iwparam parameter with highest quality compression
                             writer.write(null, new IIOImage(subImg, null, null), iwparam);
                             SimpleDoc sd = new SimpleDoc(out.toByteArray(), DocFlavor.BYTE_ARRAY.JPEG, null);
                             printDocument(sd, ps);
                             // reset the ByteArray so we can start the next page
                             out.reset();
                   } catch (PrintException e) {
                        System.out.println("Error printing document.");
                        e.printStackTrace();
                        return false;
                   } catch (IOException e) {
                        System.out.println("Error creating ImageOutputStream or writing to it.");
                        e.printStackTrace();
                        return false;
                   // uncomment this code and comment out the 'try-catch' block above
                   // to print to a JFrame instead of to the printer
                   /*          JFrame jf = new JFrame();
                             PaintableJPanel jp = new PaintableJPanel();
                             jp.setImage( img );
                             JScrollPane jsp = new JScrollPane( jp );
                             jf.getContentPane().add( jsp );
                             Insets i = jf.getInsets();
                             jf.setBounds( 0, 0, newX, y );
                             jf.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                             jf.setVisible( true );*/
                   return true;
              * Print the document to the specified PrintService.
              * This method cannot tell if the printing was successful. You must register
              * a PrintJobListener
              * @return false if no PrintService is selected in the dialog, true otherwise
              public boolean printDocument(Doc doc, PrintService ps) throws PrintException {
                   if (ps == null)
                   return false;
                   addAllPrintServiceAttributeListeners(ps);
                   DocPrintJob dpj = ps.createPrintJob();
                   addAllPrintJobListeners(dpj);
                   dpj.print(doc, attributes);
                   return true;
              public PrintService showPrintDialog() {
                   return ServiceUI.printDialog(gc, x, y, services, defaultService, flavor, attributes);
              private void addAllPrintServiceAttributeListeners(PrintService ps) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < psalListeners.size(); i++) {
                   PrintServiceAttributeListener p = (PrintServiceAttributeListener) psalListeners.get(i);
                   ps.addPrintServiceAttributeListener(p);
              private void addAllPrintJobListeners(DocPrintJob dpj) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < pjlListeners.size(); i++) {
                   PrintJobListener p = (PrintJobListener) pjlListeners.get(i);
                   dpj.addPrintJobListener(p);
              // uncomment this also to print to a JFrame instead of a printer
              /* protected class PaintableJPanel extends JPanel {
                   Image img;
                   protected PaintableJPanel() {
                        super();
                   public void setImage( Image i ) {
                        img = i;
                   public void paint( Graphics g ) {
                        g.drawImage( img, 0, 0, this );
    Thanks
    Ram

    Ram,
    I have had printing problems too a year and a half ago. I used all printing apis of java and I still find that it is something java lacks. Now basically you can try autosense. To check whether your printer is capable of printing the docflavor use this PrintServiceLookup.lookupPrintServices(flavor, aset); . If it lists the printer then he can print the document otherwise he can't. I guess that is why you get the error.
    Regards,
    Kevin

  • Help needed to create Notification in IW21 tr code using BAPI

    <b>Hi Experts,
                      I am searching for some BAPI's of IW21 tr code, where I need to create Notification using the details of some legasy system/flat file. I dont wanna use BDC, I need to use BAPI so could anyone help me out.
    Thanks in advance,
    Sunil</b>

    <b>Hi Surya,
                   Thanx for your reply, if u have the program to create the notification could you please send me,,,, I need it urgently....I have a Z-table which has the datas like;
    CusomerName
    Customeraddress
    Work_order_type
    Work_order_priority.........and so on...
    Now I need to create notification using the same datas....
    Thanks in advance..
    Sunil</b>

  • Help needed with creating Flash game

    Hello,
    I need to create Flash educational/quiz game for one of my clients. It would be based on concept like these ones for example:
    Example 1
    http://go.ucsusa.org/game/
    Example 2
    http://www.zdravlje.hr/igre/stop-aids/
    Note: when you open this link you will see two text boxs which you first must fill. On the left side text box "Upišite ime" means "Type your name" and right one "Upišite godinu svog rođenja" means "Year of birth"
    What is interesting about this type of games is that they are classic games (for example game Labirint where you have to find way out), but during play pop-up questions starts to appear to test end user knowledge abot certain topic (in example 2 topic is about AIDS/HIV). In case of my client, topic is about Eco environment.
    Here is where my trouble starts;) : I found many useful free tutorials how to create simple flash game (most interesting example I found is this one http://www.strille.net/tutorials/snake/index.php)  BUT I dont know how make that system of popup questions appear during game similar to Example 1 and Example 2?
    Any help is appreciated and thanks in advance for promt reply.
    Greetings,
    Adnan

    Update: I have just read all instructions in Snake tutorial which helped be better realize how Snake game works.
    a) This is what I plan to realize for my client:
    1. Snake game which end users will play and during play pop-up/quiz quesions will appear on topic Eco environment;
    2. For example when end user earns 50 points he must answer some of the random questions like "Q:How many ton of waste are produced by US livestock each year" with three answers A1: "1 milion" A2: "1 bilion" A3: "2 bilion" and after user scores 100 points then another question pops up and so on. This is all true if all answers are correct but in case he answer some question wrong than game can start from begining or another solution could be he looses -50 or -100 points.
    3. At the end, user which gains most points wins.
    b) This is what I have done till now:
    I have this file http://www.strille.net/tutorials/snake/snakeGameWithHighscore.zip which I partly understand how it works with my Flash knowladge.
    All functions and main game engine is in layer code:
    "// Snake Game by Strille, 2004, www.strille.net
    blockSize = 8;   // the block width/height in number of pixels
    gameHeight = 30; // the game height in number of blocks
    gameWidth  = 45; // the game width in number of blocks
    replaySpeed = 1;
    SNAKE_BLOCK = 1; // holds the number used to mark snake blocks in the map
    xVelocity = [-1, 0, 1, 0]; // x velocity when moving left, up, right, down
    yVelocity = [0, -1, 0, 1]; // y velocity when moving left, up, right, down
    keyListener = new Object(); // key listener
    keyListener.onKeyDown = function() {
        var keyCode = Key.getCode(); // get key code
        if (keyCode > 36 && keyCode < 41) { // arrow keys pressed (37 = left, 38 = up, 39 = right, 40 = down)...
            if (playRec) {
                if (keyCode == 37 && replaySpeed > 1) {
                    replaySpeed--;
                } else if (keyCode == 39 && replaySpeed < 10) {
                    replaySpeed++;
            } else if (game.onEnterFrame != undefined) { // only allow moves if the game is running, and is not paused
                if (keyCode-37 != turnQueue[0]) { // ...and it's different from the last key pressed
                    turnQueue.unshift(keyCode-37); // save the key (or rather direction) in the turnQueue
        } else if (keyCode == 32) { // start the game if it's not started (32 = SPACE)
            if (!gameRunning || playRec) {
                startGame(false);
        } else if (keyCode == 80) { // pause/unpause (80 = 'P')
            if (gameRunning && !playRec) {
                if (game.onEnterFrame) { // pause
                    delete game.onEnterFrame; // remove main loop
                    textMC.gotoAndStop("paused");
                } else { // exit pause mode
                    game.onEnterFrame = main; // start main loop
                    textMC.gotoAndStop("hide");
    Key.addListener(keyListener);
    function startGame(pRec) {
        x = int(gameWidth/2); // x start position in the middle
        y = gameHeight-2;     // y start position near the bottom
        map = new Array(); // create an array to store food and snake
        for (var n=0;n<gameWidth;n++) { // make map a 2 dimensional array
            map[n] = new Array();
        turnQueue = new Array(); // a queue to store key presses (so that x number of key presses during one frame are spread over x number of frames)
        game.createEmptyMovieClip("food", 1); // create MC to store the food
        game.createEmptyMovieClip("s", 2); // create MC to store the snake
        scoreTextField.text = "Score: 0"; // type out score info
        foodCounter = 0; // keeps track of the number of food movie clips
        snakeBlockCounter = 0; // keeps track of the snake blocks, increased on every frame
        currentDirection = 1; // holds the direction of movement (0 = left, 1 = up, 2 = right, 3 = down)
        snakeEraseCounter = -1; // increased on every frame, erases the snake tail (setting this to -3 will result in a 3 block long snake at the beginning)
        score = 0; // keeps track of the score
        ticks = lastRec = 0;
        recPos = recFoodPos = 0;
        playRec = pRec;
        if (!playRec) {
            textMC.gotoAndStop("hide"); // make sure no text is visible (like "game over ")
            highscores.enterHighscoreMC._visible = false;
            statusTextField.text = "";
            recTurn = "";
            recFrame = "";
            recFood = "";
            game.onEnterFrame = main; // start the main loop
        } else {
            if (loadedRecordingNumber != -1) {
                var n = getLoadedRecordingNumberHighscorePos(loadedRecordingNumber);
                statusTextField.text = "Viewing " + highscores[n].name.text + "'s game (score " + highscores[n].score.text + ")";
            } else {
                statusTextField.text = "Viewing your game";
            game.onEnterFrame = replayMain; // start the main loop
        placeFood("new"); // place a new food block
        gameRunning = true; // flag telling if the game is running. If true it does not necessarily mean that main is called (the game could be paused)
    function main() { // called on every frame if the game is running and it's not paused
        if (playRec) {
            if (ticks == lastRec+parseInt(recFrame.charAt(recPos*2)+recFrame.charAt(recPos*2+1), 36)) {
                currentDirection = parseInt(recTurn.charAt(recPos));
                lastRec = ticks;
                recPos++;
        } else if (turnQueue.length) { // if we have a turn to perform...
            var dir = turnQueue.pop(); // ...pick the next turn in the queue...
            if (dir % 2 != currentDirection % 2) { // not a 180 degree turn (annoying to be able to turn into the snake with one key press)
                currentDirection = dir; // change current direction to the new value
                recTurn += dir;
                var fn = ticks-lastRec;
                if (fn < 36) {
                    recFrame += " "+new Number(fn).toString(36);
                } else {
                    recFrame += new Number(fn).toString(36);
                lastRec = ticks;
        x += xVelocity[currentDirection]; // move the snake position in x
        y += yVelocity[currentDirection]; // move the snake position in y
        if (map[x][y] != SNAKE_BLOCK && x > -1 && x < gameWidth && y > -1 && y < gameHeight) { // make sure we are not hitting the snake or leaving the game area
            game.s.attachMovie("snakeMC", snakeBlockCounter, snakeBlockCounter, {_x: x*blockSize, _y: y*blockSize}); // attach a snake block movie clip
            snakeBlockCounter++; // increase the snake counter
            if (map[x][y]) { // if it's a not a vacant block then there is a food block on the position
                score += 10; // add points to score
                scoreTextField.text = "Score: " + score; // type out score info
                snakeEraseCounter -= 5; // make the snake not remove the tail for five loops
                placeFood(map[x][y]); // place the food movie clip which is referenced in the map map[x][y]
            map[x][y] = SNAKE_BLOCK; // set current position to occupied
            var tailMC = game.s[snakeEraseCounter]; // get "last" MC according to snakeEraseCounter (may not exist)
            if (tailMC) { // if the snake block exists
                delete map[tailMC._x/blockSize][tailMC._y/blockSize]; // delete the value in the array m
                tailMC.removeMovieClip(); // delete the MC
            snakeEraseCounter++; // increase erase snake counter   
        } else { // GAME OVER if it is on a snake block or outside of the map
            if (playRec) {
                startGame(true);
            } else {
                gameOver();
            return;
        ticks++;
    function replayMain() {
        for (var n=0;n<replaySpeed;n++) {
            main();
    function gameOver() {
        textMC.gotoAndStop("gameOver"); // show "game over" text
        delete game.onEnterFrame; // quit looping main function
        gameRunning = false; // the game is no longer running
        enterHighscore();
    function placeFood(foodMC) {
        if (playRec) {
            var xFood = parseInt(recFood.charAt(recFoodPos*3)+recFood.charAt(recFoodPos*3+1), 36);
            var yFood = parseInt(recFood.charAt(recFoodPos*3+2), 36);
            recFoodPos++;
        } else {
            do {
                var xFood = random(gameWidth);
                var yFood = random(gameHeight);
            } while (map[xFood][yFood]); // keep picking a spot until it's a vacant spot (we don't want to place the food on a position occupied by the snake)
            if (xFood < 36) {
                recFood += " "+new Number(xFood).toString(36);
            } else {
                recFood += new Number(xFood).toString(36);
            recFood += new Number(yFood).toString(36);
        if (foodMC == "new") { // create a new food movie clip
            foodMC = game.food.attachMovie("foodMC", foodCounter, foodCounter);
            foodCounter++;
        foodMC._x = xFood*blockSize; // place the food
        foodMC._y = yFood*blockSize; // place the food
        map[xFood][yFood] = foodMC; // save a reference to this food movie clip in the map
    //- Highscore functions
    loadHighscores();
    enterHighscoreKeyListener = new Object();
    enterHighscoreKeyListener.onKeyDown = function() {
        if (Key.getCode() == Key.ENTER) {
            playerName = highscores.enterHighscoreMC.nameTextField.text;
            if (playerName == undefined || playerName == "") {
                playerName = "no name";
            saveHighscore();
            Key.removeListener(enterHighscoreKeyListener);
            Key.addListener(keyListener);
            highscores.enterHighscoreMC._visible = false;
            loadedRecordingNumber = -1;
            startGame(true);
    function enterHighscore() {
        if (score >= lowestHighscore) {
            highscores.enterHighscoreMC._visible = true;
            highscores.enterHighscoreMC.focus();
            Key.removeListener(keyListener);
            Key.addListener(enterHighscoreKeyListener);
        } else {
            loadedRecordingNumber = -1;
            startGame(true);
    function getLoadedRecordingNumberHighscorePos(num) {
        for (var n=0;n<10;n++) {
            if (num == highscores[n].recFile) {
                return n;
    function loadHighscores() {
        vars = new LoadVars();
        vars.onLoad = function(success) {
            for (var n=0;n<10;n++) {
                var mc = highscores.attachMovie("highscoreLine", n, n);
                mc._x = 5;
                mc._y = 5+n*12;
                mc.place.text = (n+1) + ".";
                mc.name.text = this["name"+n];
                mc.score.text = this["score"+n];
                mc.recFile = parseInt(this["recFile"+n]);
            lowestHighscore = parseInt(this.score9);
            if (!gameRunning) {
                loadRecording(random(10));
            delete this;
        if (this._url.indexOf("http") != -1) {
            vars.load("highscores.txt?" + new Date().getTime());
        } else {
            vars.load("highscores.txt");
    function loadRecording(num) {
        vars = new LoadVars();
        vars.onLoad = function(success) {
            if (success && this.recTurn.length) {
                recTurn = this.recTurn;
                recFrame = this.recFrame;
                recFood = this.recFood;
                startGame(true);
            } else {
                loadRecording((num+1)%10);
                return;
            delete this;
        loadedRecordingNumber = num;
        if (this._url.indexOf("http") != -1) {
            vars.load("rec"+loadedRecordingNumber+".txt?" + new Date().getTime());
        } else {
            vars.load("rec"+loadedRecordingNumber+".txt");
    function saveHighscore() {
        sendVars = new LoadVars();
        for (var n in _root) {
            if (_root[n] != sendVars) {
                sendVars[n] = _root[n];
        returnVars = new LoadVars();
        returnVars.onLoad = function() {
            if (this.status == "ok") {
                loadHighscoresInterval = setInterval(function() {
                    loadHighscores();
                    clearInterval(loadHighscoresInterval);
                }, 1000);
            delete sendVars;
            delete this;
        sendVars.sendAndLoad("enterHighscore.php", returnVars, "POST");
    function startClicked() {
        if (!gameRunning || playRec) {
            if (highscores.enterHighscoreMC._visible) {
                Key.removeListener(enterHighscoreKeyListener);
                Key.addListener(keyListener);
                highscores.enterHighscoreMC._visible = false;
            startGame(false);
    function viewGame(lineMC) {
        loadRecording(lineMC.recFile);
        statusTextField.text = "Loading " + lineMC.name.text + "'s game...";
    Now what is left to do is somehow to iclude educational quiz in this game/code. First idea that came to me is same thing Ned suggested: to create some unique movie clip which would contain all data/questions lined up but main problem for me is how to "trigger" that movie clip to play only AFTER end user clicks on "Start game" or SPACE to restart? Not sure how to solve this issue?

  • Help needed making SWF file loop

    Hello Everyone-
    I have been researching this topic and am really struggling.
    I'm not much of a HTML guy and I think I'll need to do some to
    resolve my issues. I have searched and searched but I'm not having
    any luck.
    I create an animation in Apple Motion, exported it as a MOV
    and imported it as video into Flash CS3. It was encoded using
    Progressive download from server it creates a FLV file a SWF file
    and an HTML file. My provider is 1and1. I then use Adobe GoLive to
    create my webpage and upload to the web. I need my SWF file to loop
    and I cannot get it to loop.
    In flash. Everything plays fine. When I do a publish preview
    however, the swf file does not loop. I've got the loop option
    checked in my publish preview settings and even in the inspector in
    GoLive but it does nothing.
    Here is the link to the page. And the source code. If anyone
    can help me that would be genius.
    PS there is actually two SWF that I need to loop. Neither of
    them are looping.
    http://www.drewwfilms.com/Index2.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type"
    content="text/html;charset=utf-8" />
    <meta name= content="Adobe GoLive" />
    <title>Drew W Films Index</title>
    </head>
    <body>
    <div
    style="position:relative;width:750px;height:571px;margin:auto;-adbe-g:p;">
    <div
    style="position:absolute;top:64px;left:16px;width:720px;height:150px;">
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    height="150" width="720">
    <param name="loop" value="true" />
    <param name="movie" value="IndexHeader2/IndexHeader2.swf"
    />
    <param name="quality" value="best" />
    <param name="play" value="true" />
    <embed height="150" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    src="IndexHeader2/IndexHeader2.swf"
    type="application/x-shockwave-flash" width="720" quality="best"
    play="true" loop="true"></embed>
    </object></div>
    <div
    style="position:absolute;top:16px;left:64px;width:624px;height:32px;-adbe-c:c">
    <menumachine name="indexheader2" id="mre8mxf">
    <csobj t="Component"
    csref="menumachine/indexheader2/menuspecs.menudata"><noscript>
    <p><a class="mm_no_js_link"
    href="menumachine/indexheader2/navigation.html">Site
    Navigation</a></p>
    </noscript> </csobj>
    <script type="text/javascript"><!--
    var mmfolder=/*URL*/"menumachine/",zidx=1000;
    //--></script>
    <script type="text/javascript"
    src="menumachine/menumachine2.js"></script>
    <script type="text/javascript"
    src="menumachine/indexheader2/menuspecs.js"></script>
    </menumachine>
    </div>
    <div
    style="position:absolute;top:224px;left:16px;width:720px;height:304px;">
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    height="304" width="720">
    <param name="loop" value="true" />
    <param name="movie" value="IndexHeader2/IndexBody.swf"
    />
    <param name="quality" value="best" />
    <param name="play" value="true" />
    <embed height="304" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    src="IndexHeader2/IndexBody.swf"
    type="application/x-shockwave-flash" width="720" quality="best"
    play="true" loop="true"></embed>
    </object></div>
    </div>
    <p></p>
    </body>
    </html>

    The problem you are encountering is that you are telling the
    SWF to loop, when in fact you need to tell the FLV to loop.
    Unfortunately, you need to code a few lines of Actionscript
    to get this to work, you would think that it would be as simple as
    just checking an option.
    I don't know if you have an AS2 or AS3 project, so I'm going
    to give you both for the code.
    Actionscript 2:
    1. Select the FLVPlayback component on the stage.
    2. In the Actions panel, enter the following:
    on(complete){
    this.autoRewind = true;
    this.play();
    Actionscript 3:
    1. Select the FLVPlayback component on the stage, and give it
    an instance name by entering some text in the properties panel.
    (Upper left corner of the panel, right under where it says
    "Component" there is a text input box. This is where you input it.)
    Names are commonly things like "myFLVPlayback" or "myVideo" etc.
    2. Deselect everything.
    3. In the actions panel, enter the following (replacing
    "myVideo" with the instance name you chose):
    myVideo.addEventListener(VideoEvent.COMPLETE,doLoop);
    function doLoop(evt:VideoEvent):void {
    evt.currentTarget.play();
    Either of those blocks of code should work for you. Simply
    add them to your flash project and re-export the SWF.

  • Help re: Flash Output File Structure

    I need to create an easily clickable "Start Presentation" button for a client off a thumb drive/usb drive. I have outputted my DVD content as Flash and everything works as originally exported....however, my client is never going to know to click on the "index.html" file to begin the presentation.  Apparently if I try to move the index.html file outside of the same folder as the XML and SWF, the whole thing no longer works.  Does anyone have any tips on how to solve this problem?  Ideally, I would like the client to be able to click on the drive and see a Start Presentation button (an alias, an html file, etc) and a Files folder that contains everything else but I haven't been able to either successfully edit the index.html file, or create an alias for macs and shortcut for pcs and have them still work after sharing with another machine.
    Please can anyone help?

    I'll try to take a look at this later.
    Not really an Encore question beyond confirming that you have to keep the index.html file in the folder with the other stuff.
    But your problem is getting any page to open from the thumbdrive insertion/root.
    Worst case: put a web page named "DoubleClick This To Access video.htm" which gives them a button to the index.htm page

  • Help need to create a query

    I need to fetch records from a table. Please help me to create a query
    The Tablename is Employee. It has the following records
    Department Empname Gender
    Finance Tom Male
    Finance Rick Male
    Finance Stacy Female
    Corporate Tom Male
    Corporate Rob Male
    I want to select the value of the Gender field from the Employee table corresponding to a Department
    If all the values in the Gender field are 'MALE' corresponding to 'finance' in the Department field, the value should be 'MALE'
    If there is a value 'FEMALE', the gender corresponding to the Empname 'TOM' should be considered as the gender

    Tables have rows - not records.
    Your question is a basic SQL language question - which means you do not know the SQL language. This forum is not a classroom for teaching you the SQL language.
    Use the following as the basic outline of how your SQL language statement need to look like for selecting the required from the table:
    SELECT
      <<sql projection goes here>>
    FROM <<table name goes here>>
    WHERE <<filter conditions go here>>
    {code}
    The SQL projection specifies the list of columns the SQL need to return to the caller.
    The filter condition is basic predicates and AND and OR  can be used for multiple predicates.
    Go to http://tahiti.oracle.com and look for the +SQL Reference Guide+ for the Oracle version you are using. The +SELECT+ statement syntax is covered in detail and sample statements are provided.
    And please do not expect this forum to be used as a classroom, or expect this forum to do your homework for a class.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help needed to create Quik Time VR movies, step by step

    Hello,
    thank you for your attenction.
    I need to create Quick time vr movies, and I need to know the exact sequance of steeps to do it, and if the starting point I use is correct.
    1) I shooted a sequence of photos with my digital camera (for example: www.stebianchi.com/quicktimevrhelp/still-photo.jpg).
    2) Then, with photoshop (CS4) I choose: Automate/photomerge and I select all them to joint them in a bigger 360° panoramic one (www.stebianchi.com/quicktimevrhelp/pan.jpg). If, untill here, all is correct, the first question: in photoshop Photomerge layout option, do I have to choose one voice "auto, perspective, cylindrical, spherical, etc..." rather than anoter one of these?
    3) from here, I really need your help.
    First of all: the great doubt:
    My photos can not cover a spherical panorama, they're only a "ring" around a center (and not a spherical texture). To cover all the surface (or almost all, ok...) of my ambient, do I have to use a wider lens on my camera or there is a different solution (for ex a vertical photomerge?).
    4) Done this, I think I shuold buy a software like Cubic converter, to set and export the QTVR movie. Right?
    Thanks a lot guys,
    all the best!
    Stefano

    You can call your local apple store(find one on the home page of apple.com) and they will give you instructions how to convert DVD to iPod. That is what they told me, but from what I heard, you may need more than Quicktime Pro. Just call and ask them, because if you make a manual of how to do it, it could help me a lot.
    (I'm looking for a good DVD converter, already know some, beside the internet download ones)

  • Help needed for creating 1 invoice for 2 different material types.

    Dear, Gurus
    I really need help here I have spent 3 days cracking my head trying to solve the problem. Problem is client was creating invoice with reference to order and while invoice was being made it would cause an invoice split. The materials involved are Trading Good and Service Material. They would like only 1 invoice. Note nothing was different except material group and item cat. of the material. payment terms billing dates partners everything is same.
    Current item config for Trading Good material is ZMPI-project item cat.
    Copying requirements   023  Item ord.ref. w/o AZ        Billing quantity     A
    Data VBRK/VBRP         000                                           Pos./neg. quantity   +
                                                                                    Pricing type         K
                                                                                    PricingExchRate type
                                                                                    Price source
    Current item config for service Material is TAD-Service
    Copying requirements   002  Item/order-related          Billing quantity     A
    Data VBRK/VBRP         001  Inv.split (sample)            Pos./neg. quantity   +
                                                                                    Pricing type         G
                                                                                    PricingExchRate type
                                                                                    Price source
    I was told to change Data VBRK/VBRP to 003 One Invoice which I did in both of these item cat. and yes they worked perfectly but at time of creating the invoice for service material the qty that showed was 11. Note: In sales order it is 1 qty. So I went back into the config of item cat TAD and changed copying requirement to 023 instead of 002 but nothing changed. Seems a qty of 10 is referencing something else which I have no idea what or where it is picking this up from. Just to see or test things I went into the sales order and tried changing the service material qty then a weird popup appears and says service order 12344456 has been blocked. (Seriously I have no idea why this would happen or should be existing at all.) Even if for some reason it is being referenced the service order that is existing is qty 1.
    I really really do need help and if someone can help me that would be god sent.
    Regards, Ali

    You did not mention what value is maintained in the field billing quantity in the copy control->Item settings. Check for the service item, what value is assigned. Put value A and re-test.
    Note that whenever you change any settings in configuration side, you need to create a new documents to test the results of the settings. You should not use the existing documents.
    When you say the document is blocked, then check the status of the sales order to find the reason for blocking (like credit block, approval etc)..
    Regards,

  • Help needed to create a CSS 'style-switcher' button.

    Hi,
    I need some help please in creating alternate style sheets for each page on a site I'm creating to enable users to change text size (i.e. small, normal and large options - sometimes, symbolized as a letter 'A' in varying sizes). The site has been built in basic format so far but I would like to add these features for the sake of usability. There are no actual problems with the site as it currently works fine, it's just this one thing I need help with.
    Is this possible using post-processing methods, (which I have no problem doing) and if so could someone kindly point me in the right direction? I've searched the iWeb forum using keywords most relevant to this question and have found nothing.
    Any help greatly appreciated,
    Matt
    MacMini G4 1.42GHZ   Mac OS X (10.4.8)  

    Thanks varkgirl,
    This works (partially): this is the page:
    http://www.charitydesigns.com/odyssey/index.html
    The first paragraph is not responding and at larger sizes line spacing is not in proportion to the size of the text (and is squashed), what am I doing wrong?
    Hope you can assist.

  • Hi, I'm new to Mac and need my photo file structure to resemble what it was on my PC

    I uploaded all my new photos from my PC, which then fed into iphoto.
    However when I look into the iphoto library they have automatically created folder and file names, rather than what they were names in my PC. In the iphoto ap they appear fine there.
    How do I get the library structure to resemble the folder names given in the iphoto ap or on my old pc?
    It is the latest operating structure and iphoto ap running.

    Just tp highlight a couple of major issues with a referenced library
    Importing: Copy items to the iPhoto Library
    This preference is turned on by default. When you import photos from a hard disk, iPhoto copies(duplicates) the photos to the iPhoto library and uses the copies. The original photos remain untouched in their current locations.
    If you have an extensive collection of photos on your computer and you want to keep your current file organization, you can have iPhoto point to your original photo files instead of importing them into your iPhoto library. To have iPhoto access your photos from their current locations on your hard disk (rather than making copies of them), deselect this checkbox. Note that if you edit one of these images in iPhoto, the edited version is saved in the iPhoto library and the original file remains untouched.
    If you turn off this preference, be sure not to move the photos from the location from which they were imported. If you move the files, your iPhoto library won’t work correctly.
    So you still have not reporduced the PC structure since you only have that structure for the original photos - no edits appear in that structure
    Importing is more compicated
    Deleting ai more complicated since you have to delete form iPhoto nand then from yoru own managed file structure
    and most critically you can not more the photos - so replacing defective hardware or upgrading to a larger hard drive or to a new computer is not possible
    Plus there is no gain from a referenced library - so I suggest you do not recommend it since it does not work for hardly anyone
    LN

Maybe you are looking for

  • ORA-01092: ORACLE instance terminated Disconnection forced on standby

    Hi, I have following scenario. I have setup dataguard in which Primary and standby are of diffrent oracle releases. PRimary database : 10.2.0.1.0 Stand by : 10.2.0.4.0 Primary database - Windows 2000 Standby : Windows -2008 I have sync both database

  • My Mac is slow- I see rainbow ball. What can I do?

    MacBook Air(late 2008) 1.6GHz, 2GB DDR3 RAM, 120GB HD, OS X 10.10 (Yosemite) Machine is running slow- I see rainbow ball when I click an app or  try to do something. Ipadeola John Nigeria

  • Advice needed on home hubs

    Hi all, I'm currently on a long line and having slow speed problems and drop outs. I'm looking to buy a new hub as a last ditch attempt to improve the situation, my line attenuation is 63.5dB. Can anyone offer advice as to whats the best to purchase 

  • PDF or MS Word Document for  Query7.0 ?

    Hello, How Can I realize this... PDF or MS Word Document for  Query7.0 ? THANKS

  • Template page and CSS dialog box.

    Basically, this is an issue/bug for me. I had something working on Dreamweaver CS6 (CS3, 4 and 5 also... oh and Macromedia Dreamweaver 8 too) that doesn't work in Dreamweaver CC. Please, consider that an answer like "it's the new way that it should r