What is the correct format of filepath string on Mac os x?

I am trying to retrieve a file from Mac os x by:
File file=new File(filepath);
My boot volume name is "myVol", and filepath is "/myVol/opt/ab.txt". However, when I provide this path, the file is not found. I just figured out that if I use "/opt/ab.txt" the correct file can be found!!
Now, if I have a shared volume on my machine(I got it by menu "Go-->Connect to Server..."), whose name is "Mac Share", the filepath should be something "/Mac Share/test/123.txt". File file=new File("/Mac Share/test/123.txt") can not find the file. It looks like that it's trying to find 123.txt from /myVol/Mac Share/test directory, which doesn't exist. I even tried "//MacShare/test/123.txt", "Mac Share/test/123.txt", etc., and none of them worked!!
If you know the correct format to specify the filepath on Mac OS x, please give me help!!!!
Thanks in advance.

I don't know the exact answer to your question, but you can probably figure it out on your own like:
1) Create a File object that represents an existing file. Play around with the path until the file can be found.
2) Now that you have a File object representing a valid, existing path, use MyFile.getAbsolutePath() to see what the full path string is. MyFile.getCanonicalPath() might provide some answers as well.
Whatever getAbsolutePath() returns is the correct format for the file path string.

Similar Messages

  • What is the correct format for localhost URL?

    I've installed MAMP to run a local test server.
    This appears to be working correctly with the URL in the following format:
    http://localhost/folder/filename.php/
    Where folder is the folder for the site located inside the Apache Document Root Folder - as defined in the MAMP preferences.
    I have web sharing turned off.
    Looking around the web it seems that the format for the URL should be:
    http://localhost/~username/folder/filename.php
    However, when I insert "~username" in the URL the browser can't find the page.
    These are my first tentative steps in setting up a local test server and so I'm concerned that something might be amiss!
    I've hunted around and can't find any documentation that clarifies the issue.
    Can anyone clarify the issue or point me to appropriate documentation.
    Thanks.

    The second format is for a different location - in your Home folder.  This would work if; a. Apache was installed using the Home folder; and b. if "folder" existed in the Home folder.  Use the form you are currently using since it works.

  • What is the correct format to view 3D photos on 32TL515U?

    I am able to view 3D video from a USB HDD, whether downloaded from YouTube or created by my own pair of webcams, using the Media Player on my 32TL515U (as long as the video consists of left and right frames side-by-side with no gap between them).  When this works it looks great!  Unfortunately I have tried everything I can think of, but so far found no way to display still image stereo pairs the same way in 3D.  When I use the Photo Media Player to view a stereo pair it first presents the actual side-by-side pair in 2D, then when I activate 3D it automatically jumps into the 2D-to-3D mode, which just gives me a psuedo-3D view of the original side-by-side pair.  If I try to change the 3D Settings from the Quick Menu, the only option available to change is the 2D-to-3D Depth.
    Is it possible to view still photos (stereo pairs) in true 3D?  If so, how?  Is there a special format or trick that I must use to prepare or arrange my left and right images?  Any tips would be appreciated.

    When you export the videos out of iPhoto be sure to select Kind = Original.  Otherwise you'll just get an image file of the first frame of the video.
    OT

  • 1.4.2 - What is the correct way to format output in the java.io.PrintStream

    With Java 1.4.2:
    What is the correct way to format output in the java.io.PrintStream?
    The following is incorrect, even though it is still used in the The JavaTM Tutorial at: http://java.sun.com/docs/books/tutorial/essential/
    System.out.formatThis returns "cannot resolve the method 'format'"
    Any detailed suggestions or information is greatly appreciated.

    The following is incorrect, even though it is still
    used in the The JavaTM Tutorial at:
    http://java.sun.com/docs/books/tutorial/essential/
    The whole format thing has been introduced in 1.5. The tutorial also states it's been "updated to 1.5.".
    That's all I've got to say for I don't know how you can format a PrintWriter, let alone a PrintStream, prior to 1.5. I'm not really sure there is any way. Any "legacy way", that is. There almost certainly are third-party API which achieve similar results.

  • What is the correct way to format file paths and names in the structapp file?

    I am trying to create a structured application to export fm files as xml, and probably read the xml back to fm.
    In the structured application file (structapp), I need to specify the locations of the various files (DTD, read/write, template, etc). I would like to place these files on a shared server so others can use the same structapp file (that is, a cop of it). What is the correct way to format the file paths and names? Can folders folder names and file names have spaces in them? I tried the following, for example:
    \\serverName\shareName\folder 1\folder 2\file name.dtd
    I use the same format for the template file and the read/write rules file.
    When I try to save an fm file to xml, FrameMaker says that it cannot read the DTD; however, the resulting xml file appears to be well-formed. The DOCTYPE element in the resulting xml is formatted with forward slashes and spaces replaced with %20.
    I tried using forward slashes and replacing spaces with %20, but then I get an error about reading the read/write rules.
    NOTE: I have another structured application to read xml into fm. This application does not have a DTD file. The template and read/write rules files are specified as above. Except for complaining about a lack of a DTD, the application works fine; it even applies an XSLT in the process. Again, when I DO add a DTD to this latter application, I get the same complaint about not being able to read the DTD.
    I am using fully patched FrameMaker 9 in Windows XP.
    Thanks,
    Van

    Hi Van,
    The XML parser and FrameMaker are not the same thing. The Error Log says which component created which message. The XSL processor is another option that can throw messages. The "\\server\path\some.dtd" syntax in structapps.fm seems to be fine for some tools, as Internet Explorer with XML tools successfully finds the DTD which appears as "//server/path/some.dtd" in the XML. But apparently Xerxes, the XML parser bundled with FrameMaker, does not like this notation.
    If you have a path with a drive letter, "H:\path\some.dtd", FrameMaker turns that into "file:///H:/path/some.dtd". It seems, Xerces would like to see "file:/" in front of absolute paths.
    This is what I have in structapps.fm:
    Template: \\server\path\projecttemplate.fm
    DTD: some.dtd
    Read/write rules: \\server\path\projectrules.txt
    DOCTYPE: …
    Entity locations
      Entity search paths
        1: \\server\path\
    In the structapps.fm I have the DTD without path information. The resulting XML (without XSL postprocessing) then contains just the file name with a relative path back to the book folder (when saving a book as XML). It therefore requires the DTD to be available at this place. I handle this using an event script that fires for NotePreSaveXml and copies the DTD to the folder of the original document.
    As I always use XSL postprocessing and using XSLT1 it is not possible to have the doctype-system as a parameter I have this in my XSL stylesheet:
    <xsl:output doctype-system="some.dtd" />
    For the resulting XML the DTD is expected to be in the same folder as the XML file. This is handled by the same event script as above, it therefore copies the DTD to the source and the target folder.
    Bottom line: If you want/have to use UNC paths, you have to do some programming to work around a FrameMaker bug.
    - Michael

  • I recently set up multiple accounts and when I was trying to figure out how to share files I messed up something in my documents. Everytime I open a doc from the ADMIN account, a box pops up that says "The file is not in the correct format" how to fix?

    I recently set up multiple accounts on my imac, When I was trying to figure out how to share the documents I must have done something wrong. When logged into the Admin account, I open up any document and I get a message box that says, "The Document could not be opened. The file isn't in the correct format. The file might be corrupted, truncated, or in an unexpected format." What did I do and how do I fix it?

    Without knowing what you did it is impossible to give advice on how to correct it.
    If these were files you copied over from some other system then just Re-Copy them replacing the ones that are corrupted.
    Other then that I suggest you Wipe the drive and start over with a clean reinstall of the OS and programs. Then if you want to share files to All Accounts place those files in a folder in the ROOT of the drive.

  • What is the correct syntax for using a variable in an ad hoc query?

    Hi all
    I am an occasional DB user and at the moment need to update about 1000+ records so that a certain column gets a unique value.
    So I thought that I would use a variable for this.
    I then built this kind of SQL statement for just a small subset of the records:
    variable recNumber number;
    exec :recNumber := 1;
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD + recNumber
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');
    I get the invalid SQL statement error when attempting to execute above (besides the prompt that asks for a value which I would like to omit).
    Anyway I also tried this one:
    CREATE SEQUENCE seqCounter;
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD + seqCounter.NEXTVAL
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');
    From this one I got the error ORA-01722: invalid number...I am guessing this comes because seqCounter is of type number and the COL_TO_BE_UPD is of type character...(?)
    So what I would like to ask is what is the correct way to define and use a counter type of variable to append a number at the end of a character string?
    Also another question that I would like to ask is that are variables that are used in ad hoc queries also called 'bind variables'?
    Thanks muchly

    If you want to append a unique number to a column then this would do it:
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD ||to_char(rownum)
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');

  • What are the correct answers ?

    after doing one sample swing application, i assumed the exam will be easy. when i took the exam, i couldn't do anything...
    what are the correct answers ??/
      Which one of the following converts the Image i into the BufferedImage bi? 
    Choice 1  
    bi = new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,i.getHeight(this),i.getWidth(this)); 
    Choice 2  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    bi.drawImage(i,0,0,this); 
    Choice 3  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,0,0,this); 
    Choice 4  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this), BufferedImage.TYPE_INT_RGB); 
    Choice 5  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this)); 
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout 
      Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself? 
    Choice 1  
    CardLayout, FlowLayout, GridBagLayout, GridLayout 
    Choice 2  
    GridBagLayout 
    Choice 3  
    BorderLayout, GridLayout 
    Choice 4  
    BorderLayout, FlowLayout, GridLayout 
    Choice 5  
    BorderLayout, CardLayout, FlowLayout, GridBagLayout, GridLayout 
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout(
                          new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb); 
      Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other? 
    Choice 1  
    jtf and jb are in the top-center of the Jframe; jtf is to the left of jb, 2 pixels apart. 
    Choice 2  
    jb is in the top-right corner of the JFrame with jtf 1 pixel to the left of it. 
    Choice 3  
    jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it. 
    Choice 4  
    jb is in the top-right corner of the JFrame with jtf 2 pixels to the left of it. 
    Choice 5  
    jtf is in the top-left corner of the JFrame with jb 2 pixels to the right of it
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used
    Sample Code 
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used. 
    How must do you interact with a JTextField in order to generate an ActionEvent? 
    Choice 1  
    Tab into the JTextField from another Component. 
    Choice 2  
    Type in the JTextField. 
    Choice 3  
    Activate the cursor in the JTextField. 
    Choice 4  
    Hit <RETURN> while the cursor is in the JTextField. 
    Choice 5  
    Hit the spacebar while typing in the JTextField. 
    double-buffering
    public class TimerTest implements ActionListener{
      public static void main(String[] args){
        TimerTest test = new TimerTest();
        javax.swing.Timer timer = new javax.swing.Timer(100,test);
      public void actionPerformed(ActionEvent ev){
        System.out.println("Timer ticked.");
      Given the above sample code, what is the result when the code is run? 
    Choice 1  
    The words "Timer ticked." are printed to the console once after 100 milliseconds. 
    Choice 2  
    The words "Timer ticked." are printed to the console every 100 microseconds. 
    Choice 3  
    The words "Timer ticked." are printed to the console every 100 seconds. 
    Choice 4  
    The words "Timer ticked." are printed to the console every 100 milliseconds. 
    Choice 5  
    Nothing, the Timer is not started. 
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2); 
      What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick? 
    Choice 1  
    Replace line 3 with slider1.setMajorTickSpacing(17); 
    Choice 2  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(17);
    Replace line 4 with slider1.setMinorTickSpacing(5); 
    Choice 3  
    Replace line 3 with slider1.setMajorTickSpacing(5);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 4  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(20);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 5  
    Replace line 4 with slider1.setMinorTickSpacing(6); 
       Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time? 
    Choice 1  
    ButtonGroup g = new ButtonGroup();
    g.add(b1); g.add(b2); g.add(b3); 
    Choice 2  
    b1.group(true); b2.group(true); b3.group(true); 
    Choice 3  
    JRadioButton jbs[] = {b1, b2, b3};
    ButtonGroup g = new ButtonGroup(jbs); 
    Choice 4  
    The default behavior of JRadioButtons is such that only one can be selected at a time as long as they are in the same Container. 
    Choice 5  
    ButtonGroup g = new ButtonGroup(b1, b2, b3); 
    Sample Code 
    public static void main(String args[]){
      What is the role of the method in the code above? 
    Choice 1  
    To provide a place for initialization code when instantiating the current class. 
    Choice 2  
    It is the first method run when a class is run with the Java Interpreter. 
    Choice 3  
    It serves no specific function. It is a residual method from Java 1.0. 
    Choice 4  
    It is the first method that the Java Compiler converts to bytecode when creating a .class file. 
    Choice 5  
    To process command-line parameters when running the Java Interpreter 
    How do you create a menu item, Save, with a shortcut key of Ctrl+S? 
    Choice 1  
    You have to override the KeyPressed event of the top level Frame and handle the Ctrl+S to call the menu item's actionPerformed. 
    Choice 2  
    JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK)); 
    Choice 3  
    JMenuItem save = new JMenuItem("Save");
    save.enableShortcut(KeyEvent.CTRL_KEY + KeyEvent.S); 
    Choice 4  
    JMenuItem save = new JMenuItem("Save");
    save.setMnemonic("Ctrl+S"); 
    Choice 5  
    JMenuItem save = new JMenuItem("Save");
    save.addShortcutKey( new KeyStroke(KeyStroke.S | KeyStroke.CTRL_KEY) ); 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    Which one of the following is necessary when changing an Applet to a standalone application? 
    Choice 1  
    Add a no-argument constructor. 
    Choice 2  
    Remove the init(), start() and stop() methods. 
    Choice 3  
    Remove "extends JApplet" or "extends Applet". 
    Choice 4  
    Add a main() method. 
    Choice 5  
    Change the import statement so that it imports an Application container rather than Applet or JApplet. 
    Which one of the following adds the String "Java" to the JComboBox jcb? 
    Choice 1  
    ComboBoxModel cbm = jcb.getModel();
    cbm.addItem("Java"); 
    Choice 2  
    jcb.setText("Java"); 
    Choice 3  
    ComboBoxModel cbm = jcb.getModel();
    cbm.add("Java"); 
    Choice 4  
    jcb.add("Java"); 
    Choice 5  
    jcb.addItem("Java");

    I'll have a go but I am not saying they are all correct...
    Question 1.
    Which one of the following converts the Image i into the BufferedImage bi?
    Choice 3 (assuming this implements the imageobserver interface)
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);  //1 is BufferedImage.TYPE_INT_RGB
    Graphics2D g = (Graphics2D)  
    bi.createGraphics();
    g.drawImage(i,0,0,this);Good luck with your homework...
    nes
    Question 2.
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout
    Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself?
    Choice 4
    BorderLayout,
    FlowLayout,
    GridLayout
    (GridBagLayout uses GridBagConstraints to decide component spacing, card layout does not provided component spacing due to the deck nature used)
    Question 3.
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout( new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb);    Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other?
    Choice 3 jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it.
    Question 4
    public void drawText(Graphics2D g, String text)
         Font f = new Font("Century Gothic", Font.BOLD, 10);  
         g.setFont(f);  
         g.drawString(text, 20, 20);
    }    Given the above sample code, what happens if the "Century Gothic" font is NOT available?
    Choice 5 A default Font object is returned and is used
    Question 5.
    How must do you interact with a JTextField in order to generate an ActionEvent?
    Choice 4 Hit <RETURN> while the cursor is in the JTextField.
    Question 6.
    public class TimerTest implements ActionListener
         public static void main(String[] args)
               TimerTest test = new TimerTest();    
               javax.swing.Timer timer = new javax.swing.Timer(100,test);  
         public void actionPerformed(ActionEvent ev)
              System.out.println("Timer ticked.");  
    }    Given the above sample code, what is the result when the code is run?
    Choice 5 Nothing, the Timer is not started.
    Question 7.
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2);    What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick?
    Choice 4 Replace line 2 with slider1.setPaintTicks(true); Replace line 3 with slider1.setMajorTickSpacing(20); Replace line 4 with slider1.setMinorTickSpacing(4);
    Question 8.
    Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time?
    Choice 1 ButtonGroup g = new ButtonGroup(); g.add(b1); g.add(b2); g.add(b3);
    Question 9.
    Sample Code
    public static void main(String args[]){ }
    TYPO - should be public static void main(String[] args){ }
    What is the role of the method in the code above?
    Choice 2 It is the first method run when a class is run with the Java Interpreter.
    Question 10.
    How do you create a menu item, Save, with a shortcut key of Ctrl+S?
    Choice 2 JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK));
    Question 11.
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1); gbl.addLayoutComponent(jb,gbc1);
    In regards to the above code, which one of the following indicates jb's grid position?
    Choice 3 Grid position 1, 1
    Question 12
    Which one of the following is necessary when changing an Applet to a standalone application?
    Choice 1 Add a no-argument constructor.
    Choice 2 Remove the init(), start() and stop() methods.
    Choice 3 Remove "extends JApplet" or "extends Applet".
    Choice 4 Add a main() method.
    Choice 5 Change the import statement so that it imports an Application container rather than Applet or JApplet.
    mmm. not a good choice of answers. look at the following link...
    http://forum.java.sun.com/thread.jsp?forum=57&thread=218096
    Question 13.
    Which one of the following adds the String "Java" to the JComboBox jcb?
    Choice 5 jcb.addItem("Java");

  • What is the correct way to add styling to drag-and-drop created calendars?

    I have a working instance of a rich client calendar. I generated the view with the required fields (start, stop, provider, ...), put it into the App Module, and dragged it onto a JSF page to create a calendar.
    Next I created an activityScope object in a class called CalendarBean (no inheritance)
    Class CalendarBean()
    private HashMap<Set<String>, InstanceStyles> activityColorMap;
    +..+
    +public CalendarBean() {+
    super();
    activityColorMap = new HashMap<Set<String>, InstanceStyles>();
    HashSet setEd = new HashSet<String>();
    HashSet setLen = new HashSet<String>();
    setEd.add("Work");
    setLen.add("Home");
    activityColorMap.put(setEd, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityColorMap.put(setLen, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.RED));
    +}+
    +}+
    Next, I linked this up as a backing bean and associated the ActivityStyles of CalendarBean to it:
    +#{backingBeanScope.calendarBean.activityColorMap}+
    I populated some records in the database with properties "Work" and "Ed', but they show default blue.
    As I understand it, I need to do something with the getTags() method of the underlying CalendarActivity class, but I'm not quite sure how to do that.
    Took a stab at creating a class, CalendarActivityBean, that extended CalendarActivity, and pointed all the CalendarActivity references I had to the new class, but it didn't seem to fire (in debug), and I got into trouble, when inserting records, with
    public void calendarActivityListener(CalendarActivityEvent calendarActivityEvent) {
    currActivity = (CalendarActivityBean) calendarActivityEvent.getCalendarActivity();
    being an illegal cast
    What is the correct way to add provider-based styling to drag-and-drop create calendars?
    Ed Schechter

    A colleague of mine was kind enough to solve this:
    The calendar has ActivityStyles property = #{calendarBean.activityStyles}
    CalendarBean looks something like this:
    package com.hub.appointmentscheduler.ui.schedule;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import oracle.adf.view.rich.util.CalendarActivityRamp;
    import oracle.adf.view.rich.util.InstanceStyles;
    +public class CalendarBean {+
    private HashMap activityStyles;
    private String dummy;
    +public CalendarBean() {+
    +// Define colors+
    activityStyles = new HashMap<Set<String>, InstanceStyles>();
    HashSet setPending = new HashSet<String>();
    HashSet setArrived = new HashSet<String>();
    HashSet setApproved = new HashSet<String>();
    HashSet setCompleted = new HashSet<String>();
    setApproved.add("APPROVED");
    setPending.add("PENDING");
    setArrived.add("ARRIVED");
    setCompleted.add("COMPLETED");
    activityStyles.put(setApproved, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.GREEN));
    activityStyles.put(setPending, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityStyles.put(setArrived, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.PLUM));
    activityStyles.put(setCompleted, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.LAVENDAR));
    +}+
    +public void setactivityStyles(HashMap activityStyles) {+
    this.activityStyles = activityStyles;
    +}+
    +public HashMap getactivityStyles() {+
    return activityStyles;
    +}+
    +}+
    Now, go into the Bindings tab on the calendar page, double click the calendar binding, and specify the column you've defined as the calendar's Provider in the Tags dropdown.
    Should show colors.

  • Cannot open a downloaded pdf file..."The file couldn't be opened because it isn't in the correct format."

    I have had this problem several times lately: I cannot open a downloaded pdf file. The error message reads: "The file couldn't be opened because it isn't in the correct format." But, of course, it is a pdf file.

    My MacBook Pro (2.5 Ghz Intel Core i5) is running OS X 10.9.4. Here is what happens when reading an online user manual that I want to save to the Desktop and read later as a PDF file on my iPad or phone. With Safari I will select "Export As PDF" and the file shows up on the desktop. Even after multiple trials, there will be a dialogue box indicating the file cannot be opened. If I check the file info, the size is "zero." Trying to save the file as a pdf using the Print menu yields the same results. I have tried both of these methods using Preview, Adobe Reader, and PDF Pen Pro. This strange behavior also occurred several weeks ago and I finally abandoned the effort. But when the same thing happens twice, it becomes an issue that needs to be resolved.

  • What is the minimal Format of an iCal event to attach to an email?

    Hello all!
    I just finished a large order page for a taxi friend. I would like to send the order with an iCal event attached to an email. He should only click on this new file, to enter this pickup order to his iCal ...
    I am struggling with the format. In my CGI script I have the following format, where the $variables are replaced with the convinient strings:
    BEGIN:VCALENDAR
    BEGIN:VEVENT
    DTEND;TZID=Europe/Berlin:$ical_data_end
    SUMMARY:$ical_summary
    DTSTART;TZID=Europe/Berlin:$ical_data_start
    DTSTAMP:$ical_dtstamp
    LOCATION:$ical_location
    SEQUENCE:0
    DESCRIPTION:$ical_comment
    BEGIN:VALARM
    TRIGGER:-PT1H
    DESCRIPTION:Event reminder
    ACTION:DISPLAY
    END:VALARM
    END:VEVENT
    END:VCALENDAR
    Does a time string like "20120608T123500" has to finish with a "Z" ? Do I need additional informations, like "UID:", "X-WR-ALARMUID:" ... In any case my iCal event sent by email is not adding to the iCal saying: "iCal can't read this calendar. No events have been added to your iCal calendar."
    I would be grateful for any hint
    marek

    Surprise Surprise!
    I realized after heavy testing, that a DTSTAMP: is not needed.
    But there is apparently a problem with the DATE-TIME format: Perhaps for other readers, which are in such a desparate situation, as I am since two days now!!! here some explanations:
    The reference about iCal format you find in RFC 5546
    DTSTART; and DTEND; have a time string like follows:
    yyyymmddThhmmss
    In the middle the big letter "T". But you have to add the time zone: for me it is the following:
    DTSTART;TZID=Europe/Berlin:20120608T062500
    Now the big surprise: this time format with an hour over 12 ooops! I tested now once again like follows
    DTEND;TZID=Europe/Berlin:20120608T212500
    DTSTART;TZID=Europe/Berlin:20120608T202500
    changing the hh (hours) with one hour difference up until here. 10 Minutes again, iCal was freezing with hours over 19. I swear!
    Ok to answer my original question: What is the minimal format of an iCal event, which you may attach to an email:
    BEGIN:VCALENDAR
    BEGIN:VEVENT
    DTEND;TZID=Europe/Berlin:20120608T212500
    SUMMARY:Name
    DTSTART;TZID=Europe/Berlin:20120608T202500
    LOCATION:MUC
    SEQUENCE:0
    BEGIN:VALARM
    TRIGGER:-PT1H
    DESCRIPTION:Event reminder
    ACTION:DISPLAY
    END:VALARM
    END:VEVENT
    END:VCALENDAR
    But be aware, that this is buggy. Be carefull and have a nice evening
    marek

  • Applescript: isn't in the correct format?

    Hi, i wanted to make a script that would randomly take an image from a fodler of life drawing models and landscript that i would then have to draw.
    Everything seemed to be working fine with it but all of the sudden im getting 2 different messages whenever the script is run.
    The first message i get is:
    The file couldn’t be opened because it isn’t in the correct format.
    The file might be corrupted, truncated, or in an unexpected format.
    I went to the image that wasn't working and double clicked it and it opened fine in Preview.app so i wasn't sure why it wasn't working with the script but was with the double click.
    the other message im getting is a permissions message but i can't seem to get that to come back up at the moment to copy and paste it here, but it looks like the normal "you do not have permission to view this file" sort of thing.
    i've checked permissions and i've repaired them just encase but no issues or warning came up so im not sure what the issue with the permissions could be.
    here is the script i have used to make it select and open a random image.
    with timeout of 36000 seconds
        tell application "Finder"
            activate
            if (count items) of folder "MonkeyBook Pro:Users:Monkey:Documents:Guardian Classes:Drawing Tasks:" is 0 then
                display dialog "You Have Completed All Available Drawning Tasks, Please Add More To Folder" with icon stop buttons {"Open Folder", "Random Image Site", "Close"}
                set the button_pressed to button returned of the result
                if the button_pressed is "Open Folder" then
                    tell application "Finder"
                        activate
                        open "MonkeyBook Pro:Users:Monkey:Documents:Guardian Classes:Drawing Tasks"
                    end tell
                else if the button_pressed is "Random Image Site" then
                    tell application "Safari"
                        activate
                        open location "http://photo.net/photodb/random-photo?category=NoNudes"
                    end tell
                end if
            else
                activate
                set question to display dialog "Time For Some Drawing
    Warning These Photos May Be Of An Adult Nature" with icon stop buttons {"Not Possible At The Moment", "OK"}
                set answer to button returned of question
                if answer is equal to "OK" then
                    tell application "Finder"
                        set randomImage to some file of folder "MonkeyBook Pro:Users:Monkey:Documents:Guardian Classes:Drawing Tasks"
                    end tell
                    tell application "Preview"
                        open randomImage
                    end tell
                    tell application "Finder"
                        move randomImage to folder "MonkeyBook Pro:Users:Monkey:Documents:Guardian Classes:Completed Tasks:"
                    end tell
                end if
            end if
        end tell
    end timeout
    Anyone got any idea why this might be happening?

    I think the issue comes from the fact that the picture is moved to the Completed Tasks folder before Preview.app has had time to open it properly. So, if I'm right, adding a short delay before moving the picture should fix the issue.
    Maybe you might want to try this simplified version of your script:
    set DrawingTasks to POSIX file "/Users/Monkey/Documents/Guardian Classes/Drawing Tasks"
    set CompletedTasks to POSIX file "/Users/Monkey/Documents/Guardian Classes/Completed Tasks"
    tell application "Finder"
        activate
        if (count items of folder DrawingTasks) is 0 then
            display dialog "You Have Completed All Available Drawning Tasks, Please Add More To Folder" with icon stop buttons {"Open Folder", "Random Image Site", "Close"}
            set the button_pressed to button returned of the result
            if the button_pressed is "Open Folder" then
                open folder DrawingTasks
            else if the button_pressed is "Random Image Site" then
                tell application "Safari"
                    activate
                    open location "http://photo.net/photodb/random-photo?category=NoNudes"
                end tell
            end if
        else
            set question to display dialog "Time For Some Drawing." & return & return & "Warning: These Photos May Be Of An Adult Nature" with icon stop buttons {"Not Possible At The Moment", "OK"}
            set answer to button returned of question
            if answer is equal to "OK" then
                set randomImage to some file of folder DrawingTasks
                tell application "Preview" to open randomImage
                delay 2 -- adjust to fit your needs
                move randomImage to CompletedTasks
            end if
        end if
    end tell

  • What's the correct way to set up an external style playing keyboard

    Hi
    what's the correct way to set up an external style playing keyboard?
    i want the keyboard to use the Logic's voices, and also to record the midi that is being inputed.
    I can do it on One Channel, but when I selct multiple channels, all the channels seem to play all of the input data!!!
    anybody??

    Check the formatting. It need to be formatted as Mac OS Extended (journaled). This is also known as HFS+.
    FAT32 and NTFS formatting will not work with iMovie.
    If necessary, you can reformat using Disk Utility.
    Make one large partition. No need for multiple partitions.
    Do moves or copies to the external drive through iMovie as detailed in iMovie Help. If you move Events in the Finder, they may become unlinked from the projects that use them.

  • What is the correct way to destory a Thread?

    Just wondering what is the correct way to destroy a thread? I am currently using the stop() method, but i noticed that it has been depreciated (along with other methods used to destroy a thread) when i looked at the thread documentation. Since this is so, then how can one correctly destroy a thread? Thanks in advance for the help.

    There is an awful lot of bad advice in this thread about what null does. Please in future check on your own with working code before offering up misguided and very wrong advice. Particularly when your advice contradicts that previously given.
    Please compile and run the following
    public class Test implements Runnable{
      public static void main(String args[])throws Exception{
        Test test = new Test();
        Thread t= new Thread(test);
        t.start();
        // have delay wait a few seconds to demonstrate
        Thread.sleep(3000);
        System.out.println("Setting reference to thread to null");
        t = null; // what does this do?
        // jack all
        System.out.println("Exiting main");
      public void run(){
        while(true){
          System.out.println("Hello from test thread!");
          try{ Thread.sleep(750); }catch(InterruptedException iDontCareAboutThis){}
    }This will output the following
    C:\>java Test
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Setting reference to thread to null
    Exiting main
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!And continues on endlessly. Setting the reference to null is NOT an answer to this problem.

  • What is the timeline format used in PremierePro CC?

    I was trying to help someone because whenever they set their export to match sequence settings AME was doing mpeg 2 encoding but i can't really find anything that states or lets you set the sequence format in the project. i can't believe MPEG jus actually the correct format to be editing in can anyone help shed light on whats happening here? thanks!

    so in both cases the first clip dropped is identical a prores 4444 intro followed by an h.264 mp4 file created by xsplit and one created by a hauppauge rocket pvr both are 1080p @ 29.97 fps. no effects but there is some volume adjustment. for some reason only the xsplit ones default to mpeg 2 output when selecting match source. for the pvr using that setting shows an mp4 output and encodes in basically 1 to 1 real time. using the match source on the xsplit generated files takes about 4 to 1 longer than real time. while setting an h264 output for the xsplit files does shorten the export a bit it still about 3 times as long of an export as compared to the exports with projects containing the files from the pvr.

Maybe you are looking for

  • Getting the length of a field in a database.

    I have a field in a database that has a char length of 20, is there anyway to get that length from the database.

  • My home wifi has just stopped working

    All of a sudden I can't connect to my home wifi network. I have tried resetting the network settings, and also resetting the ipod, none of which work. It comes up with the name of the network, with the strength of signal etc, but when I put in the pa

  • Create a view with a changing where clause

    Hi all, i'm developing an application with oracle forms i want to create a view in the database with a different where clause in every time , the where clause is determined due to the department id of the current user . thanks alot.

  • PCUI run time error...

    Hi, Can some one tell me how do I get through this? Note The following error text was processed in the system S50 : Access via 'NULL' object reference not possible. The error occurred on the application server sealcrm50_S50_50 and in the work process

  • STO in ME21N/MB1B

    hello I want to transfer stock from one plant to another plant in same company code by using transaction code MB1B with movement type OR through ME21N by using PO document type UB I am confused about the Process. Is it possible to do this Process? Un